Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
title 'CAL PC CPM-86/80 Basic I/O System'
;*********************************************
;* *
;* M-Four Basic I/O System *
;* for CPM.SYS *
;* *
;*********************************************
nolist
include m4equ.lib
include m4jump.lib
list
;*********************************************
;* *
;* Loader_bios is true if assembling the *
;* LOADER BIOS, otherwise BIOS is for the *
;* CPM.SYS file. *
;* *
;*********************************************
loader_bios equ false
cal equ true
special equ false
mpm equ false
safe equ true
include m4bios.lib
END


View File

@@ -0,0 +1,6 @@
era calcpm.h86
pip calcpm.h86=cpm.h86,calcbios.h86
era calcpm.sys
gencmd calcpm 8080 code[a88]
ren calcpm.sys=calcpm.cmd


View File

@@ -0,0 +1,366 @@
:0400000300000000F9
:1B000081E92A03E92103E902037F0020202020202020202020202020202020D4
:1B001B81434F505952494748542028432920313938302C204449474954414CA0
:0B003681205245534541524348202091
:1B008B81CDE08CCD8EC5C3B10033D2EBF38AD0B102EBEDB02051E8F4FF59C32C
:1B00A681B00DE8F5FFB00AEBF151E8F3FF5B8A070AC07501C34353E8D8FF5BC5
:1B00C181EBF1BA2708B13BEBC1B93200BA3009EBB9B13AEBB5B10DEBB18AD085
:1B00DC81B10EEBABE8A8FFA2CD08FEC0C3B10FEBF3C606470800BA2708EBF22D
:1B00F781B110E8E4FF7401C3B99B09EB20B111EBD8B112EBD4BA2708EBF3B1C2
:1B01128113EB1DE873FF0AC0C3B114EBF6BA2708EBF7E888FFE9B706B117EB16
:1B012D8104B2FFB120E956FF3C6172063C7B7302245FC3F6060508FF7458F621
:1B014881063909FF740533C0E887FFBA0608E890FF7444A01508FEC8A22608B0
:1B016381BA0608E8B2FF7534BF0A00BE4B08B98000E8C502C606140800FE0E40
:1B017E811508BA0608E871FF7417A03909E84CFFBB0B00E820FFE8320074119C
:1B019981E85600E9BF01E85000B10ABA0900E8E1FEBB0B0033C92E8A0E0A00D4
:1B01B481E30A8A07E87AFF880743E2F6882FC70635090B00C3B10BE8BDFE0A2D
:1B01CF81C07501C3B101E8B3FE0AC0C3B119EB10B133EB0C8B160308E8F5FF9B
:1B01EA81BA8000B11AE999FEF6060508FF7501C3B000A20508E8D8FEBA0608CE
:1B020581E809FFA03909E9CCFEBFDC09BE000BB90600F3A6E302EB01C3F48A01
:1B022081040AC07501C33C207303E9930157BF3B09B90900FCF2AE5FC38A0484
:1B023B813C007501C33C207401C346EBF143C60720E2FAC351E8CCFF5974F26A
:1B025681433C2A7504B03FEB01468807E2EBE8B8FF740346EBF8C3B80000BBF8
:1B027181270803D853C6063A09008B363509E8B7FF8936370974081C40807C15
:1B028C81013A7405A03909EB123C1077043C007705B4FF5BEB39A23A09464621
:1B02A7818807B90800E8A0FFB903003C2E750146E895FF438BFB8BC1B90300B5
:1B02C281FC33C0F3AA893635095BB90B0043803F3F7502FEC4E2F68A040AE42A
:1B02DD81C3BF4409BB0600BE2808B90400F3A6740803F94B75F1B007C38A0480
:1B02F8813C2075F78BC3C38CCAE8DBFEBA4B08E8E3FEC3C70635090B002E801D
:1B0313813E0B000375062EC6060A0000BC3009E83E01EB2C2EC6060A0000BC90
:1B032E813009518AC1B104D2D8240F8AD0A2CE08E8EFFDE892FDA20508E88890
:1B034981FD58240FA23909E887FDE8A9FF2E803E0A0000751AFCBC3009E84111
:1B036481FDE873FE0441E82BFDB03EE826FDE88AFFE8C8FDFCE85FFEA2390916
:1B037F812E803E0B003B74D78B363509E8ABFE74CEE8DAFE752BF6063A09FFF5
:1B039A817403E94503803E280820741AE835FF48BBE20903D803D88B17FFE240
:1B03B581B99009EB03B95C09E9EFFCE8E3FC8B1E37098A073C20740C0AC0741F
:1B03D0810853E8C3FC5B43EBEEB03FE8BAFCE8C5FC2EC6060A0000E974FFE89A
:1B03EB8180FEF6063A09FF75CCBB2808B90B00803F207503B021C38A073C20F2
:1B0406817427432C303C0A73B18AF0F6C5E075AA8AC5B103D2C002C572A00212
:1B042181C5729C02C672988AE8FEC975D4C3803F20758C43FEC975F68AC5C3EE
:1B043C81FCF3A4C3BB4B08B40002C103D88A07C3C606270800A03A090AC074FE
:1B04578124FEC8BB39093A07741BEB1D8A16CE08E8C6FCEB11A03A090AC0740D
:1B04728109FEC8BB39093A077501C3A03909E957FCC606F10901E82700803EF6
:1B048D81F009007406B9AA09E817FCEB15C606F10900E81000803EF009007410
:1B04A88106B9C509E800FCE92F032EC6060A0000C606F00900E8ADFD80FCFF56
:1B04C3817503E9F8FEE881FFBB2808803F20750AB50BC6073F43FECD75F8B29C
:1B04DE810052E829FC7503E8D2FE7503E99B00A0CD08B103D2C88AC8B00AE840
:1B04F98145FFD0D0730EF606F109FF7515C606F00901EB70F606F109FF7407F2
:1B051481C606F00901EB625A8AC2FEC2529090902403507514E87AFB51E8AB8F
:1B052F81FC590441E86AFBB03AE865FBEB08E85EFBB03AE85BFBE856FBB501CC
:1B054A818AC5E8F1FE247F3C20751358503C03750BB009E8E0FE247F3C20740F
:1B05658116B020E835FBFEC580FD0C730A80FD0975D3E824FBEBCE58E849FC20
:1B0580817506E883FBE960FF5AC32EC6060A0000E8DAFC80FC0B7521B9640994
:1B059B81E811FBE89FFBBB0A00FE0F7403E9B3FD43803F597403E9AAFD43893E
:1B05B6811E3509803E2808207467E889FEBA2708E848FBFEC07503E8EAFDEBF1
:1B05D1814C2EC6060A0000E892FC754A803E2808207443E865FEE803FB74E1BE
:1B05EC81E8B7FABBFF0081FB8000720A53E823FB5B751BBB000043BE4A080353
:1B060781F38A043C1A741053E886FAE8B4FB5B7506EBD8FEC87503E9C001E841
:1B06228191FDE845FEE996FD2EC6060A0000E83AFC75F2A03A0950E810FEE86D
:1B063D81CDFA7402EB55BE2708BF3708B91000E8EDFD8B363509E8E3FB3C3DE0
:1B06588174043C5F75354689363509E807FC752B588AE8BB3A098A070AC074E4
:1B067381063AC5882F7519882FC606270800E888FA7408BA2708E89EFAEB9025
:1B068E81E829FDEBF9E8D6FDEB38B96F09E811FAEBECE847FD3C21751AE8FC09
:1B06A981F9E881FA0C303C39760950B031E8DFF9582C0AE8D9F9EB493C1072FE
:1B06C48102EB098AD0803E2808207503E9EDFCA2CE08E857FAE90801B97B0912
:1B06DF81E8CDF9EBA8E827FB803E280820751FA03A090AC07415FEC8A23909B2
:1B06FA81A33109E8CAF90BDB74CCA03909E8D0F9E9D700803E3008207402EBEC
:1B071581BAE833FDBF3008BE0008B90300F3A4BA2708E8C3F97506E83DFDE953
:1B0730818EFCE88EF94074A4891E03088EC3E82BFD8CD88EC0E825FBBB3A0911
:1B074B81538A07A22708B81000E819FB5B8A07A23708C606470800BF5C008E08
:1B076681060308BE2708B92100E8CAFCBE0B00E8C1FA0AC0740EAC0AC07409C6
:1B0781813C207402EBF5E8AFFAB500BF81004EACAA0AC07404FEC5EBF68AC5CB
:1B079C81BF8000AABF0000268B45032EA3FB07268A45052EA2FA07E8F0F8E8CA
:1B07B7812AFAC606CF08002EC6060A00008E0603088E1E0308BB0F00833F00F9
:1B07D28174028E072EFF1EF907BC3009E9B1F8E888FCE886FAA028082C20BB03
:1007ED813A090A077503E968FBE9C7FB00000000B8
:15080082434D4400000000242424202020202053554200000097
:0909308209000001000B00000027
:1B093A8200203D5F2E3A3B3C3E2C444952535553455252454E2054595045451E
:1B095582524120444952204E4F2046494C4500414C4C2028592F4E293F0046D1
:1B097082494C4520455849535453004D454D4F5259204E4F5420415641494C99
:1B098B8241424C450052454144204552524F52000D0A43414E4E4F5420434C6C
:1B09A6824F5345000D0A4E4F4E2D53595354454D2046494C4528532920455818
:1B09C182495354000D0A53595354454D2046494C45285329204558495354001C
:1609DC82F90A000001009A048A05D2052A06A0068304E406000034
:0409F682000000007B
:0E0A5082446563656D626572203238203831EC
:00000001FF
:02000085000079
:0D0A60823132206A616E7561727920383200
:02000085000079
:0400000300000A806F
:1B0A8081260FAB156314B0151225FC15B515D315D815DE15EA15F115EC0A06CE
:1B0A9B81209D1F2720A120A720D220EB20F420FD2003210C2115211B212121E1
:1B0AB6812821BA172E2134213D2146215821612167216D217321F715F715C4A0
:1B0AD18121D621F821F10A570F760F800FAC0FCE0FF40F06104410A4101D0EFF
:0B0AEC81B022E9030BBBA024E94A16ED
:1B0B0081F90A000001001E8CC88ED88F069D2480F905740580F90D7205C60667
:1B0B1B81B124FF8C16942489269624803E98240174078CC88ED0BC8E248B1EE8
:1B0B368196248E069424268B5F0481E300027401FB8CD85557560E078C062501
:1B0B518123E81A005E5F5D8E062523FA8E1694248B269624C606B124008E1EDF
:1B0B6C819D24CF891699248816102332C0A39B24A22723A21523A21323BB89FA
:1B0B8781215380F929720980E90680F9367201C38AD9B7008ACA03DB2EFFA7CD
:1B0BA281800ABBAB23E819003C037555EB10BBB623EB08BBC223EB03BBBD23EF
:1B0BBD81E80300E96A0353E8D308A0A4240441A2A723B99B23E8CF0859E8CBEA
:1B0BD88108E9AA071E5051C6062723FF880E282332ED8B3699248936A924BF42
:1B0BF381C623893E99248E1E9D24FCF3A459581FC351B121EB0351B124E8CD7A
:1B0C0E81FF59C30650518A0E282332ED8E069D24BEC6238B3EA924893E992470
:1B0C2981FCF3A4595807C3B1148B16DC228E1E2323E805008CC88ED8C32EC66D
:1B0C448106982401CDE0C353BAD722E8F0FF5BC350538B5C072B5C058B4507F2
:1B0C5F812B45053BD8760287F75B58C32BDB2BD2C606E222FFB90800BE0C2286
:1B0C7A81803C007466803C027505C606E22200837C0300743E8B4403A3D7221E
:1B0C9581837C07008B440574038B4407A3D92251B13852E8A0FF5A59803E9BDF
:1B0CB0812400743151B136E891FF59A1D922394405731D894407B138E880FF04
:1B0CCB81EB18035C05837C0700740C035407730ABAF0FFEB05EB5B0354058307
:1B0CE681C609E2900BD274298916D922B137E854FF803E9B24007419B135E822
:1B0D018148FF3B1ED92277D7B137E83DFF8B16D9222BD3E82C008B3E9423A192
:1B0D1C8123238CC93BC17508C6450401FE069323EB12BE0C22B9080038047403
:1B0D37810883C609E2F7B0FFC3B000C3803EE222FF750B8B1E112203DA891E67
:1B0D52811322C3B002E8D4FF837C0700742E8BFEB80300E8C6FF837C0700748D
:1B0D6D8119E8E3FED1EA8BDA035C053B5C0776072B5C0703D3EB03895C070328
:1B0D88815505895507C3B003E89BFF035405895407C3837C07007404034407C9
:1B0DA381C3034405C3C606D62200A1D722803EE222FF750DC606D62201A30FCA
:1B0DBE8122A3D422EB2CBE0C22B90800803C007419803C027503A3D422837C03
:1B0DD9810300750E894403803C097503C60401E8AFFF83C609E2DAC383FD70C9
:1B0DF481750E5306E835FE075BBD0000BE5422C383C510C38BD82500F0B1040E
:1B0E0F81D2ECB104D3E383EB017302FECCC3A19D24A32323A19924A3DC22A1C2
:1B0E2A819424A3E022A19624A3DE228CCAB133E806FEBA0C22B11AE8FEFDE82D
:1B0E4581E9FD803E9B24007403E9CD00E817FE84C075F6E84DFFBA5422B11AA6
:1B0E6081E8DFFDBD7000B90800BB0C2251803F0074248E4703BF00008B4F0141
:1B0E7B81E31951E870FFB90800FCF3A583FF0075078CC280C6108EC259E2E7CE
:1B0E96815983C309E2D08E06D4228C069B24BF0000B93000B000FCF3AABF00DB
:1B0EB18100A0D62226884505B201BE0C22B908003814740783C609E2F7EB30A8
:1B0ECC818B4403268945038B4405837C070074038B4407E826FF268865022652
:1B0EE781891D803EE222FF750C83C7062688650226891DEB0AFEC283C70680D1
:1B0F0281FA0876B5A1DC22A39924C606982400A1E022A39424A1DE22A39624A3
:1B0F1D81C3C7069B24FFFFEBE0A010233C01741FC6060A0000803E93230177BB
:1B0F388105E86801EB0EE8F2018B1E9423E8E900FE0E9323C606982400BB03BA
:1B0F538125E9B7061E8E1E9D248BDA8A078B4F018B57031F5B33DB8AD802C04A
:1B0F6E8102D881C30025FFE38916A2248BCAE8B415C38B1EA224891E25238BAB
:1B0F89811EA024E9B211832E9423058B3E94238B0789058B4702894502C64582
:1B0FA48104008006292301C3E89B01750A803E2A23007473E8ED01756E8B449A
:1B0FBF810239470272038947028B048907EB53E87901755883C604FEC13A0EEB
:1B0FDA812A23734DE8480275F08B440203042B073947027203894702EB2DE804
:1B0FF58153017532E8DD01752DE86B01E88BFFEB1BE84101752083C604FEC166
:1B1010813A0E2A237315E8100275F0E84302E86EFFA02A2388470432C0EB02A7
:1B102B81B0FFA29B24C38B4702A3D9228B07A3D722BBD722E81101EB0EE80324
:1B10468101807F04FF7505E8E300EBCF837F020074D3E86C0275CEE892027438
:1B106181C9E863003C0075C2E8C40275168BFE8AE9E8E60274088B47020145D1
:1B107C8102EBA2E83802EB9DE8D402750C8B0789048B4702014402EB8CE8B710
:1B109781018B0789048B4702894402EBEF33C0A22923A29323B89323A394231F
:1B10B281E881148BF38A0CD0E1D0E1FEC132EDBF2A23FCF3A4C38A0E2923B5D6
:1B10CD8100BF8E238B073905742173178B150355020347023BC2750B8B450293
:1B10E8812B4702894502EB4083EF05E2DCB0FFC38B47023B4502741173F30312
:1B1103810589058B45022B4702894502EB1F8B45FB89058B45FD8945028A45D8
:1B111E81FF88450483EF05E2D1FE0E29238306942305B000C3803E29230074AD
:1B1139810F8B1E9423807F04007505E8EAFEEBEAC3B105E88DFA8B1E9924B18A
:1B115481FFBE2723B0FF803E2923087308837F02007402FEC00AC0C3518B44D7
:1B116F81022B470275098B048907E80B00EB078944020304890759C35156576C
:1B118A81A02A23FEC8A22A232AC1740E8AC832ED03C98BFE83C604FCF3A55FB4
:1B11A5815E59C3525733D2B5FF83C604FEC13A0E2A23730F8B44023BC272EE81
:1B11C0818BD08AE98BFEEBE6B0FF8BF78ACDFEC57402FEC00AC05F5AC35257FD
:1B11DB81BAFFFFB5FF83C604FEC13A0E2A2373168B44022B4702741A72EB3B77
:1B11F681C273E78BD08AE98BFEEBDFB0FF8BF78ACDFEC57402FEC00AC05F5A1E
:1B121181C38B47020307C353E8F6FF8946028BDEE8EEFF8946005BC35583ECED
:1B122C81048BEC51B5FFE8E3FF8B073B04720A8B46003B46027202B5008AC5C3
:1B1247815983C4045D0AC0C3A02A23FE062A23B404F6E48BF08DB42B23C3558B
:1B12628183EC048BEC5251E8ACFF8B073B0475198B46023B460075075951E80F
:1B127D8108FFEB3289048B4702294402EB288B46002B460275098B072B0489C2
:1B1298814402EB178B072B04894402E8A9FF8B460289042B4600F7D8894402E3
:1B12B381595A83C4045DC38B4702034402014502E8C1FEC351525653E8681204
:1B12CE818A2F8BF383EE035BB1FF83C604FEC13ACD7309E845FF75F2B000EB11
:1B12E98102B0FF5E5A590AC0C35583EC048BEC5651BE2723B1FF83C604FEC170
:1B1304813A0E2A23731BE80BFF8B073B0473098B46023B047707EBE33B46000C
:1B131F8173DEB000EB02B0FF595E83C4045D0AC0C35583EC048BECBE2723B1B1
:1B133A81FF83C604FEC13A0E2A23730CE8CFFE8B072B460075EBEB02B0FF83C1
:1B135581C4045D0AC0C35583EC048BECBE2723B1FF83C604FEC13A0E2A23733F
:1B1370810CE8A4FE8B46022B0475EBEB02B0FF83C4045D0AC0C3BBE6228A07C4
:1B138B81C607000AC07525E96C02E8EEFFE80A00721A508AC8E8C00058C33C4A
:1B13A6810D740E3C0A740A3C0974063C0874023C20C3A0E6220AC0754BE84462
:1B13C18102240174F1E838023C13753AE831023C03740332C0C3C606E522008B
:1B13DC81803E932300750BE8200CA09B24A20508EB0EF606AF24FF740F803E57
:1B13F7819323017508C6060A0000E948FBE926FBA2E622B001C3A0E3220AC08D
:1B141281751651E8A0FF5951E8EE015951803EB624007403E8D301598AC1BB86
:1B142D81E5223C7F7416FE073C207310FE0F8A070AC074088AC13C087503FE0A
:1B1448810FC33C0A75FBC60700C38AC1E84EFF730A50B15EE8AEFF5980C9401D
:1B14638180F90975A5B120E8A0FFA0E522240775F4C3E80500B120E88E01B115
:1B147E8108E98901B123E886FFE81000A0E5223A06E42273E1B120E875FFEBC5
:1B149981F0B10DE86EFFB10AE969FF8BF1AC3C2474C941518AC81E161FE8AE16
:1B14B481FF1F59EBEBA0E522A2E4228B1E9924268A0F4353B5005153E8B7FE4F
:1B14CF815B593C0D7503E9C6003C0A74F93C08750E0AED74E6FECDA0E522A27E
:1B14EA81E322EB513C7F750C0AED74D4268A07FECD4BEB7C3C05750C5153E828
:1B15058193FFC606E42200EBBE3C107506F616B624EBB23C1875145BA0E42215
:1B152081BBE522903A07739190FE0FE847FFEBED3C157507E84BFF5BE97EFF35
:1B153B813C12753551E83FFF595B53510AED740F43268A0FFECD5153E8FCFE80
:1B1556815B59EBED53A0E3220AC074102A06E522A2E322E809FFFE0EE32275D3
:1B157181F7EB9843268807FEC551538AC8E8D1FE5B59268A073C038AC5750B83
:1B158C813C0175078CD88EC0E940FE3AC17303E92CFF5B26882FB10D8CD88EC4
:1B15A781C0E962FEE8E7FDEB44E8620FEB3F8AC1FEC07409FEC0754CE84400F0
:1B15C281EB30E83F000AC07503E9E60BE83000EB21E8630FEB1C8BCAE85F0FFF
:1B15DD81C38BCA1E8E1E9D24E8BCFE1FC38E069D24E9C8FEE8C4FDA29B24C37A
:1B15F881B001EBF8BB0F25EB0DBB0925EB08BB0625EB03BB0C25FF1E0022C33E
:1B161381FFD3CBBB0622FF2751B5008BF28BFBFCF3A459C38A0EA424E8ED0E9A
:1B162E8183FB0074508B1783C302891EEC2283C302891EEE2283C302891EF061
:1B1649812283C30287DA891E09238B1EF222891EAD24BBF222B108E8B8FF8B80
:1B16648116F422BBFA22B10FE8ACFFA00023BB1223C607FF0AC07403C6070007
:1B167F81B0FF0AC0C3E8910E33C08B1EEE228907C38B161A23E8900EEB078A2D
:1B169A810E0D23E88A0E0AC074DFBB0422E96FFF8B1EA624B102D3EB891E1AFC
:1B16B58123891E1F23A11A23BA0000F736FA22528BC88B36EE22890C030E0789
:1B16D08123E84A0E598B160923E8540E8BCBE9400EBBFC228A0FA01823D2E817
:1B16EB818AE8B1072A0FA01723D2E002C5C38B1E992483C31003D9803E12235F
:1B1706810074058A1FB700C303D98B1FC3E8CBFF8AC8B500E8DCFF891E1A2302
:1B172181C38B1E1A230BDBC38A0EFC228B1E1A23D3E3891E1C23A0182322069F
:1B173C81FD220AD8891E1A23C38B1E992483C30C8A07C3BA0F0003169924BB03
:1B175781110003DAC3E8F0FF8A07A2182387DA8A07A21623E8D7FFA0FE222293
:1B17728107A21723C3E8D5FFA00F233C02750232C002061823880787DAA01617
:1B178D81238807C3B980008B1EF22232C0020743E2FBC3518A0EA424BB01000A
:1B17A881D3E3590BD9C3A1E8228A0EA424D3E82401C38B0EE822E8DFFF891E31
:1B17C381E8228B160123428B1EEC228917C3E81B00BA090003DA8A07D0D07318
:1B17DE811BBB0A22EB08E8C7FF7411BB0822E92AFE8B1EF222A01E23B40003FC
:1B17F981D8C38B1E992483C30E8A07C3E8F3FFC60700C3E8ECFF0C808807C390
:1B1814818B16A6248B1EEC223B17C3E8F2FF72FA428917C3522BD38BDA5AC345
:1B182F81B1FF8B161F238B1E0523E8ECFF73E051E84FFF8B1E1F23031EF622E8
:1B184A8159FEC1740D3A07740BE8BEFF7306E85FFFC38807C3E8CDFFE819007B
:1B186581B101E833FEEB06E80F00E81EFE8B0EA224E8BA0CBBA024EB088CD94C
:1B188081E8B00CBBF2228B0FE9990C8B16F2228B1EA024B180068E069D24E89B
:1B189B817EFD07C3BBA6248A07433A077502FEC0C3BBFFFF891EA624C38B164C
:1B18B68101238B1EA62443891EA624E864FF7302EBE4A0A624240351B105D252
:1B18D181E059A21E230AC0752651E8CCFDE88BFF59E94CFF8BD180E107FEC176
:1B18EC818AE9B103D3EA8B1EF82203DA8A078ACDD2C08BD1C352E8E0FF24FE08
:1B190781590AC1518ACED2C8880759C3E8D9FE83C31051B1115AFEC97501C3B0
:1B19228152803E122300740851538A0FB500EB07FEC9518B0F43530BC9740BE9
:1B193D818B1EFF223BD97203E8B9FF5B4359EBCF8B1EFF22B103D3EB438BCB95
:1B1958818B1EF822C6070043E2FA8B1603238B1EF8228917E815FD8B1EEC2269
:1B197381C7070300E832FFB1FFE835FFE81DFF743BE868FE803FE574EEA0A5D6
:1B198E81243A07750C438A072C247505FEC8A29B24B101E86FFFE878FEEBD1F0
:1B19A981A00E23E945FC518A2EFE22F6D522CD22C52AC1241F59C38B1E99242D
:1B19C481891E2123C6060E23FF880EA824C3E8EBFFE8D4FEE8A9FCC6069A23D9
:1B19DF8100B100E8CFFEE8B7FE7503E980008B1621238BF2AC3CE5740752E8A4
:1B19FA8118FE5A73EBE8EDFD8A0EA824B5000AC974388BF2AC3C3F742980FD5B
:1B1A15810D742480FD0C74082A07247F7533EB17518A0FE884FF599FF6069A2A
:1B1A308123FF7545C6069723009E759F4243FEC5FEC9EBC4C6060E2300A0A605
:1B1A4B81242403A29B248AE8FEC5C30AED7530F607FF752BF6069723FF7424D6
:1B1A6681C6069A23FFEBCFE83CFEB0FF8AE8FEC5E97BFB9E750E43803F0075A5
:1B1A8181088B36A62489369823E94EFFE854FDB10CE83DFFE807FE74BBE83434
:1B1A9C81FDE84FFDC607E5B100E86BFEE8B4FDE82DFFEBE58BD10BC9740C4953
:1B1AB7815251E829FED0D87318595A3B16FF22731A4251528BCAE815FED0D81F
:1B1AD28173045A59EBDAD0D0FEC0E82BFE5B5AC30BC975CCBB0000C3B100B2AC
:1B1AED812052B5008B16992403D1E8F5FC59E81DFBE8A9FBE95BFDE8DDFCB193
:1B1B08810CE8C6FE8B1E99248A0783C3108807E885FD7501C3E8B1FCB110B202
:1B1B23810CE8C7FFE8B1FEEBEBB10CE8A1FEE86BFD74E6B100B20CE8B1FFE822
:1B1B3E819BFEEBEFB10FE88BFEE855FD74D0E8F6FB5053E89BFC87DA8B1E994B
:1B1B598124B12052E8BBFAE8A9FC5ABB0C0003DA8A0FBB0F0003DA8A2F5B58D5
:1B1B748188073A0F8AC57406B0007202B0808B1E9924BA0F0003DA8807C383FF
:1B1B8F813F0075FA8BF2AD8907C333C0A29B24A3A624E80AFC75F2E852FC241F
:1B1BAA818075EBB10FE820FEE8EAFC74E1B91000E832FC03D987DA8B1E992454
:1B1BC58103D9B110803E122300741B8A070AC08BF2AC750288070AC075068A0C
:1B1BE081078BFAFCAA3A077547EB16E8A0FF87DAE89BFF87DA8BF28B043B0720
:1B1BFB8175334243FEC94243FEC975C2B9ECFF03D987DA03D98BF2AC3A07723E
:1B1C1681118807B9030003D987DA03D98A078BFAFCAAC6060B23FFE9CEFEFE55
:1B1C31810E9B24C3E8ACFBFF369924C7069924E722B101E88BFDE855FC8F0683
:1B1C4C81992474E48B169924BB0F0003DAB11132C0880743FEC975F9BB0D005F
:1B1C678103DA8807E8B1FBE879FEE998FB32C0A20B23E81DFFE820FC74B38B8A
:1B1C82811E992483C30C8A07FEC0241F8807740F8AE8A0FE2222C522060B2386
:1B1C9D81740DEB2683C302FE078A07240F7426B10FE821FDE8EBFB7511A00CA8
:1B1CB88123FEC07415E875FFE8DCFB740DEB03E882FEE88FFA32C0E922F9E8E5
:1B1CD38123F9E934FBC6060F2301C6060C23FFE877FAA018233A061623721811
:1B1CEE813C807528E87FFFE857FA33C0A318238807803E9B24007514E80AFA10
:1B1D0981E816FA740CE818FAE8A6F9E879F9E95DFAE9DBF8C6060F2301C60624
:1B1D24810C2300E8BAFA8B1E9924E8A3FAE828FAA018233C807203E9BAF8E8D4
:1B1D3F81D2F9E8DEF9B1007548E896F9A2112333C90AC074088AC849E89FF966
:1B1D5A818BCBE851FD0BDB7505B002E98CF8891E1A2387DA8B1E992483C310E1
:1B1D7581803E122300A01123B400740603D88817EB0703D803D8891743B10225
:1B1D9081803E9B24007401C3880E0D23E88AF9803E0F23027545803E0D230235
:1B1DAB81753EFF361A238B3EF22233C0B94000FCF3ABE8BEFA8B1E1C23891EE5
:1B1DC6811A23E8EFF8E8CBF88B1E1A23C6060D23008AC38A36FD2222C6433A57
:1B1DE181C675E08F061A23E887FAE8CCF8E8A8F8A01823BB16233A07720688CC
:1B1DFC8107FE07B10250E8F6F9247F8807583C7F751E803E0F23017517E85FC9
:1B1E1781F9E859FEBB9B248A070AC07505FEC8A21823C60700E948F9C6060F33
:1B1E32812300518B169924BB210003DA8A07247F508A07D0D0438A07D0D0243C
:1B1E4D811F8AC88A07D0D8D0D8D0D8D0D8240F8AE858438A1F0ADBB3067569F2
:1B1E6881BB200003DA8807BB0C0003DA8AC12A07750DBB0E0003DA8AC52A07CF
:1B1E8381247F743C5152E80DFD5A59B303A09B24FEC07432BB0C0003DA880F74
:1B1E9E81BB0E0003DA882FE89AFCA09B24FEC075145951B304FEC17412E87B1E
:1B1EB981FDB305A09B24FEC074065932C0E92BF753E82EF9C607C05B598AC3FB
:1B1ED481A29B24E932F9B1FFE850FF7503E8F9FDC3B100E845FF7503E833FE8F
:1B1EEF81C387DA03DA8A0FB500BB0C0003DA8A27B000D1E880E40F03C8BB0E43
:1B1F0A810003DA8A07B410F6E45002E89C5B8AC35B0AC32401C3B10CE8ADFA55
:1B1F25818B1E9924BA210003DA538837438837438837E865F97422E8B0F8BAC6
:1B1F40810F00E8ABFF5B538AD08BC12B078AC21A47027205885702890FE87FD8
:1B1F5B81FAEBD95BC38B1E9924BA2000E886FFBB210003DA890F884702C38BF1
:1B1F76811EEA228A0EA424D3CB5387DAE8A2F65B7503E88BF6D0DB72678B0E1A
:1B1F9181EA22E80AF8891EEA22E9B0F9A01023A2A424EBD0E85CECEB03E85C1F
:1B1FAC81EC8B1E9924C606962300F647088074098067087FC606962360C60661
:1B1FC7811323FF8B1E99248A07241FFEC8A210233C1E7312A0A424A214238ACA
:1B1FE28107A2152324E08807E8B0FFA0A5248B1E99240807C3803E962360756B
:1B1FFD81078B1E9924C60700C3F7060222FFFF75048C0E022233DB891EE82236
:1B201881891EEA228A1EB724881EA424E94EFFE87BFFE8D8F7803EA52400743E
:1B2033810BC7069923FE00C6069723FFE800FBE83C00F6069723FF7501C3C63F
:1B204E8106972300813E9923FE0074F28B1E982380E3FC4B891EA624C6069676
:1B20698123608B1E9924C60700B10FE849F9E861F9E8CDFAE80100C3E81BF8A3
:1B20848174C65B803E96236075128B1E99248A470A24807507A29623B0FFEB77
:1B209F817EC3E801FFE9F2FAE85AEB8B1E9D24891EAB24B1008B1E9924803FC4
:1B20BA813F7410E885F6803F3F7403E83DF7E8E2FEB10FE802F9EB168B1EAB13
:1B20D58124891E9D248B1EA924891E9924E8C0FEE8F3F8E9A0F7E8B7FEE89CEF
:1B20F081F9E9B5F8E8AEFEE8FDFEE9DBFBE8A5FEE91AFCE89FFEE8FCF6E92994
:1B210B81FBE896FEE8F2F9E994F88B1EEA22EB26A0A424E9D3F48916A024E94F
:1B2126814AF78B1EF822EB138B1EE822EB0DE86EFEE8F2F9E96CF88B1EF4223D
:1B214181891E9B24C3A010233CFF7505A0A524EBCC241FA2A524C3E84FFEE8A3
:1B215C8199FEE979FDE846FEE97EFDE840FEE9B3FDE899EAE9EDFDA19924F70F
:1B217781D050BBEA222307890758BBE82223078907C3803E13230074248B1E5C
:1B2192819924803E9623607504804F0880C60700A015230AC0740B8807A0141C
:1B21AD8123A21023E8E9FD803E2723FF7503E853EAA19B248BD8C3E8E3FDC618
:1B21C881060F2302B100E863FC75F0E94CFB1EB98000BF0B008B36A0248E1E62
:1621E381A224AC0AC07403AAE2F8B0802AC1A20A001FE93AEDC375
:02000086000078
:0C22008213160000A40BB00BB50BBA0B38
:1B22D48200000000000000000000000000000000000000E50000000000000088
:1B22EF8200000000000000000000000000000000000000000000000000000052
:1B230A8200000000000000000000000000000000000000000000000000000036
:1B2325820000000000000000000000000000000000000000000000000000001B
:1B23408200000000000000000000000000000000000000000000000000000000
:10235B8200000000000000000000000000000000F0
:1B239382000000000000000042646F7320457272204F6E20203A20244261643A
:1823AE8220536563746F722453656C6563742446696C6520522F4F24C9
:0B2494820000000000000000000000BB
:1B24A0820000000000000000000000000000000000000000000000000000009F
:0224BB8200009D
:0124C8820091
:0224E082500028
:0124FA82005F
:00000001FF
:0400000300000521D3
:03052181E91C054C
:0F0A4081803EE0243C7203E9DAFA2401E9D5FA19
:00000001FF
:180A00823132204A616E75617279203139383200000000000012018276
:00000001FF
:04000003000021E6F2
:0521E681AA0AC0740289
:0421F1811FA20A009E
:00000001FF
:0400000300000A30BF
:0F0A3081A12323A39D24C7069B24FFFFE9C704AD
:030F1E81E90FFB5C
:00000001FF
:0400000300000B7777
:020B778133C008
:00000001FF
:04000003000018964B
:041896818E06A22473
:00000001FF
:0400000300000E23C8
:060E238106908916DC2215
:040F1A81E903FB90DB
:050A2081A3962407C329
:00000001FF
:0400000300000A509F
:0C0A50817207C7069B24FFFFC3E93B012E
:030B9481E9B9FE3D
:00000001FF
:0400000300000A00EF
:1B0A00812EC606982401502E8A2627232EA0132350CDE0582EA213232E8826F0
:050A1B81272358C39060
:090C4281E9BBFD90909090909027
:00000001FF


File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
title 'M-4 CPM-86/80 Basic I/O System'
;*********************************************
;* *
;* M-Four Basic I/O System *
;* for CPM.SYS *
;* *
;*********************************************
nolist
include m4equ.lib
include m4jump.lib
list
;*********************************************
;* *
;* Loader_bios is true if assembling the *
;* LOADER BIOS, otherwise BIOS is for the *
;* CPM.SYS file. *
;* *
;*********************************************
loader_bios equ false
cal equ false
special equ true ;for hybrid machine
include m4bios.lib
END


View File

@@ -0,0 +1,6 @@
era m4cpm.h86
pip m4cpm.h86=cpm.h86,m4cbios.h86
era m4cpm.sys
gencmd m4cpm 8080 code[a88]
ren m4cpm.sys=m4cpm.cmd


View File

@@ -0,0 +1,180 @@
;I/O port definitions
;DMA controller (i8237-2) ports
DMAC_BADD0 EQU 00H ;Channel 0 - base & current address (write)
DMAC_CADD0 EQU 00H ; " " - current address (read)
DMAC_BCNT0 EQU 01H ; " " - base & current word count (write)
DMAC_CCNT0 EQU 01H ; " " - curent word count (read)
DMAC_BADD1 EQU 02H ;Channel 1 - base & current address (write)
DMAC_CADD1 EQU 02H ; " " - current address (read)
DMAC_BCNT1 EQU 03H ; " " - base & current word count (write)
DMAC_CCNT1 EQU 03H ; " " - curent word count (read)
DMAC_BADD2 EQU 04H ;Channel 2 - base & current address (write)
DMAC_CADD2 EQU 04H ; " " - current address (read)
DMAC_BCNT2 EQU 05H ; " " - base & current word count (write)
DMAC_CCNT2 EQU 05H ; " " - curent word count (read)
DMAC_BADD3 EQU 06H ;Channel 3 - base & current address (write)
DMAC_CADD3 EQU 06H ; " " - current address (read)
DMAC_BCNT3 EQU 07H ; " " - base & current word count (write)
DMAC_CCNT3 EQU 07H ; " " - curent word count (read)
DMAC_STAT EQU 08H ;Status register (read)
DMAC_CMD EQU 08H ;Command register (write)
DMAC_REQ EQU 09H ;Request register (write)
DMAC_MASK_SR EQU 0AH ;Single mask register bit (write)
DMAC_MODE EQU 0BH ;Mode register (write)
DMAC_FLOP EQU 0CH ;Clear byte pointer flip/flop (write)
DMAC_TEMP EQU 0DH ;Temporary register (read)
DMAC_CLR EQU 0DH ;Master clear (write)
DMAC_MASK EQU 0FH ;All mask register bits (write)
;Programmable interrupt controller (i8259A) ports
PIC_STAT EQU 010H ;Interrupt request/serviced status
PIC_ICW EQU 010H ;Initialization control words
PIC_IMR EQU 011H ;Interrupt level masks
PIC_OCW EQU 011H ;Operational control words
;DIP switch and diagnostic LED display
DIP_SW EQU 020H ;DIP switch
LED_DSPY EQU 020H ;LED display
;Bank select registers
DMAC_BANK EQU 30H ;general - before separate ones used
FDC_BANK EQU 31H ;Floppy bank
REFRESH_BANK EQU 30H ;Refresh bank
SIO_BANK EQU 32H ;SIO bank - for networking
WINCH_BANK EQU 33H ;Winchester bank
Z80_BANK EQU 30H ;Z80 bank
;CRT controller
CRT_ADDR EQU 040H ;Address/status register
CRT_STAT EQU 040H
CRT_DATA EQU 041H ;Register file
CRT_CHAR EQU 020H ;Character latch
;Floppy disk controller ports
AUX_CMD EQU 050H ;Floppy disk select/handshake
FDC_CMD EQU 060H ;Command port
FDC_STAT EQU 060H ;Status register
FDC_TRK EQU 061H ;Track register
FDC_SEC EQU 062H ;Sector register
FDC_DATA EQU 063H ;Data register
;Keyboard
KYBD_DATA EQU 051H ;Keyboard data
KYBD_STAT EQU 052H ;Keyboard Status
KYBD_CNTL EQU 053H ;Mode control 8255
BUZZER EQU 050H ;Buzzer
;Hard disk registers
ADP_STAT EQU 071H
ADP_CMD EQU 071H
ADP_DIAG EQU 072H
ADP_DATA EQU 073H
;Programmable interval timer (i8253) ports
PIT0_CT0 EQU 080H ;PIT 0, counter 0
PIT0_CT1 EQU 081H ; " 0, " 1
PIT0_CT2 EQU 082H ; " 0, " 2
PIT0_CTL EQU 083H ; " 0, control
PIT1_CT0 EQU 090H ; " 1, counter 0
PIT1_CT1 EQU 091H ; " 1, " 1
PIT1_CT2 EQU 092H ; " 1, " 2
PIT1_CTL EQU 093H ; " 1, control
;Serial input/output (Z80-SIO) ports
SIO0A_DATA EQU 0A0H ;SIO 0, channel A, data
SIO0A_STAT EQU 0A1H ; " 0, " A, status
SIO0A_CNTL EQU 0A1H ; " 0, " A, control
SIO0B_DATA EQU 0A2H ;SIO 0, channel B, data
SIO0B_STAT EQU 0A3H ; " 0, " B, status
SIO0B_CNTL EQU 0A3H ; " 0, " B, control
SIO1A_DATA EQU 0B0H ;SIO 1, channel A, data
SIO1A_STAT EQU 0B1H ; " 1, " A, status
SIO1A_CNTL EQU 0B1H ; " 1, " A, control
SIO1B_DATA EQU 0B2H ;SIO 1, channel B, data
SIO1B_STAT EQU 0B3H ; " 1, " B, status
SIO1B_CNTL EQU 0B3H ; " 1, " B, control
SIO_INT_VEC EQU 0E0H ;Interrupt vector - SIO or DART
;Centronics compatible parallel printer ports
PTR_DATA EQU 0F0H ;Printer data out
PTR_STAT EQU 0F1H ; " status
PTR_CNTL EQU 0F2H ; " control
PTR_MODE EQU 0F3H ; " port mode control
PTR_FLAG EQU PTR_MODE
;LED display constants
led_0 equ 0c0h
led_1 equ 0f9h
led_2 equ 0a4h
led_3 equ 0b0h
led_4 equ 099h
led_5 equ 092h
led_6 equ 082h
led_7 equ 0f8h
led_8 equ 080h
led_9 equ 098h
led_0p equ 040h
led_1p equ 079h
led_2p equ 024h
led_3p equ 030h
led_4p equ 019h
led_5p equ 012h
led_6p equ 002h
led_7p equ 078h
led_8p equ 000h
led_9p equ 018h
;Others
LINE_LENGTH EQU 80 ;Length of CRT character line
CR EQU 13
LF EQU 10
BS EQU 08
ESC EQU 1BH
NULL EQU 0
BELL EQU 7
INT3 EQU 0CCH
CNTL_X EQU 'X'-'A'+1
CNTL_Q EQU 'Q'-'A'+1
CNTL_Z EQU 'Z'-'A'+1
CNTL_S EQU 'S'-'A'+1
TRUE EQU -1
FALSE EQU 0
RD_CMD EQU 20H ;Read command for FLOPALL
WR_CMD EQU 50H ;Write with verify
BIT0 EQU 00000001B
BIT1 EQU 00000010B
BIT2 EQU 00000100B
BIT3 EQU 00001000B
BIT4 EQU 00010000B
BIT5 EQU 00100000B
BIT6 EQU 01000000B
BIT7 EQU 10000000B
;Equivalent to JNZ $+3 ; RET
CodeMacro RZ
DB 75H
DB 01H
DB 0C3H
EndM
;Equivalent to JZ $+3 ; RET
CodeMacro RNZ
DB 74H
DB 01H
DB 0C3H
EndM
RE EQU RZ
RNE EQU RNZ
JC EQU JB
JNC EQU JNB
JNBE EQU JA


View File

@@ -0,0 +1,29 @@
;I/O primitives jump table
CSEG 0FC00H
ORG 03000H
BOOT EQU $ + 00 ;Bootstrap loader
SIO_IN EQU $ + 05 ;Serial Input - wait if chr not ready
SIO_OUT EQU $ + 10 ;Serial Output - wait if tx buf not empty
SIO_IN_STAT EQU $ + 15 ;Serial Input status
SIO_OUT_STAT EQU $ + 20 ;Serial Output status
PRNTR_ST EQU $ + 25 ;Printer status routine
PRNTR_OUT EQU $ + 30 ;Printer wait & output routine
FLOP_SET EQU $ + 35 ;Floppy parameter initialization
FLOP_ALL EQU $ + 40 ;Floppy start & continue til finished
FLOP_START EQU $ + 45 ;Floppy start activity
FLOP_CONT EQU $ + 50 ;Floppy continue activity
FLOP_ABORT EQU $ + 55 ;Floppy abort
HDSK_ALL EQU $ + 60 ;Hard disk command which returns when ready
HDSK_START EQU $ + 65 ;Hard disk command initiate
HDSK_CONT EQU $ + 70 ;Hard disk status and continue routine
HDSK_ABORT EQU $ + 75 ;Hard disk abort
HDSK_SIZE EQU $ + 80 ;return size of hard disc
GET_SWITCH EQU $ + 85 ;Get system byte


View File

@@ -0,0 +1,225 @@
M4_LBL_SEG EQU 0FFFFH
M4_LBL_OFST EQU 05H
M4_PROM_VER EQU 03FFFH
M4_PROM_SEG EQU 0FC00H
; LSI-M4 & CAL-PC prom calls (relative to M4_PROM_SEG)
BOOT EQU 03000H
SIO_IN EQU 03005H
SIO_OUT EQU 0300AH
SIO_IN_STAT EQU 0300FH
SIO_OUT_STAT EQU 03014H
PRNTR_STAT EQU 03019H
PRNTR_OUT EQU 0301EH
FLOP_SET EQU 03023H
FLOP_ALL EQU 03028H
FLOP_START EQU 0302DH
FLOP_CONT EQU 03032H
FLOP_ABORT EQU 03037H
HDSK_ALL EQU 0303CH
HDSK_START EQU 03041H
HDSK_CONT EQU 03046H
HDSK_ABORT EQU 0304BH
HDSK_SIZE EQU 03050H
GET_SWITCH EQU 03055H
CPM EQU 0E0H
CODEMACRO CALL_PROM FUNC_CALL:DW
DB 09AH
DW FUNC_CALL
DW 0FC00H
ENDM
; LSI-M4 & CAL-PC I/O port definitions
; DMA controller (i8237-2) ports
DMAC_BADD0 EQU 00H ;Channel 0 - base & current address (write)
DMAC_CADD0 EQU 00H ; " " - current address (read)
DMAC_BCNT0 EQU 01H ; " " - base & current word count (write)
DMAC_CCNT0 EQU 01H ; " " - current word count (read)
DMAC_BADD1 EQU 02H ;Channel 1 - base & current address (write)
DMAC_CADD1 EQU 02H ; " " - current address (read)
DMAC_BCNT1 EQU 03H ; " " - base & current word count (write)
DMAC_CCNT1 EQU 03H ; " " - current word count (read)
DMAC_BADD2 EQU 04H ;Channel 2 - base & current address (write)
DMAC_CADD2 EQU 04H ; " " - current address (read)
DMAC_BCNT2 EQU 05H ; " " - base & current word count (write)
DMAC_CCNT2 EQU 05H ; " " - current word count (read)
DMAC_BADD3 EQU 06H ;Channel 3 - base & current address (write)
DMAC_CADD3 EQU 06H ; " " - current address (read)
DMAC_BCNT3 EQU 07H ; " " - base & current word count (write)
DMAC_CCNT3 EQU 07H ; " " - current word count (read)
DMAC_STAT EQU 08H ;Status register (read)
DMAC_CMD EQU 08H ;Command register (write)
DMAC_REQ EQU 09H ;Request register (write)
DMAC_MASK_SR EQU 0AH ;Single mask register bit (write)
DMAC_MODE EQU 0BH ;Mode register (write)
DMAC_FLOP EQU 0CH ;Clear byte pointer flip/flop (write)
DMAC_TEMP EQU 0DH ;Temporary register (read)
DMAC_CLR EQU 0DH ;Master clear (write)
DMAC_MASK EQU 0FH ;All mask register bits (write)
; programmable interrupt controller (i8259A) ports
PIC_STAT EQU 010H ;Interrupt request/serviced status
PIC_ICW EQU 010H ;Initialization control words
PIC_IMR EQU 011H ;Interrupt level masks
PIC_OCW EQU 011H ;Operational control words
; DIP switch and diagnostic LED display
DIP_SW EQU 020H ;DIP switch
LED_DSPY EQU 020H ;LED display
; Bank select registers
DMAC_BANK EQU 30H ;general - before seperate ones used
FDC_BANK EQU 31H ;Floppy bank
REFRESH_BANK EQU 30H ;Refresh bank
SIO_BANK EQU 32H ;SIO bank - for networking
WINCH_BANK EQU 33H ;Winchester bank
Z80_BANK EQU 30H ;Z80 bank
; CRT controller
CRT_ADDR EQU 040H ;Address/status register
CRT_STAT EQU 040H
CRT_DATA EQU 041H ;Register file
CRT_CHAR EQU 020H ;Character latch
; Floppy disk controller ports
AUC_CMD EQU 050H ;Floppy disk select/handshake
FDC_CMD EQU 060H ;Command port
FDC_STAT EQU 060H ;Status register
FDC_TRK EQU 061H ;Track register
FDC_SEC EQU 062H ;Sector register
FDC_DATA EQU 063H ;Data register
; Keyboard
KYBD_DATA EQU 051H ;Keyboard data
KYBD_STAT EQU 052H ;Keyboard status
KYBD_CNTL EQU 053H ;Mode control 8255
BUZZER EQU 050H ;Buzzer
; Hard disk registers
ADP_STAT EQU 071H
ADP_CMD EQU 071H
ADP_DIAG EQU 072H
ADP_DATA EQU 073H
; Programmable interval timer (i8253) ports
PIT0_CT0 EQU 080H ;PIT 0, counter 0
PIT0_CT1 EQU 081H ; " 0, " 1
PIT0_CT2 EQU 082H ; " 0, " 2
PIT0_CTL EQU 083H ; " 0, control
PIT1_CT0 EQU 090H ; " 1, counter 0
PIT1_CT1 EQU 091H ; " 1, " 1
PIT1_CT2 EQU 092H ; " 1, " 2
PIT1_CTL EQU 093H ; " 1, control
; Serial input/output (Z80-SIO) ports
SI00A_DATA EQU 0A0H ;SIO 0, channel A, data
SI00A_STAT EQU 0A1H ; " 0, " A, status
SI00A_CNTL EQU 0A1H ; " 0, " A, control
SI00B_DATA EQU 0A2H ;SIO 0, channel B, data
SI00B_STAT EQU 0A3H ; " 0, " B, status
SI00B_CNTL EQU 0A3H ; " 0, " B, control
SI01A_DATA EQU 0B0H ;SIO 1, channel A, data
SI01A_STAT EQU 0B1H ; " 1, " A, status
SI01A_CNTL EQU 0B1H ; " 1, " A, control
SI01B_DATA EQU 0B2H ;SIO 1, channel B, data
SI01B_STAT EQU 0B3H ; " 1, " B, status
SI01B_CNTL EQU 0B3H ; " 1, " B, control
SIO_INT_VEC EQU 0E0H ;Interrupt vector - SIO or DART
; Centronics compatible parallel printer ports
PRT_DATA EQU 0F0H ;Printer data out
PRT_STAT EQU 0F1H ; " status
PRT_CNTL EQU 0F2H ; " control
PRT_MODE EQU 0F3H ; " port mode control
PRT_FLAG EQU PRT_MODE
; LED display constants
led_0 equ 0c0h
led_1 equ 0f9h
led_2 equ 0a4h
led_3 equ 0b0h
led_4 equ 099h
led_5 equ 092h
led_6 equ 082h
led_7 equ 0f8h
led_8 equ 080h
led_9 equ 098h
led_0p equ 040h
led_1p equ 079h
led_2p equ 024h
led_3p equ 030h
led_4p equ 019h
led_5p equ 012h
led_6p equ 002h
led_7p equ 078h
led_8p equ 000h
led_9p equ 018h
; Others
LINE_LENGTH EQU 80 ;Length of CRT character line
CR EQU 13
LF EQU 10
BS EQU 08
ESC EQU 1BH
NULL EQU 0
BELL EQU 7
TAB EQU 9
SPACE EQU 20H
INT3 EQU 0CCH
CNTL_X EQU 'X'-'A'+1
CNTL_Q EQU 'Q'-'A'+1
CNTL_Z EQU 'Z'-'A'+1
CNTL_S EQU 'S'-'A'+1
TRUE EQU -1
FALSE EQU 0
RD_CMD EQU 20H ;Read command for FLOPALL
WR_CMD EQU 50H ;Write with verify
BIT0 EQU 00000001B
BIT1 EQU 00000010B
BIT2 EQU 00000100B
BIT3 EQU 00001000B
BIT4 EQU 00010000B
BIT5 EQU 00100000B
BIT6 EQU 01000000B
BIT7 EQU 10000000B
bit8 equ 0100h
bit9 equ 0200h
bit10 equ 0400h
bit11 equ 0800h
bit12 equ 1000h
bit13 equ 2000h
bit14 equ 4000h
bit15 equ 8000h
JC EQU JB
JNC EQU JNB
JNBE EQU JA
SBC EQU SBB
; End of CALIO.EQU


View File

@@ -0,0 +1,682 @@
FIRMWARE SPECIFICATION 1
The_Firmware_(PROM)_Primatives
All Prom routines are entered via a Far Call (CALLF)
instruction to the required entry point in the prom
jump table. The jump table is located at the start of
the prom at segment address FC00h, offset 3000h.
The disc related routines usually require large
amounts of stack space.
All registers not used for returning results, have
their entry value preserved.
The only re-entrant routines are the get switch
routine and the SIO input/output/status routines (when
called with different port numbers).
.PA
<EFBFBD>
FIRMWARE SPECIFICATION 2
The following is a list of all the PROM calls and
their entry point within the jump table:
Function Entry Action_Performed
BOOT FC00:3000 Bootstrap loader
SIO_IN FC00:3005 Serial Input
SIO_OUT FC00:300A Serial Output
SIO_IN_STAT FC00:300F Serial Input status
SIO_OUT_STAT FC00:3014 Serial Output status
PRNTR_ST FC00:3019 Printer status
PRNTR_OUT FC00:301E Printer output
FLOP_SET FC00:3023 Floppy initialisation
FLOP_ALL FC00:3028 Floppy perform activity
FLOP_START FC00:302D Floppy start activity
FLOP_CONT FC00:3032 Floppy continue activity
FLOP_ABORT FC00:3037 Floppy abort activity
HDSK_ALL FC00:303C Hard disc perform activity
HDSK_START FC00:3041 Hard disc start activity
HDSK_CONT FC00:3046 Hard disc continue activity
HDSK_ABORT FC00:304B Hard disc abort activity
HDSK_SIZE FC00:3050 Return size of hard disc
GET_SWITCH FC00:3055 Get system byte
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - INITIALISE 3
BOOT
Bootstrap_Loader
Entry Values : None
Exit Values : None
This is the Prom restart.
It performs a self test and initialises all the
hardware.
All interrupt vectors are set to a dummy routine which
clears the trap-flag and returns.
Sector zero is loaded from floppy or winchester into
memory at address FC00:BC00. If the six bytes from
offset BC02 match 'Lsi_M4' or 'Cal_PC' then a jump is
made to FC00:BC00. Failing that, a boot error message
is displayed, and once a key has been pressed the
process is repeated.
This routine does NOT return.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - SERIAL I/O 4
Serial_I/O_Routines
SIO_IN - Serial Input
SIO_OUT - Serial Output
SIO_IN_STAT - Serial Input status
SIO_OUT_STAT - Serial Output status
Definition_of_M-Four_Logical_Ports
0 = Keyboard and Monitor
1 = RS232 port 1 - DART Channel B
2 = RS232 port 2 - DART Channel A
3 = RS232 port 3 - SIO Channel B
4 = RS422 port - SIO Channel A
Definition_of_Cal-PC_Logical_Ports
0 = Keyboard and Monitor
1 = Keyboard and Monitor
2 = RS232 port 1 - DART Channel A
3 = RS232 port 2 - SIO Channel B
4 = RS422 port - SIO Channel A
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - SERIAL I/O 5
SIO_IN
Serial_Input
Entry Values: DL = logical port number
Exit Values: AL = character
All registers preserved.
This routine waits until a character is available.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - SERIAL I/O 6
SIO_OUT
Serial_Output
Entry Values: AL = character
DL = logical port number
Exit Values: Flags affected
Direction-flag reset if monitor
Escape sequences are handled if monitor port.
If not monitor port, the routine loops until
SIO_OUT_STAT returns ready status, before outputting
the character.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - SERIAL I/O 7
SIO_IN_STAT
Serial_Input_Status
Entry Values: DL = logical port number
Exit Values: NZ - character available
Z - character not available
All registers preserved.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - SERIAL I/O 8
SIO_OUT_STAT
Serial_Output_Status
Entry Values: DL = logical port number
Exit Values: NZ - ready
Z - not ready
All registers preserved.
Port 0 (the monitor) is always ready.
SIO ports are ready if the transmit buffer is not full
and the DSR and CTS inputs are active.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - CENTRONICS PRINTER 9
PRNTR_ST
Printer_Status
Entry Values: None
Exit Values: NZ - centronics port ready
Z - centronics port not ready
All registers preserved.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - CENTRONICS PRINTER 10
PRNTR_OUT
Printer_Output
Entry Values: AL = character to print
Exit Values: None
All registers preserved.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 11
Floppy_Disc_Routines
FLOP_SET - Floppy initialisation
FLOP_ALL - Floppy perform activity
FLOP_START - Floppy start activity
FLOP_CONT - Floppy continue activity
FLOP_ABORT - Floppy abort activity
Definition_of_Floppy_Disc_Parameters
Floppy_Flag_Byte
Bit 0_-_reset 1_-_set
0 SINGLE SIDED DOUBLE SIDED
1 unused unused
2 unused unused
3 DOUBLE DENSITY SINGLE DENSITY
4 unused DD DISC IN QD DRIVE
5 unused unused
6 unused unused
7 unused unused
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 12
Definition_of_Floppy_Disc_Parameters_-_continued
Floppy_Command_Byte
Bit Action
7 RECAL
6 WRITE
5 READ
4 VERIFY
3 unused
2 unused
1 unused
0 DRIVE
Valid_Command_Bit_Combinations
Bit 7 6 5 4
0 0 0 0 Status only
1 1 1 1 Uncommitted entry point
1 0 0 0 Recal only
x 0 0 1 Verify
x 0 1 0 Read
x 0 1 1 Unused
x 1 0 0 Write
x 1 0 1 Write + verify
x 1 1 0 Seek
x 1 1 1 NEVER to be used due to
Confusion with seek + recal
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 13
Definition_of_Floppy_Disc_Parameters_-_continued
Prom_error_codes_returned_in_AL
10 Seek error
20 CRC error in ID
30 Write protected (from FDC)
38 No track zero
40 Record not found
50 Lost data (from FDC)
60 CRC error in data
70 DMA not reached terminal count
80 Prom busy
90 Sector out of range
A0 Bank crossing
B0 Write protected disc
Retry count returned in bits 0, 1, and 2
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 14
Definition_of_Floppy_Disc_Parameters_-_continued
FD-1793_error_codes_returned_in_AH
Return codes for:
RESTORE, SEEK, STEP IN/OUT
BIT 7 - Drive is not ready
BIT 6 - Drive is write protected
BIT 5 - Head is loaded
BIT 4 - Seek error on desired track
BIT 3 - CRC error in sector ID field
BIT 2 - Read/write head is at track zero
BIT 1 - Index mark has been detected
BIT 0 - Command is in progress
Return codes for:
READ/WRITE SECTOR, READ ADDRESS, READ/WRITE TRACK
BIT 7 - Drive is not ready
BIT 6 - Drive is write protected
BIT 5 - On read record 1 = deleted data mark
0 = data mark
On any write 1 = write fault
BIT 4 - Desired track, sector or side not found
BIT 3 - If bit 4 = 1 - CRC error in ID field
If bit 4 = 0 - CRC error in data field
BIT 2 - Computer not taking data fast enough
BIT 1 - Date available on read operation or
- Data required during write operation
BIT 0 - Command is being executed
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 15
FLOP_SET
Floppy_initialisation
Entry Values: AL = floppy flag byte
CL = retries (usually 10)
CH = sectors per track
SI = total sectors per disc
B<> <20> byte<74> pe<70> sector
Exit Values: None
All registers preserved.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 16
FLOP_ALL
Floppy_complete_activity
Entry Values: AL = floppy command byte
CX = number of sectors
DX = logical sector number
BX = buffer address
DS = buffer segment
Exit Values: NZ - activity failed
Z - activity successful
AL = prom error code
AH = FD-1793 status
Perform a complete disc activity.
Register AX plus flags affected.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 17
FLOP_START
Floppy_start_activity
Entry Values: AL = floppy command byte
CX = number of sectors
DX = logical sector number
BX = buffer address
DS = buffer segment
Exit Values: NZ - activity finished
Z - activity not finished
AL = prom error code
AH = FD-1793 status
Initiate floppy disc activity.
Register AX plus flags affected.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 18
FLOP_CONT
Floppy_continue_activity
Entry Values: None
Exit Values: NZ - activity finished
Z - activity not finished
AL = prom error code
AH = FD-1793 status
Continue activity initiated by FLOP_START.
This routine may be called at any time after a call to
FLOP_START or FLOP_CONT returned NZ. However the call
is only useful if the controller is ready (i.e
interrupt pending)
Register AX plus flags affected.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - FLOPPY ROUTINES 19
FLOP_ABORT
Floppy_abort_activity
Entry Values: None
Exit Values: None
Aborts any pending floppy disc activity.
All registers preserved.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 20
Hard_Disc_Routines
HDSK_ALL - Hard disc perform activity
HDSK_START - Hard disc start activity
HDSK_CONT - Hard disc continue activity
HDSK_ABORT - Hard disc abort activity
HDSK_SIZE - Return size of hard disc
Definition_of_Hard_Disc_Parameters
Hard_Disc_Command_Byte
Bit Action
7 RECAL
6 WRITE
5 READ
4 VERIFY
3 CONTROLLER NUMBER
2 CONTROLLER NUMBER
1 UNIT NUMBER
0 UNIT NUMBER
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 21
Definition_of_Hard_Disc_Parameters_-_continued
Prom_error_codes_returned_in_AL
00-07 No error (or correctable if AH=98H)
08-0F Select error
10-17 Timeout sending command data block
18-1F Timeout waiting for Acknowledge
20-27 Wrong status after end-of-command int
28-2F No message byte
48-4F Error reading Xebec status
68-6F Command or RAM error
70-77 DMA not reached terminal count
78-7F Error successfully read
84 Prom controller busy
88 Controller bit busy
A0 Bank crossing error
Retry count returned in bits 0, 1, and 2.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 22
Definition_of_Hard_Disc_Parameters_-_continued
Xebec_error_codes_returned_in_AH
00 No error detected
01 No index detected from disc drive
02 No seek complete from disc drive
03 Write fault from disc drive
04 Drive not ready after select
06 Track zero not found
10 ID field read error
11 Uncorrectable data error
12 Address Mark not found
14 Target sector not found
15 Seek error
18 Correctable data error
19 Bad track flag detected
1A Format error
1C Illegal access to alternate track
1D On format alternate track command, the
requested alternate track has already
been assigned as an alternate, or is
flagged a bad track
1E When controller attempted to access an
alternate track from the spared track,
the alternate track was not flagged as an
alternate
1F On a format alternate track command, the
bad track equalled the alternate track
20 Invalid command
21 Illegal disc address
30 Ram diagnostic failure
31 Program memory checksum error
32 ECC diagnostic failure
The above codes may be output with bit 7 set,
indicating the previous command used a logical block
address.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 23
HDSK_ALL
Hard_disc_complete_activity
Entry Values: AL = command byte
CH:DX = start sector (absolute)
CL = number of sectors (1-256)
DS:BX = buffer start address
CH = bits 5,6,7 are control field
(normally 0, 111 for diag)
AH = user command if bits 7-4 of
AL are clear
DI = supplementary info if bits
7-4 of AL are clear.
bits 0-13 = length of DMA-1
bit 14 set = read cntrlr
bit 15 set = write cntrlr
bites 14/15 clear = no DMA
Exit Values: Z = Ok
NZ = error
AL = error code + retry count
AH = Xebec S1410 status
if error:
CH:DX = bad sector address
Perform a complete disc activity.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 24
HDSK_START
Hard_disc_start_activity
Entry Values: AL = command byte
CH:DX = start sector (absolute)
CL = number of sectors (1-256)
DS:BX = buffer start address
CH = bits 5,6,7 are control field
(normally 0, 111 for diag)
AH = user command if bits 7-4 of
AL are clear
DI = supplementary info if bits
7-4 of AL are clear.
bits 0-13 = length of DMA-1
bit 14 set = read cntrlr
bit 15 set = write cntrlr
bites 14/15 clear = no DMA
Exit Values: Z = activity not finished
NZ = activity finished
AL = error code + retry count
AH = Xebec S1410 status
if error:
CL:DX = bad sector address
Initiate a hard disc activity.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 25
HDSK_CONT
Hard_disc_continue_activity
Entry Values: None
Exit Values: Z = activity not finished
NZ = activity finished
AL = error code + retry count
AH = Xebec S1410 status
if error:
CL:DX = bad sector address
Continue hard disc activity.
This may be called any time after the preceding
HDSK_START or HDSK_CONT call gave a zero return.
However the call is only useful if a hard disc
interrupt is pending.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 26
HDSK_ABORT
Hard_disc_continue_activity
Entry Values: None
Exit Values: None
Aborts any pending hard disc activity.
All registers preserved.
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - HARD DISC ROUTINES 27
HDSK_SIZE
Hard_disc:_return_size_of
Entry Values: None
Exit Values: BX = number of heads
CX = sectors per track
DX = number of cylinders
AX = total sectors on disc
.PA
<EFBFBD>
FIRMWARE SPECIFICATION - SYSTEM SWITCH BYTE 28
Definition_of_System_Switch_Byte
BIT 7 - Half height 5" floppy drives fitted

View File

@@ -0,0 +1,411 @@
;---------------------------------------------------------------------
; ADLER-P2.A86 version 2.1 for LSI M-FOUR and CAL-PC computers
; 30-NOV-87
; Stephen Hunt
;---------------------------------------------------------------------
;
;
; configure drive C, D or E to Triumph Adler P2 ss dd format.
;
; Will be of no use if 8" floppy drives are fitted.
;
;
;---------------------------------------------------------------------
; prom related equates
label_seg equ 0ffffh ; label segment
label_ofst equ 05h ; label offset
prom_seg equ 0fc00h ; prom segment
get_switch equ 03055h ; get switch function (prom call)
; character equates
cr equ 0dh ; carriage return
lf equ 0ah ; line feed
eof equ 01ah ; end of file
esc equ 01bh ; escape
bit0 equ 00000001b
bit1 equ 00000010b
bit2 equ 00000100b
bit3 equ 00001000b
bit4 equ 00010000b
bit5 equ 00100000b
bit6 equ 01000000b
bit7 equ 10000000b
cpm equ 0e0h
; macro to CALLF to prom (asm86 does not understand 'CALLF SEG:OFST')
codemacro call_prom func_call:dw
db 09ah
dw func_call
dw 0fc00h
endm
;---------------------------------------------------------------------
; CODE SEGMENT
;---------------------------------------------------------------------
cseg
org 0000h
;---------------------------------------------------------------------
; jump past my copywrite message
;---------------------------------------------------------------------
start:
;
jmp check_os
vers db '(C) STEPHEN HUNT 30-NOV-87, Disk Patch Version 2.1',eof
;---------------------------------------------------------------------
; check that the operating system is BDOS version 2.x
;---------------------------------------------------------------------
check_os:
;
mov cl,0ch ; get o/s version number
int cpm
and al,0f0h ; mask of lower nybble
cmp al,020h ; check version 2.x
jz get_machine_type; if ok jump forward
;---------------------------------------------------------------------
; incorrect BDOS version, so print error & terminate
;---------------------------------------------------------------------
wrong_bdos_version:
;
mov dx,offset wrong_version
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; check that the machine is a CAL-PC or LSI-M4
;---------------------------------------------------------------------
get_machine_type:
;
mov ax,label_seg
mov es,ax
mov si,offset m4_label
mov di,label_ofst
mov cx,06h
cld
rep cmpsb
mov bl,00h ; 0 = LSI-M4
jz set_mc_type
mov si,offset cal_label
mov di,label_ofst
mov cx,06h
rep cmpsb
mov bl,01h ; 1 = CAL-PC
jz set_mc_type
mov bl,02h ; 2 = UNKNOWN
;---------------------------------------------------------------------
; print machine type, and exit if not CAL-PC or LSI-M4
;---------------------------------------------------------------------
set_mc_type:
;
mov mc_type,bl
xor bh,bh
add bx,bx
add bx,offset machines
mov dx,[bx]
call print_string
cmp mc_type,02h
jb valid_hware
jmp reset
;---------------------------------------------------------------------
; print signon message
;---------------------------------------------------------------------
valid_hware:
;
mov dx,offset signon
call print_string
;---------------------------------------------------------------------
; get system dip switch setting
;---------------------------------------------------------------------
; settings returned in AL as follows:
;
; bit 0 - double sided drives
; bit 1 - quad density drives
; bit 2 - 8 inch drives
; bit 3 - hard disk present
; bit 4 - 2 floppy drives present (else only 1)
; bit 5 & 6 - hard disk type:
; 0 0 - 5 Mb ST-412 (M4) or Rodime RO201 (CAL)
; 0 1 - 10 Mb Rodime RO202
; 1 0 - 15 Mb Rodime RO203
; 1 1 - 20 Mb Rodime RO204
; bit 7 - half height 5 inch floppy drives fitted
;---------------------------------------------------------------------
get_system_type_switch:
;
call_prom get_switch
mov dip_sw,al
;---------------------------------------------------------------------
; if 8 inch floppy drives fitted print message & exit
;---------------------------------------------------------------------
test_drive_size:
;
test al,bit2 ; test for 8" drives
jz test_number_drives
mov dx,offset eight_inch ; error message
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; test if 1 or 2 floppies, if only 1 drive test also for hard disk
; if 2 drives set drive C, right hand drive
;---------------------------------------------------------------------
test_number_drives:
;
test al,bit4 ; test for 1 or 2 floppy drives
jz test_winchester ; if 1 drive, test for winchester
mov drive,02h ; set initially to drive C:
mov drvpos,01h ; set to right hand drive
jmp test_number_sides
;---------------------------------------------------------------------
; test for hard disk, if no hard disk print message & exit
;---------------------------------------------------------------------
test_winchester:
;
test al,bit3 ; test for winchester
jnz winchester_exists ; if there is a winchester jump forward
mov dx,offset one_drive
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; hard disk present so set to drive D, left hand drive
;---------------------------------------------------------------------
winchester_exists:
;
mov drive,03h ; set initially to drive D:
mov drvpos,0h ; set to left hand drive
;---------------------------------------------------------------------
; if single sided floppy drives, abort with error (see below)
;---------------------------------------------------------------------
; NOTE: There should never be single sided 5.25" drives on the CAL-PC
; or LSI-M4. If the machine is booted from a single sided disk
; with the appropriate dip switch set to single sided drives the
; operating system always display the message:
;
; System not recognised
;
; The machine then halts and has to be reset.
;
; I have encountered the above when using the following versions
; of CP/M :
;
; CP/M-86/80 level 17
; " level 21
; " level 22
; Concurrent CP/M-86/80 vers 2.0 level 1
;
; The program will therefore stop with an error message, simply
; because I don't know how single sided drives are configured.
;---------------------------------------------------------------------
test_number_sides:
test al,bit0 ; test for single or double sided
jnz test_density ; if double sided jump forward
mov dx,offset single_sided
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; if quad density floppy drive, increment the drive reference letter
;---------------------------------------------------------------------
; NOTE: If the disk drive is quad density, the disk is treated as read
; only by the BIOS.
;---------------------------------------------------------------------
;
test_density:
;
test al,bit2 ; test for double or quad density drives
jz select_drive ; if double, jump forward
inc drive ; quad density, so change patch drive
;---------------------------------------------------------------------
; select required drive via a direct bios call,
; returns the following in this configuration:
; ax = dpb offset
; bx = dpe offset
; es = segment address
;---------------------------------------------------------------------
select_drive:
;
mov dx,offset bios_code
mov cl,032h
int cpm
;---------------------------------------------------------------------
; if invalid drive (dpb or dpe = 0), print message and exit
;---------------------------------------------------------------------
test_valid_dpb:
;
test ax,ax
jz drive_select_error
test bx,bx
jnz set_new_format
drive_select_error:
;
mov dx,offset select_error
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; overwrite the old disk parameters with the new parameters
;---------------------------------------------------------------------
set_new_format:
;
mov si,offset new_dpb
mov di,ax
mov cx,24
cld
rep movsb
;---------------------------------------------------------------------
; get & display the drive that has been patched, and to what format
; before terminating
;---------------------------------------------------------------------
finished_message:
;
mov ax,drive
add al,'A'
mov drv_letter,al
mov dx,offset complete
;jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; print message at DX, reset all drives, and exit back to CP/M-86
;---------------------------------------------------------------------
exit_msg:
;
call print_string
reset: ; reset drives even if errors occur
;
mov cl,0dh
int cpm
exit:
;
xor cl,cl
xor dl,dl
int cpm
;---------------------------------------------------------------------
; subroutine: print string at offset DX
;---------------------------------------------------------------------
print_string:
;
mov cl,09h
int cpm
ret
;---------------------------------------------------------------------
; END OF CODE SEGMENT
;---------------------------------------------------------------------
;---------------------------------------------------------------------
; DATA SEGMENT
;---------------------------------------------------------------------
dseg
org 0100h
signon db ' Disk Patch Version 2.1 (C) S.Hunt 30-Nov-87',cr,lf,'$'
complete db cr,lf,'Drive '
drv_letter db 'X'
db ': set to Triumph Adler P2 SS DD format',cr,lf,'$'
machines dw offset m_four
dw offset cal_pc
dw offset unknown
m_four db cr,lf,'LSI M-FOUR$'
cal_pc db cr,lf,'CAL-PC$'
unknown db cr,lf,'Disk Patch only runs on the LSI M-FOUR or CAL-PC$'
wrong_version db cr,lf,'Disk Patch Requires CP/M-86 version 2.x$'
eight_inch db cr,lf,'Aborting - not configured for 8" drives$'
one_drive db cr,lf,'Aborting - not configured for single drive machine$'
single_sided db cr,lf,'Aborting - configuration not known for single sided drives$'
select_error db cr,lf,'Aborting - Unable to access disk parameters$'
dip_sw db 00h ; dip switch setting
mc_type db 02h ; machine type
m4_label db 'Lsi_M4' ; machine label in prom at FFFF:0005
cal_label db 'Cal_PC' ; " " " " " " "
bios_code db 09h ; select drive function
drive dw 00h ; drive code [CX]
dw 00h ; " " [DX]
;---------------------------------------------------------------------
; parameters for Triumph Adler P2 single sided double density format
;---------------------------------------------------------------------
new_dpb dw 32 ; spt
db 3 ; bsh
db 7 ; blm
db 0 ; exm
dw 151 ; dsm
dw 63 ; drm
db 0c0h ; al0
db 0 ; al1
dw 16 ; cks
dw 2 ; off
;---------------------------------------------------------------------
; parameters used by the firmware when accessing the disk controller.
; MUST follow on directly after the Disk Parameter Block.
;---------------------------------------------------------------------
flags db 00h ; parameter flags (initially SS DD)
db 0ah ; number of retries
db 010h ; physical sectors per track
drvpos db 01h ; right hand drive
db 00h ; ? don't know ?
dw 0280h ; total sectors per disk
dw 0100h ; bytes per sector
db 0 ; just padding !!
;---------------------------------------------------------------------
; END OF DATA SEGMENT
;---------------------------------------------------------------------
end
;---------------------------------------------------------------------
; end of Disk Patch v2.10
;---------------------------------------------------------------------


View File

@@ -0,0 +1,419 @@
;---------------------------------------------------------------------
; IBMCPM.A86 version 2.1 for LSI M-FOUR and CAL-PC computers
; 23-MAR-88
; Stephen Hunt
;---------------------------------------------------------------------
;
;
; configure drive C, D or E to IBM CP/M ss dd format.
;
; Will be of no use if 8" floppy drives are fitted.
;
;
;---------------------------------------------------------------------
; prom related equates
label_seg equ 0ffffh ; label segment
label_ofst equ 05h ; label offset
prom_seg equ 0fc00h ; prom segment
get_switch equ 03055h ; get switch function (prom call)
; character equates
cr equ 0dh ; carriage return
lf equ 0ah ; line feed
eof equ 01ah ; end of file
esc equ 01bh ; escape
bit0 equ 00000001b
bit1 equ 00000010b
bit2 equ 00000100b
bit3 equ 00001000b
bit4 equ 00010000b
bit5 equ 00100000b
bit6 equ 01000000b
bit7 equ 10000000b
cpm equ 0e0h
; macro to CALLF to prom (asm86 does not understand 'CALLF SEG:OFST')
codemacro call_prom func_call:dw
db 09ah
dw func_call
dw 0fc00h
endm
;---------------------------------------------------------------------
; CODE SEGMENT
;---------------------------------------------------------------------
cseg
org 0000h
;---------------------------------------------------------------------
; jump past my copywrite message
;---------------------------------------------------------------------
start:
;
jmp check_os
vers db '(C) STEPHEN HUNT 23-MAR-88, Disk Patch Version 2.1',eof
;---------------------------------------------------------------------
; check that the operating system is BDOS version 2.x
;---------------------------------------------------------------------
check_os:
;
mov cl,0ch ; get o/s version number
int cpm
and al,0f0h ; mask of lower nybble
cmp al,020h ; check version 2.x
jz get_machine_type; if ok jump forward
;---------------------------------------------------------------------
; incorrect BDOS version, so print error & terminate
;---------------------------------------------------------------------
wrong_bdos_version:
;
mov dx,offset wrong_version
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; check that the machine is a CAL-PC or LSI-M4
;---------------------------------------------------------------------
get_machine_type:
;
mov ax,label_seg
mov es,ax
mov si,offset m4_label
mov di,label_ofst
mov cx,06h
cld
rep cmpsb
mov bl,00h ; 0 = LSI-M4
jz set_mc_type
mov si,offset cal_label
mov di,label_ofst
mov cx,06h
rep cmpsb
mov bl,01h ; 1 = CAL-PC
jz set_mc_type
mov bl,02h ; 2 = UNKNOWN
;---------------------------------------------------------------------
; print machine type, and exit if not CAL-PC or LSI-M4
;---------------------------------------------------------------------
set_mc_type:
;
mov mc_type,bl
xor bh,bh
add bx,bx
add bx,offset machines
mov dx,[bx]
call print_string
cmp mc_type,02h
jb valid_hware
jmp reset
;---------------------------------------------------------------------
; print signon message
;---------------------------------------------------------------------
valid_hware:
;
mov dx,offset signon
call print_string
;---------------------------------------------------------------------
; get system dip switch setting
;---------------------------------------------------------------------
; settings returned in AL as follows:
;
; bit 0 - double sided drives
; bit 1 - quad density drives
; bit 2 - 8 inch drives
; bit 3 - hard disk present
; bit 4 - 2 floppy drives present (else only 1)
; bit 5 & 6 - hard disk type:
; 0 0 - 5 Mb ST-412 (M4) or Rodime RO201 (CAL)
; 0 1 - 10 Mb Rodime RO202
; 1 0 - 15 Mb Rodime RO203
; 1 1 - 20 Mb Rodime RO204
; bit 7 - half height 5 inch floppy drives fitted
;---------------------------------------------------------------------
get_system_type_switch:
;
call_prom get_switch
mov dip_sw,al
;---------------------------------------------------------------------
; if 8 inch floppy drives fitted print message & exit
;---------------------------------------------------------------------
test_drive_size:
;
test al,bit2 ; test for 8" drives
jz test_number_drives
mov dx,offset eight_inch ; error message
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; test if 1 or 2 floppies, if only 1 drive test also for hard disk
; if 2 drives set drive C, right hand drive
;---------------------------------------------------------------------
test_number_drives:
;
test al,bit4 ; test for 1 or 2 floppy drives
jz test_winchester ; if 1 drive, test for winchester
mov drive,02h ; set initially to drive C:
mov drvpos,01h ; set to right hand drive
jmp test_number_sides
;---------------------------------------------------------------------
; test for hard disk, if no hard disk print message & exit
;---------------------------------------------------------------------
test_winchester:
;
test al,bit3 ; test for winchester
jnz winchester_exists ; if there is a winchester jump forward
mov dx,offset one_drive
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; hard disk present so set to drive D, left hand drive
;---------------------------------------------------------------------
winchester_exists:
;
mov drive,03h ; set initially to drive D:
mov drvpos,0h ; set to left hand drive
;---------------------------------------------------------------------
; if single sided floppy drives, abort with error (see below)
;---------------------------------------------------------------------
; NOTE: There should never be single sided 5.25" drives on the CAL-PC
; or LSI-M4. If the machine is booted from a single sided disk
; with the appropriate dip switch set to single sided drives the
; operating system always display the message:
;
; System not recognised
;
; The machine then halts and has to be reset.
;
; I have encountered the above when using the following versions
; of CP/M :
;
; CP/M-86/80 level 17
; " level 21
; " level 22
; Concurrent CP/M-86/80 vers 2.0 level 1
;
; The program will therefore stop with an error message, simply
; because I don't know how single sided drives are configured.
;
; 23-03-88 only single sided 8" drives may exists on this system !
;
;---------------------------------------------------------------------
test_number_sides:
test al,bit0 ; test for single or double sided
jnz test_density ; if double sided jump forward
mov dx,offset single_sided
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; if quad density floppy drive, increment the drive reference letter
;---------------------------------------------------------------------
; NOTE: If the disk drive is quad density, the disk is treated as read
; only by the BIOS.
;---------------------------------------------------------------------
;
test_density:
;
test al,bit2 ; test for double or quad density drives
jz select_drive ; if double, jump forward
inc drive ; quad density, so change patch drive
;---------------------------------------------------------------------
; select required drive via a direct bios call,
; returns the following in this configuration:
; ax = dpb offset
; bx = dpe offset
; es = segment address
;---------------------------------------------------------------------
select_drive:
;
mov dx,offset bios_code
mov cl,032h
int cpm
;---------------------------------------------------------------------
; if invalid drive (dpb or dpe = 0), print message and exit
;---------------------------------------------------------------------
test_valid_dpb:
;
test ax,ax
jz drive_select_error
test bx,bx
jnz set_new_format
drive_select_error:
;
mov dx,offset select_error
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; overwrite the old disk parameters with the new parameters
;---------------------------------------------------------------------
set_new_format:
;
mov si,offset new_dpb
mov di,ax
mov cx,24
cld
rep movsb
;---------------------------------------------------------------------
; get & display the drive that has been patched, and to what format
; before terminating
;---------------------------------------------------------------------
finished_message:
;
mov ax,drive
add al,'A'
mov drv_letter,al
mov dx,offset complete
;jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; print message at DX, reset all drives, and exit back to CP/M-86
;---------------------------------------------------------------------
exit_msg:
;
call print_string
reset: ; reset drives even if errors occur
;
mov cl,0dh
int cpm
exit:
;
xor cl,cl
xor dl,dl
int cpm
;---------------------------------------------------------------------
; subroutine: print string at offset DX
;---------------------------------------------------------------------
print_string:
;
mov cl,09h
int cpm
ret
;---------------------------------------------------------------------
; END OF CODE SEGMENT
;---------------------------------------------------------------------
;---------------------------------------------------------------------
; DATA SEGMENT
;---------------------------------------------------------------------
dseg
org 0100h
signon db ' Disk Patch Version 2.1 (C) S.Hunt 23-Mar-88',cr,lf,'$'
complete db cr,lf,'Drive '
drv_letter db 'X'
db ': set to IBM CP/M SS DD format',cr,lf,'$'
machines dw offset m_four
dw offset cal_pc
dw offset unknown
m_four db cr,lf,'LSI M-FOUR$'
cal_pc db cr,lf,'CAL-PC$'
unknown db cr,lf,'Disk Patch only runs on the LSI M-FOUR or CAL-PC$'
wrong_version db cr,lf,'Disk Patch Requires CP/M-86 version 2.x$'
eight_inch db cr,lf,'Aborting - not configured for 8" drives$'
one_drive db cr,lf,'Aborting - not configured for single drive machine$'
single_sided db cr,lf,'Aborting - configuration not known for single sided drives$'
select_error db cr,lf,'Aborting - Unable to access disk parameters$'
dip_sw db 00h ; dip switch setting
mc_type db 02h ; machine type
m4_label db 'Lsi_M4' ; machine label in prom at FFFF:0005
cal_label db 'Cal_PC' ; " " " " " " "
bios_code db 09h ; select drive function
drive dw 00h ; drive code [CX]
dw 00h ; " " [DX]
;---------------------------------------------------------------------
; parameters for IBM CP/M single sided double density format.
;
; NOTE: each track has 8 x 512 byte sectors. However, this system
; expects each sector to be 128 bytes long. So as far as this system
; is concerned, each track has 32 x 128 byte sectors per track.
; (i.e 8 x 512 = 32 x 128)
;---------------------------------------------------------------------
new_dpb dw 020h ; spt
db 03h ; bsh
db 07h ; blm
db 0h ; exm
dw 09bh ; dsm
dw 03fh ; drm
db 0c0h ; al0
db 0h ; al1
dw 010h ; cks
dw 01h ; off
;---------------------------------------------------------------------
; parameters used by the firmware when accessing the disk controller.
; MUST follow on directly after the Disk Parameter Block.
;---------------------------------------------------------------------
flags db 00h ; parameter flags (initially SS DD)
db 0ah ; number of retries
db 08h ; physical sectors per track
drvpos db 01h ; right hand drive
db 00h ; ? don't know ?
dw 320 ; total sectors per disk
dw 512 ; bytes per sector
db 0 ; just padding !!
;---------------------------------------------------------------------
; END OF DATA SEGMENT
;---------------------------------------------------------------------
end
;---------------------------------------------------------------------
; end of Disk Patch v2.10
;---------------------------------------------------------------------


View File

@@ -0,0 +1,237 @@
;---------------------------------------------------------------------
; LOADCPM.ASM (FOR CAL-PC MSDOS 2.11 - ASSEMBLE USING A86.COM)
; 28-10-88
; STEPHEN HUNT
;---------------------------------------------------------------------
; 28-12-89
; Modified to attempt to open the CPM.SYS file in the root directory
; if it could not be found in the current directory
;---------------------------------------------------------------------
;
cr equ 0dh ; carriage return
lf equ 0ah ; line feed
eof equ 01ah ; end of file marker
;
dos equ 21h
;
;---------------------------------------------------------------------
; jump to start of code
;---------------------------------------------------------------------
;
loadcpm:
;
jmp start
;
db 'LOADCPM version 1.1 Copyright (C) Stephen Hunt'
db eof
;
;---------------------------------------------------------------------
; tell 'em what were up to
;---------------------------------------------------------------------
;
start:
;
mov dx,offset loading
call print_string
;
;---------------------------------------------------------------------
; open the CPM.SYS file
;---------------------------------------------------------------------
;
mov dx,offset cpm_sys+1 ; assume 'CPM.SYS'
call open_cpm ; open file
jnc read_cpm_sys ; ok - continue
;
mov dx,offset cpm_sys ; assume '\CPM.SYS'
call open_cpm ; open file
jnc read_cpm_sys ; ok - continue
;
mov dx,offset err_open ; 'cannot find CPM.SYS'
jmp error_exit ; exit with error
;---------------------------------------------------------------------
; read the CPM.SYS file (upto 32k bytes, usually only 16k bytes)
;---------------------------------------------------------------------
;
read_cpm_sys:
;
mov bx,word ptr cpm_hnd
mov dx,offset cpm_buf
mov cx,32768
mov ah,03fh
int dos ; read 32768 bytes of CPM.SYS
;
mov word ptr cpm_siz,ax ; store number of bytes read
;
pushf ; save read error status
call closecpm ; close CPM.SYS file
popf ; restore read error status
;
jnc check_header ; continue if read successful
;
mov dx,offset err_read ; 'error reading CPM.SYS'
jmp error_exit ; exit with error
;---------------------------------------------------------------------
; check that the CPM.SYS header record is valid
;---------------------------------------------------------------------
;
check_header:
;
cmp word ptr cpm_siz,0 ; q. was anything read ?
jz check_header_err ; no - error
;
mov si,offset cpm_buf
cmp byte ptr 0[si],1 ; q. code segment group type present ?
jnz check_header_err ; no - error
;
mov ax,word ptr 1[si] ; get group length in paragraphs
mov dx,010h
mul dx ; convert to length in bytes
mov word ptr cpm_len,ax ; and store it
;
mov bx,word ptr cpm_siz
cmp bx,ax ; q. file size greater than code length ?
jb check_header_err ; no - error
;
sub bx,080h ; subtract length of header record
sub bx,ax ; then the code length
cmp bx,080h ; q. (file size less header) more than
; ; 128 bytes larger than code length ?
jae check_header_err ; yes - error
;
cmp word ptr 3[si],0 ; q. base segment defined ?
jz check_header_err ; no - error
;
mov ax,word ptr 1[si]
cmp ax,word ptr 5[si] ; q. code length equal minimum length ?
jnz check_header_err ; no - error
;
cmp word ptr 7[si],0 ; q. maximum length defined ?
jnz check_header_err ; yes - error
;
add si,9 ; point to next group descriptor
mov cx,128 -9
cld
;
check_header_loop:
;
cmp byte ptr 0[si],0 ; q. any more descriptors defined ?
jnz check_header_err ; yes - error
loop check_header_loop ; loop until finished
;
jmp reset_int3 ; reset int 3 vector
;
check_header_err:
;
mov dx,offset err_head ; 'invalid CPM.SYS header'
jmp error_exit ; exit with error
;---------------------------------------------------------------------
; reset interrupt 3 to use the prom interrupt 3 routine (FC00:32BE).
;---------------------------------------------------------------------
;
reset_int3:
;
push ds
mov dx,0fc00h ; segment FC00h
mov ds,dx
mov dx,032beh ; offset 32BEh
mov al,3
mov ah,025h
int dos ; reset int 3
pop ds
;---------------------------------------------------------------------
; relocate cpm image, set segment registers and jump to it.
;---------------------------------------------------------------------
;
move_cpm:
;
mov ax,word ptr cpm_buf +3
mov es,ax ; es points to cpm segment
;
mov si,offset cpm_buf +080h
xor di,di ; set source + destination pointers
;
mov cx,word ptr cpm_len ; set length of code to move
;
cld ; clear the direction flag
cli ; plus the interrupt flag
;
rep movsb ; move it !!!!
;
mov ds,ax
push ax ; push cpm segment address on stack
mov ax,02500h
push ax ; push bios cold boot address on stack
;
retf ; return far to CPM-86 !!!
;---------------------------------------------------------------------
; Subroutines
;---------------------------------------------------------------------
; Open CPM.SYS file
;---------------------------------------------------------------------
;
open_cpm:
;
xor al,al
mov ah,03dh
int dos ; open CPM.SYS file
mov word ptr cpm_hnd,ax ; save file handle
;
ret
;---------------------------------------------------------------------
; Close CPM.SYS file
;---------------------------------------------------------------------
;
close_cpm:
;
mov bx,word ptr cpm_hnd
mov ah,03eh
int dos ; close CPM.SYS file
;
ret
;---------------------------------------------------------------------
; print string at offset dx
;---------------------------------------------------------------------
;
print_string:
;
mov ah,09h
int dos ; print string
;
ret
;---------------------------------------------------------------------
; print string and exit
;---------------------------------------------------------------------
;
error_exit:
;
call print_string
mov ah,04ch
xor al,al
int dos ; return to dos
;
;---------------------------------------------------------------------
; data
;---------------------------------------------------------------------
;
loading db cr,lf,'Loading CP/M-86 $'
;
err_open db cr,lf,lf,'Unable to open CPM.SYS',cr,lf,'$'
err_read db cr,lf,lf,'Error reading CPM.SYS',cr,lf,'$'
err_head db cr,lf,lf,'Invalid CPM.SYS header',cr,lf,'$'
;
cpm_sys db '\CPM.SYS',0 ; asciiz file name
cpm_hnd dw 0 ; file handle
cpm_siz dw 0 ; file size
cpm_len dw 0 ; code length
;
cpm_buf db 32768 dup (0) ; cpm.sys load buffer
;
db 0 ; spare
;
;---------------------------------------------------------------------
;
;---------------------------------------------------------------------
;
end


View File

@@ -0,0 +1,381 @@
;---------------------------------------------------------------------
; PCW8256.A86 version 2.0 for LSI M-FOUR and CAL-PC computers
; 13-NOV-87
; Stephen Hunt
;---------------------------------------------------------------------
;
;
; configure drive B, C or D to Amstrad PCW8256 ss dd format.
;
; Will only be of use if a 3" drive is fitted as the right
; hand drive on dual floppies machines, or the left hand
; drive drive on hard disk machines.
;
;
;---------------------------------------------------------------------
; prom related equates
label_seg equ 0ffffh ; label segment
label_ofst equ 05h ; label offset
prom_seg equ 0fc00h ; prom segment
get_switch equ 03055h ; get switch function (prom call)
; character equates
cr equ 0dh ; carriage return
lf equ 0ah ; line feed
eof equ 01ah ; end of file
esc equ 01bh ; escape
bit0 equ 00000001b
bit1 equ 00000010b
bit2 equ 00000100b
bit3 equ 00001000b
bit4 equ 00010000b
bit5 equ 00100000b
bit6 equ 01000000b
bit7 equ 10000000b
cpm equ 0e0h
; macro to CALLF to prom (asm86 does not understand 'CALLF SEG:OFST')
codemacro call_prom func_call:dw
db 09ah
dw func_call
dw 0fc00h
endm
;---------------------------------------------------------------------
; CODE SEGMENT
;---------------------------------------------------------------------
cseg
org 0000h
;---------------------------------------------------------------------
; jump past my copywrite message
;---------------------------------------------------------------------
start:
;
jmp check_os
vers db '(C) STEPHEN HUNT 13-NOV-87, Disk Patch Version 2.0',eof
;---------------------------------------------------------------------
; check that the operating system is BDOS version 2.x
;---------------------------------------------------------------------
check_os:
;
mov cl,0ch ; get o/s version number
int cpm
and al,0f0h ; mask of lower nyble
cmp al,020h ; check version 2.x
jz get_machine_type; if ok jump forward
;---------------------------------------------------------------------
; incorrect BDOS version, so print error & terminate
;---------------------------------------------------------------------
wrong_bdos_version:
;
mov dx,offset wrong_version
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; check that the machine is a CAL-PC or LSI-M4
;---------------------------------------------------------------------
get_machine_type:
;
mov ax,label_seg
mov es,ax
mov si,offset m4_label
mov di,label_ofst
mov cx,06h
cld
rep cmpsb
mov bl,00h ; 0 = LSI-M4
jz set_mc_type
mov si,offset cal_label
mov di,label_ofst
mov cx,06h
rep cmpsb
mov bl,01h ; 1 = CAL-PC
jz set_mc_type
mov bl,02h ; 2 = UNKNOWN
;---------------------------------------------------------------------
; print machine type, and exit if not CAL-PC or LSI-M4
;---------------------------------------------------------------------
set_mc_type:
;
mov mc_type,bl
xor bh,bh
add bx,bx
add bx,offset machines
mov dx,[bx]
call print_string
cmp mc_type,02h
jb valid_hware
jmp reset
;---------------------------------------------------------------------
; print signon message
;---------------------------------------------------------------------
valid_hware:
;
mov dx,offset signon
call print_string
;---------------------------------------------------------------------
; get system dip switch setting
;---------------------------------------------------------------------
; settings returnend in AL as follows:
;
; bit 0 - double sided drives
; bit 1 - quad density drives
; bit 2 - 8 inch drives
; bit 3 - hard disk present
; bit 4 - 2 floppy drives present (else only 1)
; bit 5 & 6 - hard disk type:
; 0 0 - 5 Mb ST-412 (M4) or Rodime RO201 (CAL)
; 0 1 - 10 Mb Rodime RO202
; 1 0 - 15 Mb Rodime RO203
; 1 1 - 20 Mb Rodime RO204
; bit 7 - half height 5 inch floppy drives fitted
;---------------------------------------------------------------------
get_system_type_switch:
;
call_prom get_switch
mov dip_sw,al
;---------------------------------------------------------------------
; if 8 inch floppy drives fitted print message & exit
;---------------------------------------------------------------------
test_drive_size:
;
test al,bit2 ; test for 8" drives
jz test_number_drives
mov dx,offset eight_inch ; error message
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; test if 1 or 2 floppies, if only 1 drive test also for hard disk
; if 2 drives set drive C, right hand drive
;---------------------------------------------------------------------
test_number_drives:
;
test al,bit4 ; test for 1 or 2 floppy drives
jz test_winchester ; if 1 drive, test for winchester
mov drive,02h ; set initialy to drive C:
mov drvpos,01h ; set to right hand drive
jmp test_number_sides
;---------------------------------------------------------------------
; test for hard disk, if no hard disk print message & exit
;---------------------------------------------------------------------
test_winchester:
;
test al,bit3 ; test for winchester
jnz winchester_exists ; if there is a winchester jump forward
mov dx,offset one_drive
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; hard disk present so set to drive D, left hand drive
;---------------------------------------------------------------------
winchester_exists:
;
mov drive,03h ; set initialy to drive D:
mov drvpos,0h ; set to left hand drive
;---------------------------------------------------------------------
; if single sided flopy drives, decrement the drive reference letter
;---------------------------------------------------------------------
test_number_sides:
;
test al,bit0 ; test for single or double sided
jnz test_density ; if double sided jump forward
dec drive ; single sided, so change patch drive
;---------------------------------------------------------------------
; if quad density floppy drive, set flag in disk controller parameters
;---------------------------------------------------------------------
test_density:
;
test al,bit2 ; test for double or quad density drives
jz select_drive ; if double, jump forward
or flags,bit4 ; set quad density flag
;---------------------------------------------------------------------
; select required drive via a direct bios call,
; returns the following in this configuration:
; ax = dpb offset
; bx = dpe offset
; es = segment address
;---------------------------------------------------------------------
select_drive:
;
mov dx,offset bios_code
mov cl,032h
int cpm
;---------------------------------------------------------------------
; if invalid drive (dpb or dpe = 0), print message and exit
;---------------------------------------------------------------------
test_valid_dpb:
;
test ax,ax
jz drive_select_error
test bx,bx
jnz set_new_format
drive_select_error:
;
mov dx,offset select_error
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; overwrite the old disk parameters with the new parameters
;---------------------------------------------------------------------
set_new_format:
;
mov si,offset new_dpb
mov di,ax
mov cx,24
cld
rep movsb
;---------------------------------------------------------------------
; get & display the drive that has been patched, and to what format
; before terminating
;---------------------------------------------------------------------
finished_message:
;
mov ax,drive
add al,'A'
mov drv_letter,al
mov dx,offset complete
;jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; print message at DX, reset all drives, and exit back to CP/M-86
;---------------------------------------------------------------------
exit_msg:
;
call print_string
reset: ; reset drives even if errors occur
;
mov cl,0dh
int cpm
exit:
;
xor cl,cl
xor dl,dl
int cpm
;---------------------------------------------------------------------
; subroutine: print string at offset DX
;---------------------------------------------------------------------
print_string:
;
mov cl,09h
int cpm
ret
;---------------------------------------------------------------------
; END OF CODE SEGMENT
;---------------------------------------------------------------------
;---------------------------------------------------------------------
; DATA SEGMENT
;---------------------------------------------------------------------
dseg
org 0100h
signon db ' Disk Patch Version 2.0 (C) S.Hunt 13-Nov-87',cr,lf,'$'
complete db cr,lf
db 'Drive '
drv_letter db 'X'
db ': set to Amstrad PCW SS DD format',cr,lf,'$'
machines dw offset m_four
dw offset cal_pc
dw offset unknown
m_four db cr,lf,'LSI M-FOUR$'
cal_pc db cr,lf,'CAL-PC$'
unknown db cr,lf,'Disk Patch only runs on the LSI M-FOUR or CAL-PC$'
wrong_version db cr,lf,'Disk Patch Requires CP/M-86 version 2.x$'
eight_inch db cr,lf,'Aborting - not configured for 8" drives$'
one_drive db cr,lf,'Aborting - not configured for single drive machine'
select_error db cr,lf,'Aborting - Unable to access disk parameters$'
mc_type db 02h ; machine type
dip_sw db 00h ; dip switch setting
bios_code db 09h ; select drive function
drive dw 00h ; drive code [CX]
dw 00h ; " " [DX]
m4_label db 'Lsi_M4'
cal_label db 'Cal_PC'
; parameters for Amstrad PCW 8256/8512 SS DD drive
new_dpb dw 024h ; spt
db 03h ; bsh
db 07h ; blm
db 0h ; exm
dw 0aeh ; dsm
dw 03fh ; drm
db 0c0h ; al0
db 0 ; al1
dw 010h ; cks
dw 01h ; off
flags db 00h ; parameter flags (initialy SS DD)
db 0ah ; retries
db 09h ; physical sectors / track
drvpos db 01h ; initialy right hand drive
db 00h ; ?
dw 0168h ; total sectors / disk
dw 0200h ; bytes / sector
db 0 ;this byte is of no real use !
;---------------------------------------------------------------------
; END OF DATA SEGMENT
;---------------------------------------------------------------------
end
;---------------------------------------------------------------------
; end of Disk Patch v2.00
;---------------------------------------------------------------------


View File

@@ -0,0 +1,398 @@
;---------------------------------------------------------------------
; SV328.A86 version 2.2 for LSI M-FOUR and CAL-PC computers
; 06-APR-88
; Stephen Hunt
;---------------------------------------------------------------------
;
;
; configure drive C, D or E to Spectravideo SV328 ss sd format.
;
; Will be of no use if 8" floppy drives are fitted.
;
;
;---------------------------------------------------------------------
; prom related equates
label_seg equ 0ffffh ; label segment
label_ofst equ 05h ; label offset
prom_seg equ 0fc00h ; prom segment
get_switch equ 03055h ; get switch function (prom call)
; character equates
cr equ 0dh ; carriage return
lf equ 0ah ; line feed
eof equ 01ah ; end of file
esc equ 01bh ; escape
bit0 equ 00000001b
bit1 equ 00000010b
bit2 equ 00000100b
bit3 equ 00001000b
bit4 equ 00010000b
bit5 equ 00100000b
bit6 equ 01000000b
bit7 equ 10000000b
cpm equ 0e0h
; macro to CALLF to prom (asm86 does not understand 'CALLF SEG:OFST')
codemacro call_prom func_call:dw
db 09ah
dw func_call
dw 0fc00h
endm
;---------------------------------------------------------------------
; CODE SEGMENT
;---------------------------------------------------------------------
cseg
org 0000h
;---------------------------------------------------------------------
; jump past my copywrite message
;---------------------------------------------------------------------
start:
;
jmp check_os
vers db '(C) STEPHEN HUNT 06-APR-88, Disk Patch Version 2.2'
db eof
;---------------------------------------------------------------------
; check that the operating system is BDOS version 2.x
;---------------------------------------------------------------------
check_os:
;
mov cl,0ch ; get o/s version number
int cpm
and al,0f0h ; mask of lower nybble
cmp al,020h ; check version 2.x
jz get_machine_type; if ok jump forward
;---------------------------------------------------------------------
; incorrect BDOS version, so print error & terminate
;---------------------------------------------------------------------
wrong_bdos_version:
;
mov dx,offset wrong_version
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; check that the machine is a CAL-PC or LSI-M4
;---------------------------------------------------------------------
get_machine_type:
;
mov ax,label_seg
mov es,ax
mov si,offset m4_label
mov di,label_ofst
mov cx,06h
cld
rep cmpsb
mov bl,00h ; 0 = LSI-M4
jz set_mc_type
mov si,offset cal_label
mov di,label_ofst
mov cx,06h
rep cmpsb
mov bl,01h ; 1 = CAL-PC
jz set_mc_type
mov bl,02h ; 2 = UNKNOWN
;---------------------------------------------------------------------
; print machine type, and exit if not CAL-PC or LSI-M4
;---------------------------------------------------------------------
set_mc_type:
;
mov mc_type,bl
xor bh,bh
add bx,bx
add bx,offset machines
mov dx,[bx]
call print_string
cmp mc_type,02h
jb valid_hware
jmp reset
;---------------------------------------------------------------------
; print signon message
;---------------------------------------------------------------------
valid_hware:
;
mov dx,offset signon
call print_string
;---------------------------------------------------------------------
; get system dip switch setting
;---------------------------------------------------------------------
; settings returned in AL as follows:
;
; bit 0 - double sided drives
; bit 1 - quad density drives
; bit 2 - 8 inch drives
; bit 3 - hard disk present
; bit 4 - 2 floppy drives present (else only 1)
; bit 5 & 6 - hard disk type:
; 0 0 - 5 Mb ST-412 (M4) or Rodime RO201 (CAL)
; 0 1 - 10 Mb Rodime RO202
; 1 0 - 15 Mb Rodime RO203
; 1 1 - 20 Mb Rodime RO204
; bit 7 - half height 5 inch floppy drives fitted
;---------------------------------------------------------------------
get_system_type_switch:
;
call_prom get_switch
;---------------------------------------------------------------------
; if 8 inch floppy drives fitted abort with error
;---------------------------------------------------------------------
test_drive_size:
;
test al,bit2 ; test for 8" drives
jz test_number_sides
mov dx,offset eight_inch ; error message
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; if single sided floppy drives, abort with error
;---------------------------------------------------------------------
; NOTE: This switch is only set if 8" drives are fitted. If program
; program controls reaches here and it is set - weve goofed !
;
; If a 5.25" system is booted with this switch set, the system
; halts with the message: 'System not recognised'
;---------------------------------------------------------------------
test_number_sides:
test al,bit0 ; test for single or double sided
jnz test_number_drives ; if double sided jump forward
mov dx,offset single_sided
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; test if 1 or 2 floppies, if only 1 drive test also for hard disk
; if 2 drives set drive C, right hand drive
;---------------------------------------------------------------------
test_number_drives:
;
test al,bit4 ; test for 1 or 2 floppy drives
jz test_winchester ; if 1 drive, test for winchester
mov drive,02h ; set initially to drive C:
mov drvpos,01h ; set to right hand drive
jmp test_number_sides
;---------------------------------------------------------------------
; test for hard disk, if no hard disk print message & exit
;---------------------------------------------------------------------
test_winchester:
;
test al,bit3 ; test for winchester
jnz winchester_exists ; if there is a winchester jump forward
mov dx,offset one_drive
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; hard disk present so set to drive D, left hand drive
;---------------------------------------------------------------------
winchester_exists:
;
mov drive,03h ; set initially to drive D:
mov drvpos,0h ; set to left hand drive
;---------------------------------------------------------------------
; if quad density floppy drive, increment the drive reference letter
;---------------------------------------------------------------------
; NOTE: If the disk drive is quad density, the disk is treated as read
; only by the BIOS.
;---------------------------------------------------------------------
;
test_density:
;
test al,bit2 ; test for double or quad density drives
jz select_drive ; if double, jump forward
inc drive ; quad density, so change patch drive
;---------------------------------------------------------------------
; select required drive via a direct bios call,
; returns the following in this configuration:
; ax = dpb offset
; bx = dpe offset
; es = segment address
;---------------------------------------------------------------------
select_drive:
;
mov dx,offset bios_code
mov cl,032h
int cpm
;---------------------------------------------------------------------
; if invalid drive (dpb or dpe = 0), print message and exit
;---------------------------------------------------------------------
test_valid_dpb:
;
test ax,ax
jz drive_select_error
test bx,bx
jnz set_new_format
drive_select_error:
;
mov dx,offset select_error
jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; overwrite the old disk parameters with the new parameters
;---------------------------------------------------------------------
set_new_format:
;
mov si,offset new_dpb
mov di,ax
mov cx,24
cld
rep movsb
;---------------------------------------------------------------------
; get & display the drive that has been patched, and to what format
; before terminating
;---------------------------------------------------------------------
finished_message:
;
mov ax,drive
add al,'A'
mov drv_letter,al
mov dx,offset complete
;jmp exit_msg ; print message & exit
;---------------------------------------------------------------------
; print message at DX, reset all drives, and exit back to CP/M-86
;---------------------------------------------------------------------
exit_msg:
;
call print_string
reset: ; reset drives even if errors occur
;
mov cl,0dh
int cpm
exit:
;
xor cl,cl
xor dl,dl
int cpm
;---------------------------------------------------------------------
; subroutine: print string at offset DX
;---------------------------------------------------------------------
print_string:
;
mov cl,09h
int cpm
ret
;---------------------------------------------------------------------
; END OF CODE SEGMENT
;---------------------------------------------------------------------
;---------------------------------------------------------------------
; DATA SEGMENT
;---------------------------------------------------------------------
dseg
org 0100h
signon db ' Disk Patch Version 2.2 (C) S.Hunt 06-Apr-88',cr,lf,'$'
complete db cr,lf,'Drive '
drv_letter db 'X'
db ': set to Spectravideo SV328 Single Sided '
db 'Single Density format',cr,lf,'$'
machines dw offset m_four
dw offset cal_pc
dw offset unknown
m_four db cr,lf,'LSI M-FOUR$'
cal_pc db cr,lf,'CAL-PC$'
unknown db cr,lf,'Disk Patch only runs on the LSI M-FOUR or CAL-PC$'
wrong_version db cr,lf,'Disk Patch Requires CP/M-86 version 2.x$'
eight_inch db cr,lf,'Aborting - not configured for 8" drives$'
single_sided db cr,lf,'Aborting - not configured for single sided drives$'
one_drive db cr,lf,'Aborting - not configured for single drive machine$'
select_error db cr,lf,'Aborting - Unable to access disk parameters$'
mc_type db 02h ; machine type
m4_label db 'Lsi_M4' ; machine label in prom at FFFF:0005
cal_label db 'Cal_PC' ; " " " " " " "
bios_code db 09h ; select drive function
drive dw 00h ; drive code [CX]
dw 00h ; " " [DX]
;---------------------------------------------------------------------
; parameters for Spectravideo SV328 single sided single density format
;---------------------------------------------------------------------
new_dpb dw 022h ; spt
db 03h ; bsh
db 07h ; blm
db 0h ; exm
dw 09ch ; dsm
dw 03fh ; drm
db 0c0h ; al0
db 0h ; al1
dw 010h ; cks
dw 03h ; off
;---------------------------------------------------------------------
; parameters used by the firmware when accessing the disk controller.
; MUST follow on directly after the Disk Parameter Block.
;---------------------------------------------------------------------
flags db 00h ; parameter flags (initially SS DD)
; should be SS SD but won't work if set
db 0ah ; number of retries
db 011h ; physical sectors per track
drvpos db 01h ; right hand drive
db 00h ; ? don't know ?
dw 0290h ; total sectors per disk (only guesswork ?)
dw 0100h ; bytes per sector
db 0 ; just padding !!
;---------------------------------------------------------------------
; END OF DATA SEGMENT
;---------------------------------------------------------------------
end
;---------------------------------------------------------------------
; end of Disk Patch v2.20
;---------------------------------------------------------------------


View File

@@ -0,0 +1,5 @@
**CALBIOS:** Components and source to generate CPM-86/80 for the CAL-PC
**CALDOC** Some notes on the CAL-PC firmware (prom calls etc..)
**CALUTILS** Some disk patching utilities for the CAL-PC