;CFutil0 .TITLE "APPLE /// CF/IDE DRIVE UTILITY Ver 1.25" ;Equates: CODELOAD .EQU 07B00 ;loading address for this interpreter ;Display Message Index #1 Equates MSGWIND .EQU 000 ;Message window TITLE .EQU 001 ;Program title CLRMSG .EQU 002 ;Clear message VIEWPORT .EQU 003 ;Display viewport window VERSION .EQU 004 ;Version number display MENU0 .EQU 005 ;Main Menu ESC0 .EQU 006 ;Escape Message for Main Menu DATE .EQU 007 ;Date Display CLRVPORT .EQU 008 ;Clear viewport screen BORDER .EQU 009 ;Viewport border DRVHEDR .EQU 00A ;drive header display DWINDMSG .EQU 00B ;drive select window NODRIVE .EQU 00C ;no drives message CmpltMsg .EQU 00D ;Complete message CMDLINE .EQU 00E ;command line window DLEADER .EQU 00F ;Display prefix for driver name list ESC2 .EQU 010 ;escape message for drivename select PROMPT0 .EQU 011 ;Lower display window LFMTCMD .EQU 012 ;Lowlevel format command display VRFYCMD .EQU 013 ;Verify drive command display PARTCMD .EQU 014 ;Partition drive command display TESTCMD .EQU 015 ;Test IFC command display LSTDRCMD .EQU 016 ;Select drive command display GASGAUGE .EQU 017 ;Gas gage display PROGBAR .EQU 018 ;Progress bar for gas gage No_LBA .EQU 019 ;No LBA support message BLKBAD2 .EQU 01A ;Trailer for bad block message VFYHLTD .EQU 01B ;Verification Aborted message FMTHLTD .EQU 01C ;Lowlevel Format Aborted message NUMERRS .EQU 01D ;Number of Errors BeepNclr .EQU 01E ;Beep and clear line FWARNING .EQU 01F ;format warning message ESC3 .EQU 020 ;escape message for format routine FMTMSG .EQU 021 ;format message CURSER .EQU 022 ;move curser to x,y location PTBLMSG .EQU 023 ;partition table update prompt UPDATMSG .EQU 024 ;updating drive message UPDATERR .EQU 025 ;error message updating drive CREADATE .EQU 026 ;display created date LMODDATE .EQU 027 ;display modified date TestER00 .EQU 028 ;Diagnostic error $00 message TestER01 .EQU 029 ;Diagnostic error $01 message TestER02 .EQU 02A ;Diagnostic error $02 message TestER03 .EQU 02B ;Diagnostic error $03 message TestER04 .EQU 02C ;Diagnostic error $04 message TestER05 .EQU 02D ;Diagnostic error $05 message TestER8x .EQU 02E ;Diagnostic error $8x message FMTDONE .EQU 02F ;format complete message OCCUR .EQU 030 ;errors occurred message ESC5 .EQU 031 ;escape message to interupt verifying VFYHALT .EQU 032 ;verification halted message BLOCKBAD .EQU 033 ;current verify block is bad message VFYCOMP .EQU 034 ;drive verification complete message TESTLST .EQU 035 ;test IFC list of parameters TESTCOMP .EQU 036 ;diagnostic testing complete message PARTHDR .EQU 037 ;Primary Partition display header PTMENU1 .EQU 038 ;Partition information display = Part 1 BLOCKS .EQU 039 ;blocks trailing message for rem cap ESC6 .EQU 03A ;escape message for partition editor HFMT0MSG .EQU 03B ;format partition prompt message HFMT1MSG .EQU 03C ;format partition default curser DIRERR .EQU 03D ;error formatting vol message HFMTCMP .EQU 03E ;format successfull message PRANYKEY .EQU 03F ;press any key addon message DASH .EQU 040 ;space dash space text DRVNCONT .EQU 041 ;drive not connected message VIEWPOS .EQU 042 ;display viewport with vert positioning PTWARN1 .EQU 043 ;partition change warning msg leader PTWARN2 .EQU 044 ;partition change warning msg trailer PTOVLAP .EQU 045 ;warning about partition overlaps RE_EDIT .EQU 046 ;prompt to re edit partitions ERASMSG1 .EQU 047 ;erase volume message - part 1 ERASMSG2 .EQU 048 ;erase volume message - part 2 ESC6A .EQU 049 ;escape/restore message for part editor COPYRITE .EQU 04A ;copyright notice message FESC6 .EQU 04B ;high level format keystroke message CLRMSGW .EQU 04C ;clear message window ESC1B .EQU 04D ;press any key message SLOTPOS .EQU 04E ;Slot display position leader RBLKS .EQU 04F ;Remaining capacity header SEARCH .EQU 050 ;Scan system message OUTRANG1 .EQU 051 ;Input greater than 32767 - out of range message MAXBLOCK .EQU 052 ;Maximum block value message VRFYMSG .EQU 053 ;Prompt to proceed with drive verification NOFRMAT .EQU 054 ;Low level format not supported ERASEPT1 .EQU 055 ;Initialize new partition prompt PTMENU2 .EQU 056 ;Partition information display - Part 2 ESC4 .EQU 057 ;escape message to interupt formatting CLRPMPT .EQU 058 ;Clear Prompt area & restore previous window settings TCapBlks .EQU 059 ;Total Capacity Display DEVHDR1 .EQU 05A ;Device information display header #1 DEVHDR2 .EQU 05B ;Device information display header #2 DEVHDR3 .EQU 05C ;Device information display header #3 DEVHDR4 .EQU 05D ;Device information display header #4 DEVHDR5 .EQU 05E ;Device information display header #5 DEVHDR6 .EQU 05F ;Device information display header #6 DEVHDR7 .EQU 060 ;Device information display header #7 DEVHDR8 .EQU 061 ;Device information display header #8 Model_nx .EQU 062 ;Device model # ascii Devic_nx .EQU 063 ;Device device # ascii Seria_nx .EQU 064 ;Device serial # ascii FirmW_nx .EQU 065 ;Device firmware version ascii AnsYes .EQU 066 ;Yes message AnsNo .EQU 067 ;No message ClrLower .EQU 068 ;Clear viewport below VTPOS ERASEDRV .EQU 069 ;2nd prompt for lowlevel format PTReadER .EQU 06A ;Error message can't access partition table PTNUPD .EQU 06B ;Partition needs update prior to vol initialization SelPTNum .EQU 06C ;Select Partition number to edit prompt PTSEL .EQU 06D ;Select Partition number display PTnoGood .EQU 06E ;Ascii partition number is no good DWND2MSG .EQU 06F ;partition map drive list window PMAPPOS .EQU 070 ;Pmap/Slot display position leader SEL2CMD .EQU 071 ;Change drive configuration command display PTCHGMSG .EQU 072 ;Select drive to change prompt ReCalMsg .EQU 073 ;Recalculate partition address message EDITDEVN .EQU 074 ;Enter an IDE device number prompt ESC7 .EQU 075 ;Escape message #7 NODEVICE .EQU 076 ;IDE device not found at slot EDITPNUM .EQU 077 ;Enter partition number prompt SAVEDCFG .EQU 078 ;Save new configuration to driver prompt LDRVWND .EQU 079 ;List drivers window ONEASCI .EQU 07A ;One ascii character output ESC8 .EQU 07B ;escape message for initialize partition ERASEPT2 .EQU 07C ;prompt to erase all the partitions on the drive ERASPTDN .EQU 07D ;message erase all the partitions is complete BADDVRV .EQU 07E ;message incorrect driver version RELISTD .EQU 07F ;Save driver configuration to proceed ESC10 .EQU 080 ;escape message for driver configuration selection BWINDPRT .EQU 081 ;Volume name selection viewport border BORDER1 .EQU 082 ;Volume name selection border HELPMSG .EQU 083 ;Volume name selection help message DNHIPRT .EQU 084 ;move down and hilite on DNLFPRT .EQU 085 ;move down and blank arrow DNRTPRT .EQU 086 ;move down and right arrow HIPRT .EQU 087 ;hilite on LFPRT .EQU 088 ;blank arrow STDPRT .EQU 089 ;hilite off RTPRT .EQU 08A ;right arrow UPHIPRT .EQU 08B ;move up and hilite on UPLFPRT .EQU 08C ;move up and blank arrow UPRTPRT .EQU 08D ;move up and right arrow ;Zero Page Pointer Equates ZPGTEMP0 .EQU 000 ZPGTEMP1 .EQU 001 MLPLIER .EQU 002 PRODUCT .EQU 003 ;3 bytes MLPCND .EQU 006 ;3 bytes MENU0SEL .EQU 009 DECPLACE .EQU 00A TEMPVAL .EQU 00B TEMPVAL1 .EQU 00C TEMPVAL2 .EQU 00D TEMPVAL3 .EQU 00E TEMPVAL4 .EQU 00F TEMPVAL5 .EQU 010 TEMPVAL6 .EQU 011 LOCSTAT .EQU 012 BEGTRK .EQU 013 ;3 bytes ENDTRK .EQU 016 ;3 bytes BUFFPG0 .EQU 019 ;2 bytes BUFFPG1 .EQU 01B ;2 bytes STATBUF1 .EQU 01D ;2 bytes STATBUF2 .EQU 01F ;2 bytes SCRBUF .EQU 021 ;2 bytes DNAMEPTR .EQU 023 ;2 bytes INDEX .EQU 025 ;2 bytes PARTTBL .EQU 027 ;2 bytes POSITION .EQU 02A ;2 bytes BPERCTR .EQU 02C ;2 bytes BCTR .EQU 02E ;2 bytes VALSEL .EQU 02E ;2 bytes BUFFCALL .EQU 030 ;2 bytes PartNum .EQU 032 ;PartNum=current partition number $0 to $7 CurVcol .EQU 033 ;CurVcol=current vertical column in table TRK0($0), ;BLEN0($1), or VOL0($2) NUMERROR .EQU 034 TEMPINDX .EQU 034 HALTFLAG .EQU 035 ChgMade .EQU 035 CURDRIVE .EQU 036 STACK .EQU 037 ERRCODE .EQU 038 TOTSECT .EQU 039 ;3 bytes LB,MB,HB Divisor .EQU 03C NUMDNAME .EQU 03D ;2 bytes DevIDpg0 .EQU 03E ;2 bytes IBuffHB .EQU 040 MAXPTBLS .EQU 041 CurPTmap .EQU 042 ;Current partition map PTmapHB .EQU 043 ;HB Sector for current partition map DEVLSTCT .EQU 044 ;unique device count PRT_QUE .EQU 045 PICKINDX .EQU 046 ;2 bytes VOLCOUNT .EQU 048 ;2 bytes PICKBASE .EQU 04A ;2 bytes VOLINDEX .EQU 04C ;2 bytes ;internal program array tables DEV0LIST .EQU 058 ;8 bytes ordered list of unique device index from driver DNUMLST .EQU 060 ;8 bytes SLOTLST .EQU 068 ;8 bytes UNUMLST .EQU 070 ;8 bytes DRVNLST .EQU 078 ;8 bytes PNUMLST .EQU 080 ;8 bytes PTVALID .EQU 088 ;8 bytes EXISTVOL .EQU 090 ;8 bytes DfltSzLB .EQU 098 ;LB default starting partition size P0sizeLB .EQU 099 ;8 bytes LB of partition size DfltSzHB .EQU 0A1 ;HB default starting partition size P0sizeHB .EQU 0A2 ;8 bytes HB of partition size DfltSTlb .EQU 0AA ;Default Starting Block $01 BegBlkLB .EQU 0AB ;8 bytes DfltSTmb .EQU 0B3 ;default starting block for partition BegBlkMB .EQU 0B4 ;8 bytes DfltSThb .EQU 0BC ;default starting block for partition BegBlkHB .EQU 0BD ;8 bytes EndBlkLB .EQU 0C8 ;8 bytes EndBlkMB .EQU 0D0 ;8 bytes EndBlkHB .EQU 0D8 ;8 bytes ;Reference address Equates EXTPG .EQU 1601 EReg .EQU 0FFDF ;enviornment register BANKREG .EQU 0FFEF ; ATA Command Codes ATA_XErr .EQU 003 ATACRead .EQU 020 ATACWrit .EQU 030 ATA_Vrfy .EQU 040 ATA_Frmt .EQU 050 ATA_Diag .EQU 090 ATAIdent .EQU 0EC ;Partition Table Equates PtChkSum .EQU 000 ;Checksum of partition table bytes $01 thru $FF PtSIdx .EQU 010 ;Device serial number (20 ascii characters) PtRevIdx .EQU 024 ;Device firmware revision number (8 ascii characters) PtModIdx .EQU 02C ;Device model information (40 ascii characters) ORIGDATE .EQU 064 ;Date partition was created (8 bytes) MODDATE .EQU 06C ;Date partition was last modified (8 bytes) ;STBLOCK .EQU 0A3,0A8,0B3,0B8,0C3,0C8,0D3,0D8 ;VOLSIZE .EQU 0A6,0AB,0B6,0BB,0C6,0CB,0D6,0DB ;Keystroke Equates LFARROW .EQU 008 TAB .EQU 009 DNARROW .EQU 00A UPARROW .EQU 00B RETURN .EQU 00D RTARROW .EQU 015 ESCAPE .EQU 01B SPACE .EQU 020 Ascii_N .EQU 04E Ascii_Y .EQU 059 OAPL_UP .EQU 08B ;Open Apple - Up Arrow OAPL_QM .EQU 0BF ;Open Apple - Question Mark OAPPLE_F .EQU 0C6 ;Open Apple - F OAPPLE_P .EQU 0D0 ;Open Apple - P OAPPLE_R .EQU 0D2 ;Open Apple - R OAPPLE_S .EQU 0D3 ;Open Apple - S ;Miscellaneous equates FLSHTYPE .EQU 005 ;Console control/status code for screen mode MaxSelNo .EQU 00E ;maximum number of volume name entries displayed ;Partition variable index equates TRK0 .EQU 000 ;Beginning block # for this partition BLEN0 .EQU 001 ;Size of partition in blocks VOL0 .EQU 002 ;Volume name of this partition ;Parameter block specific to current SOS request ATA_Cmd .EQU 000 Sect_HB .EQU 001 Sect_MB .EQU 002 Sect_LB .EQU 003 Num_Blks .EQU 004 ;Device Identification Data Index Equates SerIdx .EQU 014 RevisIdx .EQU 02E ModelIdx .EQU 036 LBAidx .EQU 063 CapacIdx .EQU 072 SerLen .EQU 013 RevisLen .EQU 007 ModelLen .EQU 027 LBAlen .EQU 001 CapacLen .EQU 002 PIO1idx .EQU 06A PIO2idx .EQU 046 PIO3idx .EQU 080 PIO4idx .EQU 067 ;******************* Interpreter Entry and Data Buffers ********************** .ABSOLUTE .PROC SOSNTRP .ORG CODELOAD-14. .ASCII "SOS NTRP" .WORD 0000 .WORD CODELOAD .WORD CODELEN JMP BEGIN ;Data Buffers CHR .BYTE 000 INPUT .BYTE 000 DRIVNUM .BYTE 000 DCFGNUM .BYTE 000 DINFO .BYTE 004 DNUM .BYTE 000 DNAME .WORD DNAMEPTR DINFOLST .WORD SLOTNUM .BYTE 009 SLOTNUM .BYTE 000 UNITNUM .BYTE 000 DEVTYPE .BYTE 0D1 SUBTYPE .BLOCK 004,000 MANUFID .BYTE 04A,044 TIMEDATE .BYTE 001 .WORD YEAR YEAR .BLOCK 004,000 MONTH .WORD 000 DAY .WORD 000 WEEK .BYTE 000 HOUR .WORD 000 MIN .WORD 000 SECOND .BLOCK 005,000 MMONTHS .ASCII "JanFebMarAprMayJunJulAugSepOctNovDec" DATEDISP .BYTE 001,01A,042,001 .ASCII "Jan 31, 2003" .BYTE 004 MODE_ID .BYTE 000 ;$01=device does not support either CFA feature set or LBA mode ;$02=device supports LBA mode and CFA feature set ;$03=device supports LBA mode but doesn't support CFA feature set MULTPCND .BYTE 00A,000,000 ;10 .BYTE 064,000,000 ;100 .BYTE 0E8,003,000 ;1000 .BYTE 010,027,000 ;10000 .BYTE 0A0,086,001 ;100000 .BYTE 040,042,00F ;1000000 LSB,MSB,HSB UNFMTTXT .ASCII "UNFORMATTED" UFTXTLEN .EQU *-UNFMTTXT UNDEFINE .ASCII "UNDEFINED" UNDEFLEN .EQU *-UNDEFINE BLANK01 .ASCII "PARTITIONX" BLTXTLEN .EQU *-BLANK01 BITINDEX .BYTE 0FF,07F,03F,01F,00F,007,003,001 .BYTE 000 DEV_ID .BYTE 0D1,010,04A,044 ;Device ID for CF/Ide driver Status .BYTE 000 ;Device status byte when error occurred Err_Data .BLOCK 005,000 ;Err_Data - byte $0 = error code ; Bit 7 = BBK bad block has been detected ; Bit 6 = UNC uncorrectable error was encountered ; Bit 5 = 0 (undefined) ; Bit 4 = IDNF requested block ID is in error or cannot be found ; Bit 3 = 0 (undefined) ; Bit 2 = ABRT command was aborted or an invalid command ; Bit 1 = 0 (undefined) ; Bit 0 = AMNF general error ;Err_Data - byte $1 thru $3 = block # (LB, MB, & HB) ;Err_Data - byte $4 = # of blocks left to complete command ;SOS Call Blocks CONSOLE .BYTE 008 .ASCII ".CONSOLE" READCON .BYTE 004 CONREF .BYTE 000 .WORD INPUT .WORD 0001 .WORD 000 RELSEG .BYTE 001 RELNUM .BYTE 000 RESCR .BYTE 003 CTRLREF3 .BYTE 000,012 .WORD SCRBUF CLOSLIST .BYTE 001 CLOSREF .BYTE 000 SETFONT1 .BYTE 003 SREF1 .BYTE 000,011 .WORD FONT1 SETFONT2 .BYTE 003 SREF2 .BYTE 000,011 .WORD FONT2 FINDSEG .BYTE 006,000,011 PAGES .WORD 003B ;59 pages of memory required BASE .BLOCK 004,000 SEGNUM .BYTE 000 WRITCHR .BYTE 003 PRTREF1 .BYTE 000 .WORD CHR .WORD 001 WRITINDX .BYTE 003 PRTREF2 .BYTE 000 .WORD INDEX PRTLEN1 .WORD 000 WRITDNAM .BYTE 003 PRTREF3 .BYTE 000 .WORD DNAMEPTR PRTLEN2 .WORD 000 DIBinfo .BYTE 003 SDNUM1 .BYTE 000,004 ;Driver Configuration Bytes .WORD DRIVNUM DevIdent .BYTE 003 SDNUM2 .BYTE 000,001 ;Device Indentification .WORD DevIDpg0 BUFFCTRL .BYTE 003 CALLREF1 .BYTE 000,001 ;Device UserIO Call .WORD BUFFCALL ERRSTAT .BYTE 003 CALLREF2 .BYTE 000,002 ;Device Error Information .WORD Status DFMTCALL .BYTE 003 DFMTREF .BYTE 000,0FE .WORD SCRBUF DEVCALL .BYTE 002 .WORD CONSOLE DEVNUM .BYTE 000 CONSTAT .BYTE 003 STATREF1 .BYTE 000,001 .WORD STATBUF1 RESETCON .BYTE 003 CTRLREF2 .BYTE 000,001 .WORD STATBUF2 CTRLCALL .BYTE 003 CTRLREF1 .BYTE 000 CTRLCODE .BYTE 000 .WORD SCRBUF VPOSCALL .BYTE 003 CTRLREF4 .BYTE 000 .BYTE 010 .WORD SCRBUF ATTNEVNT .BYTE 003 STATREF2 .BYTE 000,006 .WORD ATTNBUFF OPENCON .BYTE 004 .WORD CONSOLE CONREFN .BLOCK 004,000 ATTNBUFF .BYTE 080 ;Priority .BYTE 002 ;Event ID .WORD ESCHDLR ;Event handler address EVHDLRXB .BYTE 000 ;Event handler bank .BYTE 01B ;Attention character - ESCAPE WRITPICK .BYTE 003 PRTREF4 .BYTE 000 .WORD PICKINDX PRTLEN3 .WORD 0010 ;Screen output windows & display messages MWINDOW .BYTE 006,001,01A,04D,014,003,018,001 .BYTE 002 MWINDEND .EQU * CLRMSGS .BYTE 01E,004 CLRMSEND .EQU * PPROMPT0 .BYTE 006,001,01A,000,016,01D PRMP0END .EQU * .BYTE 004 CPMPEND .EQU * CNOTICE .BYTE 006,001,01A,018,001 .ASCII "Copyright 2003-2008 Dale S. Jackson" .BYTE 004 CNOTEND .EQU * DRVHDR .BYTE 001,01A,037,001,01F .ASCII "DRIVE: " DRVHDEND .EQU * DWINDOW0 .BYTE 01A,01E,000 .ASCII " DRIVES ONLINE" .BYTE 01A,016 DWINDULC .BYTE 002,002 .ASCII "Drive Name Slot Device" .BYTE 00A,00D .ASCII "========== ==== ======" .BYTE 00A,00D,002 DWINDEND .EQU * SLOTLDR .BYTE 018,014 SLOTVAL .BYTE 000,018,01A DRVNVAL .BYTE 000 SLDREND .EQU * NODRVS .BYTE 01A,013,007 .ASCII "There are no drivers present in the system" NODRVEND .EQU * DRVLEADR .BYTE 01A,000 DRVPOS .BYTE 000,011 DLDREND .EQU * FMTCOMP .ASCII "Lowlevel Format Complete - " FMTCMEND .EQU * FMTHALTD .ASCII "Lowlevel Format Aborted - " FMTHMEND .EQU * FMTCMP2 .ASCII "Drive Format Complete - " FMTC2END .EQU * BTRKHDR .ASCII "Block " BADSECT .BLOCK 008,020 BTRKTLR .ASCII " is bad" BTRKHEND .EQU * VFYCMPLT .BYTE 00A,00D .ASCII "Drive Media Verification Complete - " VFYCMEND .EQU * NVFYERR .BLOCK 004,000 VFYHALTD .BYTE 00A,00D .ASCII "Drive Media Verification Aborted - " VFYHMEND .EQU * EESC0 .BYTE 01E,018,00D,012 .ASCII "Press:" .BYTE 011,020,08C,020,08B .ASCII " Scroll Up/Down, Letter or RETURN to Select" .BYTE 004 EESC0END .EQU * EESC1B .BYTE 01E,018,018 EESC1A .BYTE 012 .ASCII "Press:" .BYTE 011 .ASCII " ANY KEY to continue" .BYTE 004 EESC1END .EQU * EESC2 .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,08C,020,08B .ASCII " Scroll Up/Down, RETURN to accept, ESCAPE" .ASCII " to exit to Main Menu" .BYTE 004 EESC2END .EQU * EESC3 .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,07F .ASCII "-F to lowlevel format drive, " .BYTE 07F .ASCII "-P to format a partition, ESC to exit" .BYTE 004 EESC3END .EQU * EESC4 .BYTE 01E,018,013,012 .ASCII "Press:" .BYTE 011 .ASCII " ESCAPE to Halt Lowlevel Format" .BYTE 004 EESC4END .EQU * EESC5 .BYTE 01E,018,014,012 .ASCII "Press:" .BYTE 011 .ASCII " ESCAPE to Halt Verification" .BYTE 004 EESC5END .EQU * FEESC6 .BYTE 018,001,07F .ASCII "-R to Sequentially recalculate the partition " .ASCII "start from current to last," .BYTE 00A,018,001,07F .ASCII "-S to Save the partition table, " .BYTE 07F .ASCII "-F to Initialize the partition volume" .BYTE 004 FESC6END .EQU * EESC6 .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,08C,020,08B .ASCII " Scroll Up/Down, RETURN/TAB to select," .ASCII " ESCAPE to exit to Main Menu" .BYTE 004 EESC6END .EQU * EESC6A .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,08C,020,08B .ASCII " Scroll Up/Down, RETURN/TAB to select," .ASCII " ESCAPE to restore entry" .BYTE 004 ESC6AEND .EQU * EESC8 .BYTE 01E,012 .ASCII "Press:" .BYTE 011 .ASCII " RETURN to select/accept, ESCAPE" .ASCII " to exit to Main Menu" .BYTE 004 EESC8END .EQU * EESC10 .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,07F,08C .ASCII " Volume Select, " .BYTE 08B,020,08C .ASCII " - Scroll, RETURN - accept, ESCAPE" .ASCII " - Main Menu" .BYTE 004 ESC10END .EQU * VFYSTOP .BYTE 01E .ASCII "Program Execution Halted " .BYTE 012 .ASCII "Press:" .BYTE 011 .ASCII " SPACE to resume, ESCAPE to abort" VFYSTEND .EQU * ERROCCUR .ASCII " errors occurred" .BYTE 00A,00D OCCUREND .EQU * ERASVOL1 .BYTE 01E,007,012 .ASCII "WARNING:" .BYTE 011 .ASCII " Contents of the volume " ERASEND1 .EQU * PNAME2 .BLOCK 00F,000 ERASVOL2 .ASCII " will be erased" ERASEND2 .EQU * UDATERR .BYTE 007,012 .ASCII "ERROR:" .BYTE 011 .ASCII " writing partition table parameters to drive" UDATEREN .EQU * PTRDERR .BYTE 007,012 .ASCII "ERROR:" .BYTE 011 .ASCII " Unable to access partition table on this drive" PTRDEREN .EQU * CURSEPOS .BYTE 006,01A SCRHPVP .BYTE 000,000,005 CURSEND .EQU * DWINDOW2 .BYTE 01A,01E,000 .ASCII "DRIVERS ONLINE" .BYTE 01A,007 DWND2ULC .BYTE 002,002 .ASCII " IDE Partition Partition/" .BYTE 00A,00D .ASCII " Driver Name Slot Device Table No. Volume Status" .BYTE 00A,00D .ASCII "=============== ==== ==== ==== === ===============" .BYTE 00A,00D,002 DWND2END .EQU * SLOTLDR2 .BYTE 018,014 SLOTVAL4 .BYTE 000,018,01C DRVNVAL2 .BYTE 000,018,023 PMAPVAL .BYTE 000,000,018,02B PNUMVAL .BYTE 000,018,030,01F PMLDREND .EQU * PVOLSTAT .BLOCK 010,020 ;Volume Name or Partition Status ChgPTpmp .ASCII "Select which driver you wish to change the configuration bytes" ChgPTend .EQU * EDITDVN1 .ASCII "Enter an IDE device number (0=master, 1=slave): " DEVNVAL2 .ASCII " " .BYTE 008 Edev1End .EQU * EESC7 .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,08C,020,08B .ASCII " Increment Up/Down, RETURN to select/accept," .ASCII " ESCAPE to Go Back" .BYTE 004 EESC7END .EQU * DEVNOT1 .BYTE 007,01E .ASCII "IDE Device " NOTDEVC1 .ASCII " was not found in Slot " SLOTNOT2 .BYTE 000 DEVN2END .EQU * DEVNOT0 .BYTE 007,01E .ASCII "To add IDE Device #" NOTDEVC2 .ASCII " to Slot #" SLOTNOT3 .ASCII " the driver requires updating to proceed" DEVN0END .EQU * DEVNOT2 .ASCII "Device not Found" DEVNTEND .EQU * EDITPTN1 .ASCII "Enter a partition number (0 thru 7): " PNUMVAL2 .ASCII " " .BYTE 008 EPnm1End .EQU * SAVECFG1 .ASCII "Save configuration changes to driver? " .BYTE 012,059,011 .ASCII "es/No" SAVE1END .EQU * ReCalM1 .ASCII "Recalculate the beginning address of partitions #" TrkValue .ASCII " thru #7? " .BYTE 012,059,011 .ASCII "es/No" ReCalEND .EQU * DRVPORT .BYTE 006,001,01A,04D,013,003,01A,008 DWND3ULC .BYTE 007,002 DRVPREND .EQU * ONECHR .BYTE 006 ASCICHR1 .BYTE 000,008,005 CHR1END .EQU * .INCLUDE CFutil1 .INCLUDE CFutil2 .INCLUDE CFutil3 .INCLUDE CFutil4 .INCLUDE CFutil5 .INCLUDE CFutil6 .END ;CFutil1 ;Main Menu Display MENU0WVP .BYTE 006,001,01A,04D,014,003,01A,001,003,002 .BYTE 01C,01A,01B,005,002 .ASCII "(L) " MENU0S2 .BYTE 01A,004,000,011 LSTCMD .ASCII "List Devices Online" .BYTE 011 LSTCMEND .EQU * MENU0I1 .BYTE 00D,00A .ASCII "(T) " MENU0I2 .BYTE 01A,004,001,011 TTESTCMD .ASCII "Test Interface Card" TTESTEND .EQU *-5 .BYTE 011 MENU0V1 .BYTE 00D,00A .ASCII "(V) " MENU0V2 .BYTE 01A,004,002,011 VVRFYCMD .ASCII "Verify Drive" VVRFYEND .EQU * .BYTE 011 MENU0L1 .BYTE 00D,00A .ASCII "(F) " MENU0L2 .BYTE 01A,004,003,011 LLFMTCMD .ASCII "Format Drive" LLFMTEND .EQU * .BYTE 011 MENU0P1 .BYTE 00D,00A .ASCII "(P) " MENU0P2 .BYTE 01A,004,004,011 PPARTCMD .ASCII "Partition Drive" PPARTEND .EQU * .BYTE 011 MENU0C1 .BYTE 00D,00A .ASCII "(C) " MENU0C2 .BYTE 01A,004,005,011 ChgDCMD .ASCII "Change Driver Configuration" ChgDend .EQU * .BYTE 011 MENU0Q1 .BYTE 00D,00A .ASCII "(Q) " MENU0Q2 .BYTE 01A,004,006,011 .ASCII "Quit" .BYTE 011 MENU0END .EQU * TESTLIST .BYTE 00A .ASCII "INTERNAL DIAGNOSTIC TEST: " TSTLSEND .EQU * TESTDONE .BYTE 00A,00A,018,016 .ASCII "Diagnostic Testing " Cmplete .ASCII "Complete" TESTDEND .EQU * YesAns .ASCII "Yes" YesEnd .EQU * NoAns .ASCII "No" NoEnd .EQU * DiagEr00 .BYTE 007 .ASCII "Master Failed" DERend00 .EQU * DiagEr01 .ASCII "No Error Detected" DERend01 .EQU * DiagEr02 .BYTE 007,012 .ASCII "Formatter Device Error" .BYTE 011 DERend02 .EQU * DiagEr03 .BYTE 007,012 .ASCII "Sector Buffer Error" .BYTE 011 DERend03 .EQU * DiagEr04 .BYTE 007,012 .ASCII "ECC Circuitry Error" .BYTE 011 DERend04 .EQU * DiagEr05 .BYTE 007,012 .ASCII "Controlling Microprocessor Error" .BYTE 011 DERend05 .EQU * DiagEr8x .ASCII "Slave Failed" DERend8x .EQU * FWARN .BYTE 00A,00A,01E,012 .ASCII "WARNING:" .BYTE 011 .ASCII " LowLevel formatting will destroy all data on the drive" FWARNEND .EQU * NOTFMT .BYTE 007,01E,018,00C .ASCII "This device does not support low level formatting" NOFMTEND .EQU * NO_CFG .BYTE 007,01A,007,007 .ASCII "Configuration changes is not supported by the current driver" .BYTE 004 NOCFGEND .EQU * RANG1ERR .BYTE 007 .ASCII "Maximum allowable partition size is 32767" .BYTE 004 RANG1END .EQU * MAXBLK .BYTE 007 .ASCII "Block value cannot exceed partition capacity" .BYTE 004 MXBLKEND .EQU * PPTWARN1 .BYTE 01E .ASCII "Partition #" PPTW1END .EQU * PPTNUM .ASCII " , , , , , , , " PPTWARN2 .ASCII " have changed and the drive needs updating" PPTW2END .EQU * REDITPT .ASCII "Do you wish to edit the conflicting partitions? " .BYTE 012,059,011 .ASCII "es/No" REDITEND .EQU * PTUPD2 .BYTE 007 .ASCII "Partition table on drive needs updating prior" .ASCII " to initializing this volume" PTUPDEND .EQU * PTLAP .BYTE 007,012 .ASCII "WARNING:" .BYTE 011 .ASCII " Partitions #" PTCNFLT1 .BYTE 000 .ASCII " & " PTCNFLT2 .BYTE 000 .ASCII " are overlaying the same region of the disk" .BYTE 004 PTLAPEND .EQU * UDATPTBL .ASCII "Save changes to the drive partition table? " .BYTE 012,059,011 .ASCII "es/No" UDATEND .EQU * UPDATDRV .BYTE 00A,01E,018,009 .ASCII "Updating the partition table information ..... " UPDATEND .EQU * ASKVFRY .ASCII "Verify blocks on the drive listed above? " .BYTE 012,059,011 .ASCII "es/No" ASKVEND .EQU * ORGDATE0 .BYTE 01A,03A,007 ORGDATE1 .BLOCK 008,020 ORGDEND .EQU * NEWDATE0 .BYTE 01A,03A,00B NEWDATE1 .BLOCK 008,020 NEWDEND .EQU * ERASMSG0 .BYTE 01E .ASCII "Initialize a new partition table? " .BYTE 012,059,011 .ASCII "es/No" ERAS0END .EQU * ERASMSG3 .ASCII "OK to destroy the existing contents of this drive? " .BYTE 012,059,011 .ASCII "es/No" ERAS3END .EQU * ERASMSG4 .ASCII "Format all the partitions on this drive? " .BYTE 012,059,011 .ASCII "es/No" ERAS4END .EQU * PTNUM0 .ASCII "Enter a Partition Table Number (0 thru " PTLIMIT .ASCII " ): " PTHoffst .EQU *-PTNUM0 DselPT .BYTE 018,PTHoffst PTVALUE .BYTE 020,020,018 CurHsel .BYTE PTHoffst DselPTen .EQU * BadPTVL .BYTE 007,01E,01A,00B,017 .ASCII "The number entered exceeds the capacity of this drive" BadPTend .EQU * HLMSG0 .ASCII "Initialize this volume with the name " PNAME1 .BLOCK 00F,020 HLMSG1 .ASCII "? " .BYTE 012,059,011 .ASCII "es/No" HLMSGEND .EQU * HFMTCOMP .BYTE 018,013 .ASCII "Volume Initialization Successful" HFMTCEND .EQU * WDIRERR .BYTE 007 .ASCII "Error initializing volume directory" WDIRREND .EQU * DASHTXT .ASCII " - " DASHEND .EQU * ;Program Version Display CMDWIND .BYTE 001,01A,001,001,01E CMDWEND .EQU * VERMSG .ASCII "Version 1.25" ;Written 7/18/08 VEREND .EQU * ;Viewport and Borders INITSCRN .BYTE 006,001,01C,018,018 .ASCII "CF/IDE DRIVE MANAGEMENT UTILITY" INSCREND .EQU * BORDERX .BYTE 01A,04E,016,003,01A,000,002,002 ;Border Top Line .BYTE 080,085,086,084,085,086,084,085 .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,085,086,084,085,086 .BYTE 084,085,086,084,085,086,084,085 .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,085,086,084,085,086 .BYTE 084,085,086,084,085,086,084,085 .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,085,086,084,085,086 .BYTE 084,085,086,084,085,086,081 ;Border Side Lines .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 .BYTE 088,018,04E,087,088,018,04E,087 ;Border Bottom Line .BYTE 082,085,086,084,085,086,084,085 .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,085,086,084,085,086 .BYTE 084,085,086,084,085,086,084,085 .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,085,086,084,085,086 .BYTE 084,085,086,084,085,086,084,085 .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,085,086,084,085,086 .BYTE 084,085,086,084,085,086,083 BDREND .EQU * ;Inner Display Window CLRSCRN .BYTE 006,001,01A,04D,014,003,01A,001 .BYTE 003,002,01C VPORT .BYTE 006,001,01A,04D,013,003,01A,001 .BYTE 003,002 VPORTEND .EQU * INVPORT .BYTE 006,001,01A,04D,011,003,01A,001 .BYTE 003,002 NEWPOS .BYTE 019 VTPOS .BYTE 000 VTEND .EQU * .BYTE 01D NPOSEND .EQU * SRCH .BYTE 01A,014,009 .ASCII "Scanning system for IDE devices" SRCHEND .EQU * DRV0MSTR .ASCII "0 (master)1 (slave) " FMDIALOG .BYTE 018,00E .ASCII "Device Media Formatting.....please standby" .BYTE 004 FMTDEND .EQU * SerialNo .BLOCK 014,020 SERLend .EQU * FirmWare .BLOCK 008,020 FIRMWend .EQU * PPARTHDR .BYTE 01A,01A,000 .ASCII "DRIVE PARTITION MAP #" PTNUMBER .ASCII " " .BYTE 00A,00A,00D .ASCII "MODEL NO: " Model .BLOCK 028,020 MODELend .EQU * .BYTE 00A,00D .ASCII "SLOT: " SlotVal2 .ASCII " DEVICE: " DEVICE .ASCII "0 (master)" DEVNOend .EQU * .BYTE 018,029 .ASCII "PARTITION CAPACITY: " PTHDREND .EQU * TOTCAP .BLOCK 009,020 PPTMENU1 .ASCII " Blocks" .BYTE 01F PBLKEND .EQU * .BYTE 01A,013,005 .ASCII "START SEGMENT" .BYTE 018,038 .ASCII "CREATED DATE" .BYTE 01A,006,006 .ASCII "PARTITION BLOCK LENGTH VOLUME NAME" .BYTE 018,038 .BLOCK 00C,03D .BYTE 01A,006,007 .BLOCK 009,03D .BYTE 018,012 .BLOCK 006,03D .BYTE 018,01B .BLOCK 005,03D .BYTE 018,024 .BLOCK 00F,03D PPTMENU2 .BYTE 01A,009,008 .ASCII "#0:" .BYTE 01A,009,009 .ASCII "#1:" .BYTE 018,038 .ASCII "MODIFIED DATE" .BYTE 01A,009,00A .ASCII "#2:" .BYTE 018,038 .BLOCK 00C,03D .BYTE 01A,009,00B .ASCII "#3:" .BYTE 01A,009,00C .ASCII "#4:" .BYTE 01A,009,00D .ASCII "#5:" .BYTE 018,038 .ASCII "UNUSED CAPACITY" .BYTE 01A,009,00E .ASCII "#6:" .BYTE 018,038 .BLOCK 00F,03D .BYTE 01A,009,00F .ASCII "#7:" PPTMEND .EQU * REMCAP .BYTE 01A,038,00F NREMCAP .BLOCK 008,020 TooLrg .ASCII "> 16777K" DEV1HDR .BYTE 00A,00A,018,01C .ASCII "DEVICE INFORMATION" .BYTE 00A,018,008 .ASCII "SLOT: " SlotVal3 .BYTE 000,00A,018,006 .ASCII "DEVICE: " .BYTE 01F DEV2HDR .BYTE 00A,018,004 .ASCII "MODEL NO: " .BYTE 01F DEV3HDR .BYTE 00A,018,003 .ASCII "SERIAL NO: " .BYTE 01F DEV4HDR .BYTE 00A,018,004 .ASCII "FIRMWARE: " .BYTE 01F DEV5HDR .BYTE 00A,00D .ASCII " LBA SUPPORT: " .BYTE 01F DEV6HDR .BYTE 00A,00D .ASCII " CFA FEATURE: " .BYTE 01F DEV7HDR .BYTE 00A,00D .ASCII "MAX PIO MODE: " PIOmode .BYTE 020 DEV8HDR .BYTE 00A,018,004 .ASCII "CAPACITY: " DEV8END .EQU * LBA_NO .BYTE 012 .ASCII "Warning" .BYTE 011 .ASCII " - LBA mode not supported" LBAnoEnd .EQU * GASGAGE .BYTE 001,01A,005,012 .ASCII " 0% Complete " .BYTE 089,08A,089,08A,089,08A,089,08A .BYTE 089,08A,089,08A,089,08A,089,08A ;50 chrs long .BYTE 089,08A,089,08A,089,08A,089,08A .BYTE 089,08A,089,08A,089,08A,089,08A .BYTE 089,08A,089,08A,089,08A,089,08A .BYTE 089,08A,089,08A,089,08A,089,08A .BYTE 089,08A .BYTE 004 GASGAEND .EQU * PROGRESS .BYTE 001,01A,005,012 PCENT .BYTE 020,020,030,018 GAS_HPOS .BYTE 013,012,020,011,004 PROGREND .EQU * ;Volume name selection string variables BWINDOW .BYTE 001,01A,04B ;Border Window .BYTE 013,003,01A,038,003,002 BWINDEND .EQU * BORDERY .BYTE 01C,080,085,086,084,085,086,084 ;Border Top Line .BYTE 085,086,084,085,086,084,085,086 ;Width=20 chr wide .BYTE 084,085,086,084,081 .BYTE 088,018,013,087,088,018,013,087 ;Border Side Line .BYTE 088,018,013,087,088,018,013,087 ;Maximum of 14 rows .BYTE 088,018,013,087,088,018,013,087 .BYTE 088,018,013,087,088,018,013,087 .BYTE 088,018,013,087,088,018,013,087 .BYTE 088,018,013,087,088,018,013,087 .BYTE 088,018,013,087,088,018,013,087 .BYTE 082,085,086,084,085,086,084,085 ;Border Bot Line .BYTE 086,084,085,086,084,085,086,084 .BYTE 085,086,084,083,01A,012 .BYTE MaxSelNo,003,01A,001,001,002 BDRBTEND .EQU * EESC9 .BYTE 01E,012 .ASCII "Press:" .BYTE 011,020,08C .ASCII " Up " .BYTE 08B .ASCII " Down,--> Select,<-- Unselect, RETURN Accepts," .ASCII " ESCAPE Cancels" .BYTE 004 EESC9END .EQU * DNRTARW .BYTE 011,00A,00D .ASCII "-->" DNRTEND .EQU * RTARW .BYTE 011,00D .ASCII "-->" RTARWEND .EQU * UPRTARW .BYTE 011,00B,00D .ASCII "-->" UPRTEND .EQU * DNLFARW .BYTE 011,00A,00D .ASCII " " DNLFEND .EQU * LFARW .BYTE 011,00D .ASCII " " LFARWEND .EQU * UPLFARW .BYTE 011,00B,00D .ASCII " " UPLFEND .EQU * DNHILITE .BYTE 00A,018,003,012 DNHILEND .EQU * HILITE .BYTE 018,003,012 HILITEND .EQU * UPHILITE .BYTE 00B,018,003,012 UPHILEND .EQU * NOLITE .BYTE 011,018,003 NOLITEND .EQU * ;End of Screen Messages ;File Call Error Descriptions ERRDESC .ASCII "SOS/Device Error $" GENERR .WORD 000 .ASCII " has occurred" ENDERR00 .EQU * ;Device Call Error Descriptions DNFERR .ASCII "Device not Found" ENDERR10 .EQU * BADCTL .ASCII "Invalid status/control code" ENDERR21 .EQU * BADCTLPM .ASCII "Invalid control parameter list" ENDERR22 .EQU * NORESRC .ASCII "Resource not available" ENDERR25 .EQU * BADOP .ASCII "Call not supported by device" ENDERR26 .EQU * IOERR .ASCII "I/O error" ENDERR27 .EQU * DRNOTCON .ASCII "Drive not connected" ENDERR28 .EQU * XBCNTERR .ASCII "Incomplete Data Transfer" ENDERR30 .EQU * XDCMDERR .ASCII "Features Not Set - Command ABORTED" ENDERR31 .EQU * XCKDEVER .ASCII "Device Not Ready" ENDERR32 .EQU * XNORESET .ASCII "Device Reset Failed" ENDERR33 .EQU * ;Memory Call Error Descriptions SEGRQDN .ASCII "Segment request denied" ENDERRE1 .EQU * SEGTBLFL .ASCII "Segment table full" ENDERRE2 .EQU * ;Device Specific Errors ;Err_Data - byte $0 = error code ; Bit 7 = BBK bad block has been detected ; Bit 6 = UNC uncorrectable error was encountered ; Bit 5 = 0 (undefined) ; Bit 4 = IDNF requested block ID is in error or cannot be found ; Bit 3 = 0 (undefined) ; Bit 2 = ABRT command was aborted or an invalid command ; Bit 1 = 0 (undefined) ; Bit 0 = AMNF general error ;Err_Data - byte $1 thru $3 = block # (LB, MB, & HB) ;Err_Data - byte $4 = # of blocks left to complete command UNCerr .ASCII "Uncorrectable I/O error has occurred" UNCend .EQU * IDNFerr .ASCII "Invalid block number or block cannot be found" IDNFend .EQU * ABRTerr .ASCII "Invalid Command" ABRTend .EQU * AMNFerr .ASCII "General device error" AMNFend .EQU * ;CF Extended Error Descriptions ;Extended Error Code Request ; Returns 1 byte of extended error code in Buffer ; $00 = No Error Detected ; $01 = Self test OK (No error) ; $09 = Miscellaneous Error ; $20 = Invalid Command ; $21 = Invalid address (requested head or sector invalid) ; $2F = Address Overflow (address too large) ; $35,$36 = Supply voltage out of tolerance ; $11 = Uncorrectable ECC error ; $18 = Corrected ECC Error ; $05,$30-34,$37,$3E = Self test or diagnostic failed ; $10,$14 = ID not found ; $3A = Spare sectors exhausted ; $1F = Data transfer error/Aborted command ; $0C,$38,$3B,$3C,$3F = Corrupted Media Format ; $03 = Write/Erase failed Xerr01 .ASCII "Self test OK" Xer01end .EQU * Xerr02 .ASCII "Miscellaneous Error" Xer02end .EQU * Xerr03 .ASCII "Invalid Command" Xer03end .EQU * Xerr04 .ASCII "Invalid head or sector invalid" Xer04end .EQU * Xerr05 .ASCII "Address Overflow" Xer05end .EQU * Xerr06 .ASCII "Supply voltage out of tolerance" Xer06end .EQU * Xerr07 .ASCII "Uncorrectable ECC error" Xer07end .EQU * Xerr08 .ASCII "Corrected ECC Error" Xer08end .EQU * Xerr09 .ASCII "Self test failed" Xer09end .EQU * Xerr10 .ASCII "ID not found" Xer10end .EQU * Xerr11 .ASCII "Spare sectors exhausted" Xer11end .EQU * Xerr12 .ASCII "Data transfer error/Aborted command" Xer12end .EQU * Xerr13 .ASCII "Corrupted Media Format" Xer13end .EQU * Xerr14 .ASCII "Write/Erase failed" Xer14end .EQU * ;Screen Display Pointers & Lengths PVOLADR .WORD PVOLSTAT-5. MSGADR .WORD MWINDOW ;MSGWIND .WORD INITSCRN ;TITLE .WORD CLRMSGS ;CLRMSG .WORD VPORT ;VIEWPORT .WORD VERMSG ;VERSION .WORD MENU0WVP ;MENU0 .WORD EESC0 ;ESC0 .WORD DATEDISP ;DATE .WORD CLRSCRN ;CLRVPORT .WORD BORDERX ;BORDER .WORD DRVHDR ;DRVHEDR .WORD DWINDOW0 ;DWINDMSG .WORD NODRVS ;NODRIVE .WORD Cmplete ;CmpltMsg .WORD CMDWIND ;CMDLINE .WORD DRVLEADR ;DLEADER .WORD EESC2 ;ESC2 .WORD PPROMPT0 ;PROMPT0 .WORD LLFMTCMD ;LFMTCMD .WORD VVRFYCMD ;VRFYCMD .WORD PPARTCMD ;PARTCMD .WORD TTESTCMD ;TESTCMD .WORD LSTCMD ;LSTDRCMD .WORD GASGAGE ;GASGAUGE .WORD PROGRESS ;PROGBAR .WORD LBA_NO ;NO_LBA .WORD BTRKTLR ;BLKBAD2 .WORD VFYHALTD ;VFYHLTD .WORD FMTHALTD ;FMTHLTD .WORD NVFYERR ;NUMERRS .WORD ERASVOL1 ;BeepNclr .WORD FWARN ;FWARNING .WORD EESC3 ;ESC3 .WORD FMDIALOG ;FMTMSG .WORD CURSEPOS ;CURSER .WORD UDATPTBL ;PTBLMSG .WORD UPDATDRV ;UPDATMSG .WORD UDATERR ;UPDATERR .WORD ORGDATE0 ;CREADATE .WORD NEWDATE0 ;LMODDATE .WORD DiagEr00 ;TestER00 .WORD DiagEr01 ;TestER01 .WORD DiagEr02 ;TestER02 .WORD DiagEr03 ;TestER03 .WORD DiagEr04 ;TestER04 .WORD DiagEr05 ;TestER05 .WORD DiagEr8x ;TestER8x .WORD FMTCOMP ;FMTDONE .WORD ERROCCUR ;OCCUR .WORD EESC5 ;ESC5 .WORD VFYSTOP ;VFYHALT .WORD BTRKHDR ;BLOCKBAD .WORD VFYCMPLT ;VFYCOMP .WORD TESTLIST ;TESTLST .WORD TESTDONE ;TESTCOMP .WORD PPARTHDR ;PARTHDR .WORD PPTMENU1 ;PTMENU1 .WORD PPTMENU1 ;BLOCKS .WORD EESC6 ;ESC6 .WORD HLMSG0 ;HFMT0MSG .WORD HLMSG1 ;HFMT1MSG .WORD WDIRERR ;DIRERR .WORD HFMTCOMP ;HFMTCMP .WORD EESC1A ;PRANYKEY .WORD DASHTXT ;DASH .WORD DRNOTCON ;DRVNCONT .WORD INVPORT ;VIEWPOS .WORD PPTWARN1 ;PTWARN1 .WORD PPTWARN2 ;PTWARN2 .WORD PTLAP ;PTOVLAP .WORD REDITPT ;RE_EDIT .WORD ERASVOL1 ;ERASMSG1 .WORD ERASVOL2 ;ERASMSG2 .WORD EESC6A ;ESC6A .WORD CNOTICE ;COPYRITE .WORD FEESC6 ;FESC6 .WORD MWINDOW ;CLRMSGW .WORD EESC1B ;ESC1B .WORD SLOTLDR ;SLOTPOS .WORD REMCAP ;RBLKS .WORD SRCH ;SEARCH .WORD RANG1ERR ;OUTRANG1 .WORD MAXBLK ;MAXBLOCK .WORD ASKVFRY ;VRFYMSG .WORD NOTFMT ;NOFRMAT .WORD ERASMSG0 ;ERASEPT1 .WORD PPTMENU2 ;PTMENU2 .WORD EESC4 ;ESC4 .WORD PPROMPT0 ;CLRPMPT .WORD TOTCAP ;TCapBlks .WORD DEV1HDR ;DEVHDR1 .WORD DEV2HDR ;DEVHDR2 .WORD DEV3HDR ;DEVHDR3 .WORD DEV4HDR ;DEVHDR4 .WORD DEV5HDR ;DEVHDR5 .WORD DEV6HDR ;DEVHDR6 .WORD DEV7HDR ;DEVHDR7 .WORD DEV8HDR ;DEVHDR8 .WORD Model ;Model_nx .WORD Device ;Devic_nx .WORD SerialNo ;Seria_nx .WORD FirmWare ;FirmW_nx .WORD YesAns ;AnsYes .WORD NoAns ;AnsNo .WORD NEWPOS ;ClrLower .WORD ERASMSG3 ;ERASEDRV .WORD PTRDERR ;PTReadER .WORD PTUPD2 ;PTNUPD .WORD PTNUM0 ;SelPTNum .WORD DselPT ;PTSEL .WORD BadPTVL ;PTnoGood .WORD DWINDOW2 ;DWND2MSG .WORD SLOTLDR2 ;PMAPPOS .WORD ChgDCMD ;SEL2CMD .WORD ChgPTpmp ;PTCHGMSG .WORD ReCalM1 ;ReCalMsg .WORD EDITDVN1 ;EDITDEVN .WORD EESC7 ;ESC7 .WORD DEVNOT1 ;NODEVICE .WORD EDITPTN1 ;EDITPNUM .WORD SAVECFG1 ;SAVEDCFG .WORD DRVPORT ;LDRVWND .WORD ONECHR ;ONEASCI .WORD EESC8 ;ESC8 .WORD ERASMSG4 ;ERASEPT2 .WORD FMTCMP2 ;ERASPTDN .WORD NO_CFG ;BADDVRV .WORD DEVNOT0 ;RELISTD MSGADR2 .WORD EESC10 ;ESC10 .WORD BWINDOW ;BWINDPRT .WORD BORDERY ;BORDER1 .WORD EESC9 ;HELPMSG .WORD DNHILITE ;DNHIPRT .WORD DNLFARW ;DNLFPRT .WORD DNRTARW ;DNRTPRT .WORD HILITE ;HIPRT .WORD LFARW ;LFPRT .WORD NOLITE ;STDPRT .WORD RTARW ;RTPRT .WORD UPHILITE ;UPHIPRT .WORD UPLFARW ;UPLFPRT .WORD UPRTARW ;UPRTPRT MSGLEN .BYTE MWINDEND-MWINDOW ;MSGWIND .BYTE INSCREND-INITSCRN ;TITLE .BYTE CLRMSEND-CLRMSGS ;CLRMSG .BYTE VPORTEND-VPORT ;VIEWPORT .BYTE VEREND-VERMSG ;VERSION .BYTE MENU0END-MENU0WVP ;MENU0 .BYTE EESC0END-EESC0 ;ESC0 DATELEN .BYTE 000 ;DATE .BYTE VPORTEND-CLRSCRN ;CLRVPORT .BYTE BDREND-BORDERX ;BORDER .BYTE DRVHDEND-DRVHDR ;DRVHEDR .BYTE DWINDEND-DWINDOW0 ;DWINDMSG .BYTE NODRVEND-NODRVS ;NODRIVE .BYTE TESTDEND-Cmplete ;CmpltMsg .BYTE CMDWEND-CMDWIND ;CMDLINE .BYTE DLDREND-DRVLEADR ;DLEADER .BYTE EESC2END-EESC2 ;ESC2 .BYTE PRMP0END-PPROMPT0 ;PROMPT0 .BYTE LLFMTEND-LLFMTCMD ;LFMTCMD .BYTE VVRFYEND-VVRFYCMD ;VRFYCMD .BYTE PPARTEND-PPARTCMD ;PARTCMD .BYTE TTESTEND-TTESTCMD ;TESTCMD .BYTE LSTCMEND-LSTCMD ;LSTDRCMD .BYTE GASGAEND-GASGAGE ;GASGAUGE .BYTE PROGREND-PROGRESS ;PROGBAR .BYTE LBAnoEnd-LBA_NO ;NO_LBA .BYTE BTRKHEND-BTRKTLR ;BLKBAD2 .BYTE VFYHMEND-VFYHALTD ;VFYHLTD .BYTE FMTHMEND-FMTHALTD ;FMTHLTD ;CFutil2 NUMVLEN .BYTE 000 ;NUMERRS .BYTE 002 ;BeepNclr .BYTE FWARNEND-FWARN ;FWARNING .BYTE EESC3END-EESC3 ;ESC3 .BYTE FMTDEND-FMDIALOG ;FMTMSG .BYTE CURSEND-CURSEPOS ;CURSER .BYTE UDATEND-UDATPTBL ;PTBLMSG .BYTE UPDATEND-UPDATDRV ;UPDATMSG .BYTE UDATEREN-UDATERR ;UPDATERR .BYTE ORGDEND-ORGDATE0 ;CREADATE .BYTE NEWDEND-NEWDATE0 ;LMODDATE .BYTE DERend00-DiagEr00 ;TestER00 .BYTE DERend01-DiagEr01 ;TestER01 .BYTE DERend02-DiagEr02 ;TestER02 .BYTE DERend03-DiagEr03 ;TestER03 .BYTE DERend04-DiagEr04 ;TestER04 .BYTE DERend05-DiagEr05 ;TestER05 .BYTE DERend8x-DiagEr8x ;TestER8x .BYTE FMTCMEND-FMTCOMP ;FMTDONE .BYTE OCCUREND-ERROCCUR ;OCCUR .BYTE EESC5END-EESC5 ;ESC5 .BYTE VFYSTEND-VFYSTOP ;VFYHALT .BYTE BADSECT-BTRKHDR ;BLOCKBAD .BYTE VFYCMEND-VFYCMPLT ;VFYCOMP .BYTE TSTLSEND-TESTLIST ;TESTLST .BYTE TESTDEND-TESTDONE ;TESTCOMP .BYTE PTHDREND-PPARTHDR ;PARTHDR .BYTE PPTMENU2-PPTMENU1 ;PTMENU1 .BYTE PBLKEND-PPTMENU1 ;BLOCKS .BYTE EESC6END-EESC6 ;ESC6 .BYTE PNAME1-HLMSG0 ;HFMT0MSG .BYTE HLMSGEND-HLMSG1 ;HFMT1MSG .BYTE WDIRREND-WDIRERR ;DIRERR .BYTE HFMTCEND-HFMTCOMP ;HFMTCMP .BYTE EESC1END-EESC1A ;PRANYKEY .BYTE DASHEND-DASHTXT ;DASH .BYTE ENDERR28-DRNOTCON ;DRVNCONT .BYTE VTEND-INVPORT ;VIEWPOS .BYTE PPTW1END-PPTWARN1 ;PTWARN1 .BYTE PPTW2END-PPTWARN2 ;PTWARN2 .BYTE PTLAPEND-PTLAP ;PTOVLAP .BYTE REDITEND-REDITPT ;RE_EDIT .BYTE ERASEND1-ERASVOL1 ;ERASMSG1 .BYTE ERASEND2-ERASVOL2 ;ERASMSG2 .BYTE ESC6AEND-EESC6A ;ESC6A .BYTE CNOTEND-CNOTICE ;COPYRITE .BYTE FESC6END-FEESC6 ;FESC6 .BYTE CLRMSEND-MWINDOW ;CLRMSGW .BYTE EESC1END-EESC1B ;ESC1B .BYTE SLDREND-SLOTLDR ;SLOTPOS .BYTE NREMCAP-REMCAP ;RBLKS .BYTE SRCHEND-SRCH ;SEARCH .BYTE RANG1END-RANG1ERR ;OUTRANG1 .BYTE MXBLKEND-MAXBLK ;MAXBLOCK .BYTE ASKVEND-ASKVFRY ;VFRYMSG .BYTE NOFMTEND-NOTFMT ;NOFRMAT .BYTE ERAS0END-ERASMSG0 ;ERASEPT1 .BYTE PPTMEND-PPTMENU2 ;PTMENU2 .BYTE EESC4END-EESC4 ;ESC4 .BYTE CPMPEND-PPROMPT0 ;CLRPMPT TCAPLEN .BYTE 000 ;TCapBlks .BYTE DEV2HDR-DEV1HDR ;DEVHDR1 .BYTE DEV3HDR-DEV2HDR ;DEVHDR2 .BYTE DEV4HDR-DEV3HDR ;DEVHDR3 .BYTE DEV5HDR-DEV4HDR ;DEVHDR4 .BYTE DEV6HDR-DEV5HDR ;DEVHDR5 .BYTE DEV7HDR-DEV6HDR ;DEVHDR6 .BYTE DEV8HDR-DEV7HDR ;DEVHDR7 .BYTE DEV8END-DEV8HDR ;DEVHDR8 MOD_Len .BYTE MODELend-Model ;Model_nx .BYTE DEVNOend-Device ;Devic_nx SN_Len .BYTE SERLend-SerialNo ;Seria_nx FW_Len .BYTE FIRMWend-FirmWare ;FirmW_nx .BYTE YesEnd-YesAns ;AnsYes .BYTE NoEnd-NoAns ;AnsNo .BYTE NPOSEND-NEWPOS ;ClrLower .BYTE ERAS3END-ERASMSG3 ;ERASEDRV .BYTE PTRDEREN-PTRDERR ;PTReadER .BYTE PTUPDEND-PTUPD2 ;PTNUPD .BYTE DselPTen-PTNUM0 ;SelPTNum .BYTE DselPTen-DselPT ;PTSEL .BYTE BadPTend-BadPTVL ;PTnoGood .BYTE DWND2END-DWINDOW2 ;DWND2MSG CfgVLen .BYTE PMLDREND-SLOTLDR2 ;PMAPPOS .BYTE ChgDend-ChgDCMD ;SEL2CMD .BYTE ChgPTend-ChgPTpmp ;PTCHGMSG .BYTE ReCalEND-ReCalM1 ;ReCalMsg .BYTE Edev1End-EDITDVN1 ;EDITDEVN .BYTE EESC7END-EESC7 ;ESC7 .BYTE DEVN2END-DEVNOT1 ;NODEVICE .BYTE EPnm1End-EDITPTN1 ;EDITPNUM .BYTE SAVE1END-SAVECFG1 ;SAVEDCFG .BYTE DRVPREND-DRVPORT ;LDRVWND .BYTE CHR1END-ONECHR ;ONEASCI .BYTE EESC8END-EESC8 ;ESC8 .BYTE ERAS4END-ERASMSG4 ;ERASEPT2 .BYTE FMTC2END-FMTCMP2 ;ERASPTDN .BYTE NOCFGEND-NO_CFG ;BADDVRV .BYTE DEVN0END-DEVNOT0 ;RELISTD .BYTE ESC10END-EESC10 ;ESC10 .BYTE BWINDEND-BWINDOW ;BWINDPRT .BYTE BDRBTEND-BORDERY ;BORDER1 .BYTE EESC9END-EESC9 ;HELPMSG .BYTE DNHILEND-DNHILITE ;DNHIPRT .BYTE DNLFEND-DNLFARW ;DNLFPRT .BYTE DNRTEND-DNRTARW ;DNRTPRT .BYTE HILITEND-HILITE ;HIPRT .BYTE LFARWEND-LFARW ;LFPRT .BYTE NOLITEND-NOLITE ;STDPRT .BYTE RTARWEND-RTARW ;RTPRT .BYTE UPHILEND-UPHILITE ;UPHIPRT .BYTE UPLFEND-UPLFARW ;UPLFPRT .BYTE UPRTEND-UPRTARW ;UPRTPRT ;Main Menu Pointers & Lengths MENU0LST .ASCII "LTVFPCQ" MenuItms .EQU *-MENU0LST MENU0ADR .WORD MENU0S2 .WORD MENU0I2 .WORD MENU0V2 .WORD MENU0L2 .WORD MENU0P2 .WORD MENU0C2 .WORD MENU0Q2 MENU0LEN .BYTE MENU0I1-MENU0S2 .BYTE MENU0V1-MENU0I2 .BYTE MENU0L1-MENU0V2 .BYTE MENU0P1-MENU0L2 .BYTE MENU0C1-MENU0P2 .BYTE MENU0Q1-MENU0C2 .BYTE MENU0END-MENU0Q2 FUNCADR .WORD LSTDRV-1 .WORD TESTIFC-1 .WORD VERIFY-1 .WORD FORMAT-1 .WORD PARTITIO-1 .WORD CHGCONFG-1 .WORD QUIT-1 ;Partition Display Variables COL_HPOS .BYTE 012 .BYTE 01C .BYTE 024 ITEM_LEN .BYTE 006 ;Starting Block .BYTE 005 ;Partition Length .BYTE 00F ;Volume Name TRACK0 .BYTE 01A,012,008 TRKVAL0 .BLOCK 007,000 TRKLEN .EQU *-1-TRACK0 TRACK1 .BYTE 01A,012,009 TRKVAL1 .BLOCK 007,000 TRACK2 .BYTE 01A,012,00A TRKVAL2 .BLOCK 007,000 TRACK3 .BYTE 01A,012,00B TRKVAL3 .BLOCK 007,000 TRACK4 .BYTE 01A,012,00C TRKVAL4 .BLOCK 007,000 TRACK5 .BYTE 01A,012,00D TRKVAL5 .BLOCK 007,000 TRACK6 .BYTE 01A,012,00E TRKVAL6 .BLOCK 007,000 TRACK7 .BYTE 01A,012,00F TRKVAL7 .BLOCK 007,000 BLKLEN0 .BYTE 01A,01C,008 BLENVAL0 .BLOCK 006,000 BLOCKLEN .EQU *-1-BLKLEN0 BLKLEN1 .BYTE 01A,01C,009 BLENVAL1 .BLOCK 006,000 BLKLEN2 .BYTE 01A,01C,00A BLENVAL2 .BLOCK 006,000 BLKLEN3 .BYTE 01A,01C,00B BLENVAL3 .BLOCK 006,000 BLKLEN4 .BYTE 01A,01C,00C BLENVAL4 .BLOCK 006,000 BLKLEN5 .BYTE 01A,01C,00D BLENVAL5 .BLOCK 006,000 BLKLEN6 .BYTE 01A,01C,00E BLENVAL6 .BLOCK 006,000 BLKLEN7 .BYTE 01A,01C,00F BLENVAL7 .BLOCK 006,000 VOLNAME0 .BYTE 01A,024,008 VNAME0 .BLOCK 010,020 VOLNLEN .EQU *-1-VOLNAME0 VOLNAME1 .BYTE 01A,024,009 VNAME1 .BLOCK 010,020 VOLNAME2 .BYTE 01A,024,00A VNAME2 .BLOCK 010,020 VOLNAME3 .BYTE 01A,024,00B VNAME3 .BLOCK 010,020 VOLNAME4 .BYTE 01A,024,00C VNAME4 .BLOCK 010,020 VOLNAME5 .BYTE 01A,024,00D VNAME5 .BLOCK 010,020 VOLNAME6 .BYTE 01A,024,00E VNAME6 .BLOCK 010,020 VOLNAME7 .BYTE 01A,024,00F VNAME7 .BLOCK 010,020 TRKADR .WORD TRKVAL0 .WORD TRKVAL1 .WORD TRKVAL2 .WORD TRKVAL3 .WORD TRKVAL4 .WORD TRKVAL5 .WORD TRKVAL6 .WORD TRKVAL7 BLENADR .WORD BLENVAL0 .WORD BLENVAL1 .WORD BLENVAL2 .WORD BLENVAL3 .WORD BLENVAL4 .WORD BLENVAL5 .WORD BLENVAL6 .WORD BLENVAL7 PNAMEADR .WORD VNAME0 .WORD VNAME1 .WORD VNAME2 .WORD VNAME3 .WORD VNAME4 .WORD VNAME5 .WORD VNAME6 .WORD VNAME7 VOLADR .WORD VNAME0-5 .WORD VNAME1-5 .WORD VNAME2-5 .WORD VNAME3-5 .WORD VNAME4-5 .WORD VNAME5-5 .WORD VNAME6-5 .WORD VNAME7-5 ;Partition table indexes for starting block & partition length STBindex .BYTE 0A3,0A8,0B3,0B8,0C3,0C8,0D3,0D8 VSZindex .BYTE 0A6,0AB,0B6,0BB,0C6,0CB,0D6,0DB PMSGADR .WORD TRACK0 ;#TRK0 .WORD TRACK1 .WORD TRACK2 .WORD TRACK3 .WORD TRACK4 .WORD TRACK5 .WORD TRACK6 .WORD TRACK7 .WORD BLKLEN0 ;#BLEN0 .WORD BLKLEN1 .WORD BLKLEN2 .WORD BLKLEN3 .WORD BLKLEN4 .WORD BLKLEN5 .WORD BLKLEN6 .WORD BLKLEN7 .WORD VOLNAME0 ;#VOL0 .WORD VOLNAME1 .WORD VOLNAME2 .WORD VOLNAME3 .WORD VOLNAME4 .WORD VOLNAME5 .WORD VOLNAME6 .WORD VOLNAME7 ;Misc Variables Address List VFYERADR .WORD NVFYERR PTHDRADR .WORD TOTCAP PTLRADR .WORD NREMCAP BSECTADR .WORD BADSECT ;General SOS Call Error Description Address ERMSGADR .WORD ERRDESC ;Device Call Error Description Address .WORD DNFERR .WORD BADCTL .WORD BADCTLPM .WORD NORESRC .WORD BADOP .WORD IOERR .WORD DRNOTCON .WORD XBCNTERR .WORD XDCMDERR .WORD XCKDEVER .WORD XNORESET ;Memory Call Error Description Address .WORD SEGRQDN .WORD SEGTBLFL ;Device Specific Errors .WORD AMNFerr ;$00 .WORD Xerr01 ;CF Extended Error $01 Description Address .WORD ABRTerr ;$04 .WORD Xerr02 ;CF Extended Error $09 Description Address .WORD IDNFerr ;$10 .WORD Xerr03 ;CF Extended Error $20 Description Address .WORD UNCerr ;$40 ;CF Extended Error Description Address .WORD Xerr04 .WORD Xerr05 .WORD Xerr06 .WORD Xerr07 .WORD Xerr08 .WORD Xerr09 .WORD Xerr10 .WORD Xerr11 .WORD Xerr12 .WORD Xerr13 .WORD Xerr14 ;General SOS Call Error Description Len ERMSGLEN .BYTE ENDERR00-ERRDESC ;Device Call Error Description Len .BYTE ENDERR10-DNFERR .BYTE ENDERR21-BADCTL .BYTE ENDERR22-BADCTLPM .BYTE ENDERR25-NORESRC .BYTE ENDERR26-BADOP .BYTE ENDERR27-IOERR .BYTE ENDERR28-DRNOTCON .BYTE ENDERR30-XBCNTERR .BYTE ENDERR31-XDCMDERR .BYTE ENDERR32-XCKDEVER .BYTE ENDERR33-XNORESET ;Memory Call Error Description Len .BYTE ENDERRE1-SEGRQDN .BYTE ENDERRE2-SEGTBLFL ;Device Specific Errors .BYTE AMNFend-AMNFerr CFext01 .BYTE Xer01end-Xerr01 ;CF Extended Error $01 Description Len .BYTE ABRTend-ABRTerr CFext02 .BYTE Xer02end-Xerr02 ;CF Extended Error $09 Description Len .BYTE IDNFend-IDNFerr CFext03 .BYTE Xer03end-Xerr03 ;CF Extended Error $20 Description Len .BYTE UNCend-UNCerr ;CF Extended Error Description Len CFext04 .BYTE Xer04end-Xerr04 CFext05 .BYTE Xer05end-Xerr05 CFext06 .BYTE Xer06end-Xerr06 CFext07 .BYTE Xer07end-Xerr07 CFext08 .BYTE Xer08end-Xerr08 CFext09 .BYTE Xer09end-Xerr09 CFext10 .BYTE Xer10end-Xerr10 CFext11 .BYTE Xer11end-Xerr11 CFext12 .BYTE Xer12end-Xerr12 CFext13 .BYTE Xer13end-Xerr13 CFext14 .BYTE Xer14end-Xerr14 ;General SOS Call Error Codes SOSERR .BYTE 000 ;Device Call Error Codes .BYTE 010,021,022,025,026,027,028,030 .BYTE 031,032,033 ;Memory Call Error Codes .BYTE 0E1,0E2 SERRLEN .EQU *-SOSERR ;CF Extended Error Codes & index XerrCode .BYTE 001,009,020,021,02F,035,036,011 .BYTE 018,005,030,031,032,033,034,037 .BYTE 03E,010,014,03A,01F,00C,038,03B .BYTE 03C,03F,003 XerrIndx .BYTE CFext01-ERMSGLEN .BYTE CFext02-ERMSGLEN .BYTE CFext03-ERMSGLEN .BYTE CFext04-ERMSGLEN .BYTE CFext05-ERMSGLEN .BYTE CFext06-ERMSGLEN .BYTE CFext06-ERMSGLEN .BYTE CFext07-ERMSGLEN .BYTE CFext08-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext09-ERMSGLEN .BYTE CFext10-ERMSGLEN .BYTE CFext10-ERMSGLEN .BYTE CFext11-ERMSGLEN .BYTE CFext12-ERMSGLEN .BYTE CFext13-ERMSGLEN .BYTE CFext13-ERMSGLEN .BYTE CFext13-ERMSGLEN .BYTE CFext13-ERMSGLEN .BYTE CFext13-ERMSGLEN .BYTE CFext14-ERMSGLEN ;FONT CODE FONT1 .BYTE 008 .BYTE 000 .BYTE 000,000,000,000,040,008,002,001 .BYTE 001 .BYTE 000,000,000,000,001,008,020,040 .BYTE 002 .BYTE 001,001,002,008,040,000,000,000 .BYTE 003 .BYTE 040,040,020,008,001,000,000,000 .BYTE 004 .BYTE 000,000,000,000,049,000,000,000 .BYTE 005 .BYTE 000,000,000,000,024,000,000,000 .BYTE 006 .BYTE 000,000,000,000,012,000,000,000 .BYTE 007 .BYTE 040,040,040,040,040,040,040,040 FONT2 .BYTE 005 .BYTE 008 .BYTE 001,001,001,001,001,001,001,001 .BYTE 009 ;Gas Gage character 1 .BYTE 055,02A,055,02A,055,02A,055,02A .BYTE 00A ;Gas Gage character 2 .BYTE 02A,055,02A,055,02A,055,02A,055 .BYTE 00B ;Down Arrow .BYTE 008,008,008,049,02A,01C,008,000 .BYTE 00C ;Up Arrow .BYTE 008,01C,02A,049,008,008,008,000 ;************************ Error Handler Routines ************************** ;Wait - Copy of Apple's wait routine. ;or more usefully: Areg = (Delay[in uS]/2.5 + 2.09)^.5 - 2.7 Wait1sec PHP SEI LDA EReg ORA #080 ;Set1Mhz STA EReg LDY #006 $1 LDA #0FF ;Delay(us)= 2.5Areg^2 + 13.5Areg + 15 = 166020 cycles SEC $2 PHA $3 SBC #001 BNE $3 PLA SBC #001 BNE $2 DEY BNE $1 LDA EReg AND #07F ;Set2Mhz STA EReg PLP RTS ;Device Specific Error Handler ErrHndlr BCC ERRORCK LDA Err_Data LDY MODE_ID ;check if device supports CF feature set CPY #002 BNE StdError LDY #ATA_Cmd ;Get & Display CF extended error code LDA #ATA_Xerr STA @BUFFCALL,Y JSR CALLDRVR BNE ERROR_YES LDY #000 LDA @BUFFPG0,Y ;Get extended error code LDX #XerrIndx-XerrCode-1 $1 CMP XerrCode,X BEQ $2 DEX BPL $1 JMP GenError $2 LDY XerrIndx,X JMP PrtError StdError ASL A BCC $1 LDX #BeepNclr JSR PRTESCP JSR PrtBdBlk JMP PrtLast $1 LDY #CFext03-ERMSGLEN+1 $2 ASL A BCS PrtError DEY CPY #CFext01-ERMSGLEN BCS $2 LDY #000 LDA Err_Data JMP GenError ;Error handler for SOS errors ERRORCK BNE ERROR_YES RTS ERROR_YES STA ERRCODE LDY #SERRLEN $1 CMP SOSERR,Y BEQ PrtError DEY BNE $1 GenError JSR BINHEX PrtError LDX #BeepNclr JSR PRTESCP LDA ERMSGLEN,Y STA PRTLEN1 TYA ASL A TAX LDA ERMSGADR,X STA INDEX LDA ERMSGADR+1,X STA INDEX+1 BRK .BYTE 0CB .WORD WRITINDX PrtLast LDX #DASH JSR PRTMSG LDX #PRANYKEY JSR PRTMSG BRK .BYTE 0CA .WORD READCON LDX #CLRMSG JSR PRTMSG JMP MAINMENU PRTMSG LDA MSGLEN,X PRTMSG1 STA PRTLEN1 TXA ASL A TAX BCC $1 LDA MSGADR2,X STA INDEX LDA MSGADR2+1,X BCS $2 $1 LDA MSGADR,X STA INDEX LDA MSGADR+1,X $2 STA INDEX+1 PRTMSG2 BRK .BYTE 0CB .WORD WRITINDX JMP ERRORCK PRTDNAME TXA ASL A ASL A ASL A ASL A ADC #080 STA DNAMEPTR LDY #000 LDA @DNAMEPTR,Y STA PRTLEN2 INC DNAMEPTR PRTDNAM2 BRK .BYTE 0CB .WORD WRITDNAM JMP ERRORCK PRTBYTE STA CHR BRK .BYTE 0CB .WORD WRITCHR JMP ERRORCK PrtBdBlk LDX #002 $1 LDA Err_Data+1,X STA PRODUCT,X DEX BPL $1 LDA BSECTADR STA INDEX LDA BSECTADR+1 STA INDEX+1 JSR DECIMAL7 CLC LDX #BLOCKBAD ADC MSGLEN,X JSR PRTMSG1 LDX #BLKBAD2 JMP PRTMSG FATALERR BNE $1 RTS $1 STA ERRCODE PLA STA INDEX+1 PLA STA INDEX $2 JMP $2 CLOSE BEQ $1 STA CLOSREF BRK .BYTE 0CC .WORD CLOSLIST $1 JMP ERRORCK QUIT LDA #001 JSR PRTBYTE LDA #01C JSR PRTBYTE LDA SEGNUM STA RELNUM BRK .BYTE 045 .WORD RELSEG BYE BRK .BYTE 065 .WORD BYE ;event handler for escape keystroke ESCHDLR SEC ROR HALTFLAG LDA #FLSHTYPE STA CTRLCODE BRK .BYTE 083 .WORD CTRLCALL JMP ERRORCK HALTPRG LDX #MSGWIND JSR PRTMSG BRK .BYTE 082 .WORD RESCR JSR ERRORCK LDX #VFYHALT JSR PRTMSG $1 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #01B BNE $2 LDX #CLRMSG JSR PRTMSG JMP GRPDONE $2 CMP #020 BNE $1 BRK .BYTE 083 .WORD RESCR JSR ERRORCK LDA #004 JSR PRTBYTE BRK .BYTE 083 .WORD ATTNEVNT JSR ERRORCK STA HALTFLAG RTS ;****************** Main Program Initialization Routine ******************* BEGIN TSX STX STACK LDA #000 STA ERRCODE STA MENU0SEL LDY #077 ;# of zero page data buffer locations $1 STA DNUMLST,Y DEY BPL $1 LDA #001 STA DfltSTlb JSR ALLOCMEM BRK .BYTE 084 .WORD DEVCALL JSR FATALERR LDA DEVNUM STA CTRLREF1 STA CTRLREF2 STA CTRLREF3 STA CTRLREF4 STA STATREF1 STA STATREF2 STA SREF1 STA SREF2 BRK .BYTE 0C8 .WORD OPENCON JSR FATALERR LDA CONREFN STA PRTREF1 STA PRTREF2 STA PRTREF3 STA PRTREF4 ;added for select volume routine STA CONREF LDY #000 ;Initialize console status buffers LDA #05A STA @STATBUF1,Y STA @STATBUF2,Y TYA STA @SCRBUF,Y ;initialize screen buffer BRK ;save initial console status .BYTE 082 .WORD CONSTAT JSR FATALERR LDA #00B STA CTRLCODE BRK ;turn off screen echo .BYTE 083 .WORD CTRLCALL JSR FATALERR BRK ;save current console status .BYTE 082 .WORD RESETCON JSR FATALERR LDY #001 STA @STATBUF2,Y LDY #006 STA @STATBUF2,Y BRK .BYTE 083 .WORD RESETCON JSR FATALERR BRK .BYTE 083 .WORD SETFONT1 JSR ERRORCK BRK .BYTE 083 .WORD SETFONT2 JSR ERRORCK LDX #TITLE JSR PRTMSG LDX #BORDER JSR PRTMSG LDX #SEARCH JSR PRTMSG JSR PREPDATE JSR GETDNAME JSR Wait1sec JMP MENUINIT ;***************************Main Program Menu ***************************** ;Main Menu and home origin for program routines MAINMENU LDX STACK TXS BRK ;RESET CONSOLE .BYTE 083 .WORD RESETCON JSR ERRORCK MENUINIT LDX #CLRPMPT JSR PRTMSG LDX #CMDLINE JSR PRTMSG LDX #VERSION JSR PRTMSG LDX #DATE JSR PRTMSG LDX #MENU0 JSR PRTMSG LDX #ESC0 JSR PRTESCP LDX MENU0SEL JMP MENU0HL ;Print non highlighted menu item MENU0STD STX MENU0SEL JSR PRTMSG2 ;Print highligted menu item MENU0HL LDA MENU0LEN,X STA PRTLEN1 TXA ASL A TAX LDA MENU0ADR,X STA INDEX LDA MENU0ADR+1,X STA INDEX+1 LDY #003 LDA #012 STA @INDEX,Y JSR PRTMSG2 LDA #011 STA @INDEX,Y GETCHR1 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #UPARROW BEQ UP0 CMP #DNARROW BEQ DN0 CMP #RETURN BEQ CRET0 CMP #OAPL_QM BEQ $2 AND #0DF LDX #MenuItms-1 ;Number of menu items $1 CMP MENU0LST,X BEQ SELECT0 DEX BPL $1 JMP GETCHR1 $2 LDX #COPYRITE JSR PRTMSG LDX MENU0SEL JMP MENU0HL ;Up arrow for main menu UP0 LDX MENU0SEL DEX BPL MENU0STD LDX #MenuItms-1 ;Number of menu items BNE MENU0STD ;Down arrow for main menu DN0 LDX MENU0SEL INX CPX #MenuItms ;Number of menu items BCC MENU0STD LDX #000 BEQ MENU0STD ;Return for main menu CRET0 LDX MENU0SEL SELECT0 TXA STA MENU0SEL ASL A TAX LDA FUNCADR+1,X PHA LDA FUNCADR,X PHA LDX #CLRVPORT JMP PRTMSG ;CFutil3 ;Routine to display device info DispInfo LDX #DEVHDR1 ;Display device info JSR PRTMSG LDX #Devic_nx JSR PRTMSG LDX #DEVHDR2 ;Display model # info JSR PRTMSG LDX #Model_nx JSR PRTMSG LDX #DEVHDR3 ;Display serial # info JSR PRTMSG LDX #Seria_nx JSR PRTMSG LDX #DEVHDR4 ;Display firmware version info JSR PRTMSG LDX #FirmW_nx JSR PRTMSG LDX #DEVHDR5 ;Display LBA support info JSR PRTMSG LDX #AnsYes LDA MODE_ID AND #002 BNE $1 LDX #No_LBA $1 JSR PRTMSG LDX #DEVHDR6 ;Display CFA features support info JSR PRTMSG LDX #AnsYes LDA MODE_ID AND #001 BEQ $2 LDX #AnsNo $2 JSR PRTMSG LDX #DEVHDR7 ;Display Maximum PIO mode support info JSR PRTMSG LDX #DEVHDR8 ;Display Total device capacity info JSR PRTMSG LDX #TCapblks JSR PRTMSG LDX #BLOCKS JMP PRTMSG ;***************** Low Level & Partition Format Routines ****************** FORMAT LDX #CMDLINE JSR PRTMSG LDX #LFMTCMD JSR PRTMSG JSR DISPDRV JSR DispInfo LDA #00B STA VTPOS JSR INCVPOS LDX #FWARNING JSR PRTMSG $2 LDX #ESC3 JSR PRTESCP BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDX #CLRMSGW JSR PRTMSG LDA INPUT AND #0DF CMP #OAPPLE_P BEQ FMTPTBL CMP #OAPPLE_F BEQ FMTBEGIN CMP #ESCAPE BNE $2 FMTABORT JMP MAINMENU FMTPTBL JSR GetPmap0 ;Get partition table number from user BCS FMTABORT LDX #ERASEPT1 JSR PRTMSG LDX #ESC8 JSR PRTESCP JSR QUERY_YN BCS FMTABORT JSR ZEROPTBL JSR INCVPOS JSR WRITPTBL JMP PAUSE FMTBEGIN LDA MODE_ID ;check if device supports CFA feature set AND #001 BEQ $2 LDX #NOFRMAT JSR PRTMSG LDX #ERASEPT2 ;prompt to erase all the partition tables JSR Query0YN BCS FMTABORT ;no don't erase the partition tables JSR ZEROPTBL LDA TOTSECT+2 LSR A LSR A STA CurPTmap $1 JSR SKIPSEL2 ;setup PTmapHB & CurPTmap JSR WPTBLDAT ;Write partition table data to drive DEC CurPTmap LDA CurPTmap BPL $1 JSR INCVPOS LDX #ERASPTDN ;erase partition tables complete message JSR PRTMSG JMP FMTDRVRS $2 LDX #ERASEDRV JSR Query0YN BCS FMTABORT LDX #FMTMSG ;start lowlevel drive format JSR PRTMSG JSR CLRCALL LDY #ATA_Cmd ;Setup low level format call LDA #ATA_Frmt STA @BUFFCALL,Y LDX #ESC4 ;Halt option message for format routine STX ZPGTEMP0 JSR STRTOPER LDA VFYERADR STA INDEX LDA VFYERADR+1 STA INDEX+1 LDA NUMERROR STA PRODUCT LDA #000 STA PRODUCT+1 JSR DECIMAL3 STA NUMVLEN LDX #FMTDONE ;display format complete message BIT HALTFLAG BPL $3 LDX #FMTHLTD $3 JSR PRTMSG LDX #NUMERRS JSR PRTMSG LDX #OCCUR JSR PRTMSG FMTDRVRS LDY CURDRIVE ;Mformat call to all drivers for the current device LDX DEV0LIST,Y LDA SLOTLST,X ;get slot and device num for the drive formatted STA ZPGTEMP0 LDA DRVNLST,X STA TEMPVAL LDX #000 $1 LDA SLOTLST,X CMP ZPGTEMP0 BNE $2 LDA DRVNLST,X CMP TEMPVAL BEQ $2 ;if same partition table & drive then skip LDA DNUMLST,X STA DFMTREF BRK .BYTE 083 ;format call to initialize driver .WORD DFMTCALL JSR ERRORCK $2 INX ;scroll thru all drivers online CPX NUMDNAME BCC $1 JMP PAUSE ZEROPTBL LDY #000 ;Fill partition data table with $00 TYA $1 STA @PARTTBL,Y INY BNE $1 RTS ;********************* Verify Drive Media Routine ************************ VERIFY LDX #CMDLINE JSR PRTMSG LDX #VRFYCMD JSR PRTMSG JSR DISPDRV JSR DispInfo LDA #00B STA VTPOS LDX #VRFYMSG JSR Query0YN BCC $1 JMP MAINMENU $1 LDX #CLRMSG JSR PRTMSG JSR CLRCALL LDY #ATA_Cmd ;Setup read-verify call LDA #ATA_Vrfy STA @BUFFCALL,Y LDX #ESC5 ;Halt option message for verify routine STX ZPGTEMP0 JSR STRTOPER LDA VFYERADR STA INDEX LDA VFYERADR+1 STA INDEX+1 LDA NUMERROR STA PRODUCT LDA #000 STA PRODUCT+1 JSR DECIMAL3 STA NUMVLEN LDX #VFYCOMP BIT HALTFLAG BPL $2 LDX #VFYHLTD $2 JSR PRTMSG LDX #NUMERRS JSR PRTMSG LDX #OCCUR JSR PRTMSG JMP PAUSE ;Subroutine to perform a function over the entire capacity ;of the device, display a gas gage progress indicator, and handle ;user interupt of function STRTOPER TSX STX LOCSTAT LDA #000 STA HALTFLAG STA NUMERROR STA POSITION ;percentage counter LDA #032 STA Divisor ;Initialize number of gas gage increments LDA #013 STA GAS_HPOS ;Initialize gas gage starting horizontal position JSR InitBPER ;Setup counter for gas gage display LDX ZPGTEMP0 JSR PRTESCP LDX #GASGAUGE ;gas gage progess display JSR PRTMSG LDA #080 ;Turn on attention event STA ATTNBUFF BRK .BYTE 083 .WORD ATTNEVNT JSR ERRORCK JSR CALLDRVR BNE BLKVFERR NEXTRK LDY #Num_Blks LDA @BUFFCALL,Y BEQ $1 ;If Num_Blks=$0 then increment BCTR $0100 CLC ADC BCTR STA BCTR BCC $2 $1 INC BCTR+1 $2 JSR INCRSECT BIT HALTFLAG BPL $3 JSR HALTPRG $3 JSR PRT_GAGE NXTBLK2 BIT HALTFLAG BPL $1 JSR HALTPRG $1 JSR CALLDRVR ;Verify Num_Blks BEQ NEXTRK ;Bad block error routine for verify or format device routines BLKVFERR BCC $1 BIT Err_Data BMI $2 $1 JSR ATTNOFF ;if not bad block error then report error & exit to menu JSR DevErrCk JMP ErrHndlr $2 LDA NUMERROR ;If first error then clear viewport BNE $3 LDX #VIEWPOS JSR PRTMSG LDA #01C JSR PRTBYTE LDA #002 STA VTPOS $3 JSR INCVPOS INC NUMERROR JSR PrtBdBlk CLC LDY #Sect_LB LDA Err_Data+1 ;update call address with next block after error ADC #001 STA @BUFFCALL,Y DEY LDA Err_Data+2 ADC #000 STA @BUFFCALL,Y DEY LDA Err_Data+3 ADC #000 STA @BUFFCALL,Y JSR InitBPER JMP NXTBLK2 INCVPOS LDA VTPOS ;increment viewport vertical position CMP #00E BCS $1 INC VTPOS $1 LDX #VIEWPOS JMP PRTMSG ;Subroutine to print progress & gas gage indicator PRT_GAGE LDA BPERCTR+1 BEQ $0 CMP BCTR+1 BCC $2 BNE $1 LDA BPERCTR CMP BCTR BEQ $2 LDY Divisor ;if divisor = 1 then load Num_Blks with final amount DEY BNE $1 LDY #Num_blks STA @BUFFCALL,Y $1 RTS $0 LDA BCTR CMP BPERCTR BCC $1 $2 INC POSITION INC POSITION LDX POSITION ;percentage counter LDY #002 $3 LDA #000 ;Initialize remainder JSR DIVx10 ORA #030 STA PCENT,Y TXA BEQ $5 DEY BNE $3 TXA ORA #030 STA PCENT,Y BNE $6 $4 LDA #020 STA PCENT,Y $5 DEY BPL $4 $6 LDX #PROGBAR JSR PRTMSG INC GAS_HPOS DEC Divisor BNE InitBPER GRPDONE JSR ATTNOFF ;If divisor is zero then we are done LDX #CLRMSGW JSR PRTMSG LDX LOCSTAT TXS INC VTPOS LDX #VIEWPORT JSR PRTMSG LDX #ClrLower JMP PRTMSG InitBPER SEC ;determine how many sectors are left to verify LDY #Sect_LB LDA TOTSECT SBC @BUFFCALL,Y STA BPERCTR DEY LDA TOTSECT+1 SBC @BUFFCALL,Y STA BPERCTR+1 DEY LDA TOTSECT+2 SBC @BUFFCALL,Y DIV24x8 LDX #010 ;24bit divide by 8bit routine where quotient won't CLC ;exceed 16bits. @Entry BPERCTR=LSB Dividend, Dividend $1 ROL BPERCTR ;BPERCTR+1=MSB, Areg=HSB Dividend, Divisor=Divisor ROL BPERCTR+1 ROL A CMP Divisor BCC $2 SBC Divisor $2 DEX BNE $1 STX BCTR ;re-initialize block counter to zero STX BCTR+1 ROL BPERCTR ROL BPERCTR+1 ;at Exit: Areg & BPERCTR=Quotient LB, ;BPERCTR+1=Quotient HB BNE $3 LDX BPERCTR ;with BPERCTR $3 LDY #Num_Blks ;Update drive call for next read quantity TXA STA @BUFFCALL,Y RTS ATTNOFF LDA #000 STA ATTNBUFF ;Turn off attention event BRK .BYTE 083 .WORD ATTNEVNT JMP ERRORCK INCRSECT SEC ;Increment block address by Num_Blks LDY #Num_Blks LDA @BUFFCALL,Y BEQ $1 ;If Num_Blks = $0 then increment sector address by $0100 CLC LDY #Sect_Lb ADC @BUFFCALL,Y STA @BUFFCALL,Y $1 LDY #Sect_Mb LDA @BUFFCALL,Y ADC #000 STA @BUFFCALL,Y DEY LDA @BUFFCALL,Y ADC #000 STA @BUFFCALL,Y RTS ;Test if any devices are connected Any_Devs LDY DEVLSTCT BEQ No_Devs RTS ;returns with the # of devices online No_Devs LDX #NODRIVE JSR PRTMSG JMP PAUSE ;if no devices are present then return to mainmenu ;*********************Test Interface Card Routines ************************ TESTIFC LDX #CMDLINE JSR PRTMSG LDX #TESTCMD JSR PRTMSG JSR Any_Devs SEC DEY STY CURDRIVE BEQ Only1Dev ;only 1 device so skip the search for others LDX DEV0LIST,Y ;check if multiple cards are present LDA SLOTLST,X STA TEMPVAL DEY $1 LDX DEV0LIST,Y LDA SLOTLST,X CMP TEMPVAL BNE $2 DEY BPL $1 BMI $3 $2 JSR SELDRVR ;if multiple cards then select a driver to test $3 LDY CURDRIVE ;Save current drive parameters LDX DEV0LIST,Y LDA SLOTLST,X STA TEMPVAL LDA DRVNLST,X AND #001 BEQ FindDrv1 ;Device $0 is already in current drive STY ZPGTEMP1 ;We have found device $1 - save it. LDA #000 JSR SCANLIST ;Go find device $0 BCS Only1Dev STY CURDRIVE ;Set device $0 as current drive BCC TestDev ;Always branches FindDrv1 LDA #001 JSR SCANLIST BCS Only1Dev STY ZPGTEMP1 BCC TestDev ;Always branches Only1Dev ROR ZPGTEMP1 ;Flag only one device exists on this card TestDev LDX #CLRVPORT JSR PRTMSG JSR CLRCALL LDY #ATA_Cmd LDA #ATA_Diag STA @BUFFCALL,Y JSR CALLDRVR JSR ErrHndlr LDX #TESTLST JSR PRTMSG LDY #000 LDA @BUFFPG0,Y STA ERRCODE BPL $1 LDX #TestER8x JSR PRTMSG LDX #DASH JSR PRTMSG LDA ERRCODE $1 AND #007 CLC ADC #TestER00 TAX JSR PRTMSG FIRSTDRV BIT ZPGTEMP1 ;if Hb set then only 1 drive exists BMI NXTDRV JSR GETDDATA JSR DispInfo ;Display device info list JSR G_ANYKEY LDA #00C JSR PRTBYTE LDA #00A JSR PRTBYTE LDA ZPGTEMP1 STA CURDRIVE NXTDRV JSR GETDDATA JSR DispInfo ;Display device info list LDX #TESTCOMP JSR PRTMSG JMP PAUSE ;Routine to search Online Devices driver list for a specific device SCANLIST STA TEMPVAL1 ;At entry Areg = Device #($0 or $1) to find, SCANLST2 LDY #000 ;TEMPVAL = Slot # of device $1 LDX DEV0LIST,Y LDA SLOTLST,X CMP TEMPVAL ;slot of currently selected driver BNE $2 LDA DRVNLST,X AND #001 CMP TEMPVAL1 BNE $2 STX TEMPINDX ;save device/driver index for later CLC ;Returns carry clear - device found: Xreg & TEMPINDX = Driver Index, RTS ;Yreg = Device Index, Areg = Device #($0 or $1) $2 INY CPY DEVLSTCT BCC $1 RTS ;Returns with carry set = device not found : All registers invalid. ;Display current driver on header command line DISPDRV JSR SELECDRV LDX #DRVHEDR JSR PRTMSG LDY CURDRIVE LDX DEV0LIST,Y JSR PRTDNAME LDA #004 JSR PRTBYTE LDX #CLRVPORT JMP PRTMSG ;routine to display created & modified dates for partition table PTDATES LDY #ORIGDATE+7 LDX #007 $1 LDA @PARTTBL,Y AND #07F CMP #02F BCC $3 CMP #03A BCS $3 STA ORGDATE1,X DEY DEX BPL $1 LDX #CREADATE JSR PRTMSG LDY #MODDATE+7 LDX #007 $2 LDA @PARTTBL,Y AND #07F CMP #02F BCC $3 CMP #03A BCS $3 STA NEWDATE1,X DEY DEX BPL $2 LDX #LMODDATE JSR PRTMSG $3 RTS ;Compute partition table checksum GETCKSUM CLC LDY #002 LDA #0A5 $1 EOR @PARTTBL,Y INY ADC @PARTTBL,Y INY BNE $1 RTS ;List devices online program function LSTDRV LDX #CMDLINE JSR PRTMSG LDX #LSTDRCMD JSR PRTMSG JSR Any_Devs ;Check if any devices are present JSR DLISTDRV JMP PAUSE ;Display list of devices online DLISTDRV LDX #VIEWPORT JSR PRTMSG SEC LDA #00E SBC DEVLSTCT LSR A STA DWINDULC LDX #DWINDMSG JSR PRTMSG LDX #000 $1 STX DRVPOS LDX #DLEADER JSR PRTMSG LDY DRVPOS LDX DEV0LIST,Y LDA SLOTLST,X ORA #030 STA SLOTVAL LDA DRVNLST,X AND #001 ORA #030 STA DRVNVAL JSR PRTDNAME LDX #SLOTPOS JSR PRTMSG LDX DRVPOS INX CPX DEVLSTCT BCC $1 RTS ;************************ Driver Selection Routine ************************ SELECDRV JSR Any_Devs DEY STY CURDRIVE BEQ $1 ;If only one device then skip selecting a driver JSR SELDRVR $1 JMP GETDDATA SELDRVR JSR DLISTDRV LDX #ESC2 JSR PRTESCP LDX #DLEADER LDA MSGLEN,X STA PRTLEN1 TXA ASL A TAX LDA MSGADR,X STA INDEX LDA MSGADR+1,X STA INDEX+1 LDX #000 STX CURDRIVE ;initialize current drive JMP SMENUHL ;Select drive menu SMENUSTD STX CURDRIVE JSR PRTMSG2 JSR PRTDNAM2 SMENUHL STX DRVPOS ;Entry point of select device subroutine Xreg=CURDRIVE LDA #012 STA DRVPOS+1 JSR PRTMSG2 LDY DRVPOS LDX DEV0LIST,Y JSR PRTDNAME LDA #011 STA DRVPOS+1 JSR PRTBYTE $1 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #UPARROW BEQ UP1 CMP #DNARROW BEQ DN1 CMP #RETURN BEQ CRET1 CMP #ESCAPE BNE $1 JMP MAINMENU CRET1 LDX #CLRPMPT JSR PRTMSG LDX #CLRVPORT JMP PRTMSG ;Up arrow for select drive menu UP1 LDX CURDRIVE DEX BPL SMENUSTD LDX DEVLSTCT DEX JMP SMENUSTD ;Down arrow for select drive menu DN1 LDX CURDRIVE INX CPX DEVLSTCT BCC SMENUSTD LDX #000 JMP SMENUSTD ;Get list of all CF/IDE drivers online GETDNAME LDX #000 STX NUMDNAME DEX $1 INX STX DNUM STX SDNUM1 LDA NUMDNAME ASL A ASL A ASL A ASL A ADC #080 STA DNAMEPTR BRK .BYTE 085 .WORD DINFO BNE $4 LDY #001 $2 LDA DEVTYPE,Y CMP DEV_ID,Y BNE $4 LDA MANUFID,Y CMP DEV_ID+2,Y BNE $4 DEY BPL $2 $3 BRK .BYTE 082 .WORD DIBinfo ;retrieve driver configuration bytes BNE $4 LDX NUMDNAME LDA DNUM STA DNUMLST,X LDA SLOTNUM STA SLOTLST,X LDA UNITNUM STA UNUMLST,X LDA DCFGNUM STA PNUMLST,X LDA DRIVNUM STA DRVNLST,X INC NUMDNAME $4 LDX DNUM CPX #018 BCC $1 ;Scan drivers online for unique device list LDX #000 STX DEVLSTCT ;initialize device count BEGLOOP LDY #000 STX ZPGTEMP0 CkNxtDev CPY ZPGTEMP0 BEQ IncDevCt ;if same as current driver then check the next driver LDA SLOTLST,X CMP SLOTLST,Y BNE IncDevCt ;if not the same slot then check the next driver LDA DRVNLST,Y AND #001 STA ZPGTEMP1 LDA DRVNLST,X AND #001 CMP ZPGTEMP1 BNE IncDevCt ;if not the same IDE device then check the next driver LDA UNUMLST,X CMP UNUMLST,Y ;if current unitnum is greater or equal to the BCS NextDev ;unitnum of the next driver then skip this driver IncDevCt INY CPY NUMDNAME BCC CkNxtDev LDY DEVLSTCT STX DEV0LIST,Y ;Get the device identification data for this device LDA DNUMLST,X STA SDNUM2 TYA ASL A CLC ADC IBuffHB STA DevIDpg0+1 BRK .BYTE 082 .WORD DevIdent BNE NextDev ;if error then device not online INC DEVLSTCT ;add this device to the list NextDev INX CPX NUMDNAME BCC BEGLOOP RTS ;********************** Memory Manager Routines *************************** ;Allocate memory and setup pointers ;Extended Memory Map - $3A07 bytes long ;$0000 STATBUF1 .BLOCK 05B,000 ;$005B STATBUF2 .BLOCK 05B,000 ;$00B6 SCRBUF .BLOCK 01CA,000 ;$0280 DNAMEPTR .BLOCK 080,000 ; Device $0 thru $7 $010 bytes each ;$0300 PARTTBL .BLOCK 0100,000 ;Device Indentification Block for up to 8 devices online ;$0400 DevIDpg0 .BLOCK 0200,000 ;$0600 DevIDpg1 .BLOCK 0200,000 ;$0800 DevIDpg2 .BLOCK 0200,000 ;$0A00 DevIDpg3 .BLOCK 0200,000 ;$0C00 DevIDpg4 .BLOCK 0200,000 ;$0E00 DevIDpg5 .BLOCK 0200,000 ;$1000 DevIDpg6 .BLOCK 0200,000 ;$1200 DevIDpg7 .BLOCK 0200,000 ;Call Block Organization: ;$1400 ATA Command Code .BYTE 000 ; Sector HB .BYTE 000 ; Sector MB .BYTE 000 ; Sector LB .BYTE 000 ; # of sectors .BYTE 000 ; Bytes returned .WORD 000 ;$1407 BUFFPG0 .BLOCK 0100,000 ;$1507 BUFFPG1 .BLOCK 0100,000 ;Volume Name List ;$1607 PICKINDX .BLOCK 2400,000 ; 512 Records @ 18 bytes long each ; $00-0E Volume Name ; $0F Length of Volume Name ; $10 Partition Table ; $11 Partition Number GETMEMRY BRK .BYTE 041 .WORD FINDSEG JSR FATALERR LDA BASE BEQ $1 CMP #00F BCC $2 $1 LDA #08F STA BASE ;Extended address bank RTS $2 ORA #080 STA BASE ;Extended address bank LDA BASE+1 SBC #020 CMP #082 BCC $3 SBC #080 INC BASE JMP $4 $3 CMP #002 BCS $4 ADC #080 DEC BASE $4 STA BASE+1 RTS ;CFutil4 ALLOCMEM LDA #000 TAY $1 STA EXTPG-1,Y ;Initalize extended address page INY BNE $1 JSR GETMEMRY ;Get a block of 59 pages of memory LDA BASE+1 STA STATBUF1+1 STA STATBUF2+1 STA SCRBUF+1 CLC ADC #002 STA DNAMEPTR+1 ADC #001 STA PARTTBL+1 ADC #001 STA IbuffHB ;Address page for DevIDpg0 ADC #010 STA BUFFPG0+1 STA BUFFCALL+1 ADC #001 STA BUFFPG1+1 ADC #001 STA PICKBASE+1 LDA BASE STA BUFFPG0+EXTPG STA BUFFPG1+EXTPG STA BUFFCALL+EXTPG STA STATBUF1+EXTPG STA STATBUF2+EXTPG STA SCRBUF+EXTPG STA DNAMEPTR+EXTPG STA PARTTBL+EXTPG STA DevIDpg0+EXTPG STA PICKINDX+EXTPG ;Insert additional extended bank locations above here LDA #000 STA BUFFCALL STA PARTTBL STA STATBUF1 STA DevIDpg0 LDA #007 STA BUFFPG0 STA BUFFPG1 STA PICKBASE LDA #05B STA STATBUF2 LDA #0B6 STA SCRBUF LDA #080 STA DNAMEPTR ;Insert additional address lsb above here. LDA BANKREG STA EVHDLRXB RTS ;****************** Change Driver Configuration Routines ****************** VOLNMPRT JSR PRTMSG LDY #00F LDA @PICKINDX,Y STA PRTLEN3 BRK .BYTE 0CB .WORD WRITPICK JMP ERRORCK DECPOS SEC LDA PICKINDX SBC #012 STA PICKINDX LDA PICKINDX+1 SBC #000 STA PICKINDX+1 SEC LDA POSITION SBC #001 STA POSITION LDA POSITION+1 SBC #000 STA POSITION+1 RTS INCPOS CLC LDA PICKINDX ADC #012 STA PICKINDX LDA PICKINDX+1 ADC #000 STA PICKINDX+1 INC POSITION BNE $1 INC POSITION+1 $1 RTS InitList LDA PICKBASE ;Setup initial VolArray address STA PICKINDX LDA PICKBASE+1 STA PICKINDX+1 LDA #000 STA POSITION ;initialize position in list to beginning STA POSITION+1 RTS BEGINSEL LDX DRVPOS LDA SLOTLST,X STA TEMPVAL ;setup for scan driver list LDA DRVNLST,X AND #001 JSR SCANLIST JSR GETDDAT2 ;Yreg = drive index to get identification data JSR GMaxPtbl ;Compute Maximum partition tables for device LDX #BWINDPRT JSR PRTMSG BRK ;Save contents of selection window .BYTE 082 .WORD RESCR JSR ERRORCK LDX #BORDER1 JSR PRTMSG LDX #STDPRT JSR PRTMSG ;Scan all partition maps and tables for Online Volumes SEC ;Initialize VolArray Address @ INDEX LDA PICKBASE SBC #005 STA VOLINDEX LDA PICKBASE+1 SBC #000 STA VOLINDEX+1 LDA PICKINDX+EXTPG STA VOLINDEX+EXTPG JSR InitList ;Setup for beginning of volume list STA CurPTmap ;Initialize volume name list variables Areg = $00 STA VOLCOUNT STA VOLCOUNT+1 STA ChgMade NxtPtbl ASL A ASL A STA PTmapHB LDX DRVPOS JSR SETCALL JSR GPTABLE ;Get partition table for this driver JSR GTRKPLEN ;Transfer partition table values LDX #000 ;Initialize partition number NxtPnum STX PartNum JSR GVOLNAM1 ;Get volume label or volume status BCS $3 ;Volume name was not found - move on LDY #015 LDA CurPTmap STA @VOLINDEX,Y INY LDA PartNum STA @VOLINDEX,Y CLC ;Increment Volume name record addresss LDA VOLINDEX ADC #012 STA VOLINDEX LDA VOLINDEX+1 ADC #000 STA VOLINDEX+1 INC VOLCOUNT BNE $1 INC VOLCOUNT+1 $1 LDX #STDPRT ;Display volume names as we find them LDA POSITION BEQ $2 CMP #MaxSelNo BCS $3 LDX #DNLFPRT $2 JSR VOLNMPRT JSR INCPOS $3 LDX PartNum INX CPX #008 BCC NxtPnum INC CurPTmap LDA CurPTmap CMP MAXPTBLS BCC NxtPtbl BEQ NxtPtbl LDX #MSGWIND JSR PRTMSG LDX #HELPMSG JSR PRTMSG JSR InitList ;Setup for beginning of volume list INC UPHILITE ;home LDX #UPHIPRT ;highlite 1st volume name JSR VOLNMPRT DEC UPHILITE JMP GETCHR6 DESEL BIT ChgMade BPL GETCHR6 LDA PICKINDX CMP VALSEL BNE GETCHR6 LDA PICKINDX+1 CMP VALSEL+1 BNE GETCHR6 LDX #LFPRT JSR PRTMSG ASL ChgMade BEQ GETCHR6 ;always branches MoveUP LDA POSITION+1 ORA POSITION BEQ GETCHR6 LDX #STDPRT JSR VOLNMPRT JSR DECPOS LDX #UPHIPRT BIT ChgMade BPL $1 LDA PICKINDX CMP VALSEL BNE $1 LDA PICKINDX+1 CMP VALSEL+1 BNE $1 LDX #UPRTPRT JSR PRTMSG LDX #HIPRT $1 JSR VOLNMPRT ;falls thru to GETCHR6 GETCHR6 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #LFARROW BEQ DESEL CMP #UPARROW BEQ MoveUP CMP #RTARROW BEQ RT_SEL CMP #DNARROW BEQ MoveDown CMP #RETURN BEQ CRET4 CMP #ESCAPE BNE GETCHR6 CLOSEOUT LDX #CLRMSG ;Closeout selection and return to caller JSR PRTMSG LDX #BWINDPRT JSR PRTMSG BRK .BYTE 083 .WORD RESCR JMP ERRORCK RT_SEL BIT ChgMade BMI GETCHR6 ;one has already been selected - ignore LDA PICKINDX ;This one is selected - save it. STA VALSEL LDA PICKINDX+1 STA VALSEL+1 LDX #RTPRT JSR PRTMSG SEC ROR ChgMade BNE GETCHR6 ;always branches MoveDown LDA POSITION+1 CMP VOLCOUNT+1 BCC $1 LDY POSITION INY CPY VOLCOUNT BCS GETCHR6 $1 LDX #STDPRT JSR VOLNMPRT JSR INCPOS LDX #DNHIPRT BIT ChgMade BPL $2 LDA PICKINDX CMP VALSEL BNE $2 LDA PICKINDX+1 CMP VALSEL+1 BNE $2 LDX #DNRTPRT JSR PRTMSG LDX #HIPRT $2 JSR VOLNMPRT JMP GETCHR6 ;Record Format of VOLARRAY: ;$00-$0E Volume Name ;$0F Length of Volume Name ;$10 Partition Table ;$11 Partition Number ;if a volume was selected then transfer ptbl & part #'s CRET4 BIT ChgMade BPL CLOSEOUT JSR CLOSEOUT LDA VALSEL STA PICKINDX LDA VALSEL+1 STA PICKINDX+1 JSR GParmDat LDY #011 LDA @PICKINDX,Y ;get partition number STA PartNum ORA #030 STA PNUMVAL DEY LDA @PICKINDX,Y ;get partition table STA CurPTmap TAX ASL A ASL A STA PTmapHB JSR GdevParm ;Setup Volume display information JSR PRTLAST1 ;display current selection LDX #SAVEDCFG JSR Query0YN BCC $1 ;Yes - Save this configuration RTS $1 JMP SAVEDRV2 ;save selection, returns to caller ;Display online driver list DLST2DRV LDX #VIEWPORT JSR PRTMSG SEC LDA #00E SBC NUMDNAME LSR A STA DWND2ULC CLC ADC #006 STA DWND3ULC LDX #DWND2MSG JSR PRTMSG LDX #000 $1 STX DRVPOS LDX #DLEADER JSR PRTMSG JSR GetDPrm2 LDX DRVPOS JSR PRTDNAME LDX #PMAPPOS JSR PRTMSG LDX DRVPOS INX CPX NUMDNAME BCC $1 RTS SetVLadr LDA PVOLADR STA VOLINDEX LDA PVOLADR+1 STA VOLINDEX+1 LDA #000 STA VOLINDEX+EXTPG ;Set extended page to local RTS GParmDat LDX DRVPOS JSR SETCALL LDA SLOTLST,X STA TEMPVAL ;setup for scan driver list ORA #030 STA SLOTVAL4 LDA DRVNLST,X AND #001 STA TEMPVAL1 ;setup for scan driver list ORA #030 STA DRVNVAL2 RTS ;Subroutine to get driver data for displays & prompts GetDParm LDA #000 STA ChgMade ;initialize modification status GetDPrm2 JSR GParmDat LDA PNUMLST,X STA PartNum ORA #030 STA PNUMVAL LDA DRVNLST,X AND #0FC STA PTmapHB LSR A LSR A TAX GdevParm JSR CNVBPTA2 ;convert binary partition map value to ascii JSR SCANLST2 ;Make sure slot/device # are in the list of drivers BCC JustPtbl JSR SetVLadr LDY #DEVNTEND-DEVNOT2+4 $1 LDA DEVNOT2-5,Y STA @VOLINDEX,Y DEY CPY #005 BCS $1 LDA #DEVNTEND-DEVNOT2 ADC #PMLDREND-SLOTLDR2 STA CfgVLen SEC RTS ;Returns with carry set - device # not in driver list. JustPtbl JSR GPTABLE ;Get partition table JSR GTRKPLEN ;Transfer partition table values JustPnum JSR SetVLadr LDX PartNum JSR GVOLNAM1 ;Get volume label or volume status LDY #014 LDA @VOLINDEX,Y CLC ADC #PMLDREND-SLOTLDR2 STA CfgVLen RTS ;Returns with carry clear. ;Subroutine to get single number from user EDIT1NUM LDX #ESC7 JSR PRTESCP LDA #005 ;turn on curser JSR PRTBYTE JMP GETCHR5 SHOWNUM STX ASCICHR1 OUTCHR1 LDX #ONEASCI JSR PRTMSG GETCHR5 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #DNARROW BEQ DOWN3 CMP #UPARROW BEQ UP3 CMP #ESCAPE BEQ NOCHNG2 CMP #RETURN BEQ CRET3 CMP #030 ;Ascii Values BCC GETCHR5 CMP ZPGTEMP1 ;check if value is too large BCS GETCHR5 STA ASCICHR1 JMP OUTCHR1 DOWN3 LDX ASCICHR1 DEX CPX #030 BCC GETCHR5 JMP SHOWNUM UP3 LDX ASCICHR1 INX CPX ZPGTEMP1 BCS GETCHR5 JMP SHOWNUM CRET3 LDA #006 JSR PRTBYTE CLC RTS NOCHNG2 LDA #006 JSR PRTBYTE SEC ;If Escape, return with carry set RTS ;Convert binary partition map number to 2 byte ascii ;On entry Xreg=partition map number CNVBPTA2 LDA #000 JSR DIVx10 BEQ $1 ORA #030 STA PMAPVAL+1 TXA BNE $2 $1 LDX #020 ;eliminate leading zeros STX PMAPVAL+1 $2 ORA #030 STA PMAPVAL RTS UP2 LDX DRVPOS ;Up arrow for select drive menu DEX BPL SMNU2STD LDX NUMDNAME DEX BPL SMNU2STD ;always branches DN2 LDX DRVPOS ;Down arrow for select drive menu INX CPX NUMDNAME BCC SMNU2STD LDX #000 ;falls through to SMNU2STD SMNU2STD JSR PRTMSG2 ;Select drive menu JSR PRTDNAM2 STX DRVPOS SMNU2HL LDA #012 STA DRVPOS+1 JSR PRTMSG2 JSR PRTDNAME LDA #011 STA DRVPOS+1 JSR PRTBYTE $1 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #UPARROW BEQ UP2 CMP #DNARROW BEQ DN2 CMP #OAPL_UP BEQ Sel_VolN CMP #RETURN BEQ CRET2 CMP #ESCAPE BNE $1 JMP MAINMENU ;Change driver configuration function ;Select Driver to change configuration CHGCONFG BIT DCFGNUM BPL $1 LDX #BADDVRV JSR PRTMSG JMP PAUSE $1 LDX #CMDLINE JSR PRTMSG LDX #SEL2CMD JSR PRTMSG JSR Any_Devs ;Check if any devices are present JSR DLST2DRV ;Display driver list & parameters LDA #000 STA DRVPOS ;initialize position in list to start out with BEQ SelDChg ;always branches Sel_VolN JSR BEGINSEL ;Select a Volume Name Routine SELENTER JSR GetDParm JSR PRTLAST1 SelDChg LDX #PTCHGMSG JSR PRTPMPTM LDX #ESC10 ;Select Driver to change configuration JSR PRTESCP LDX #LDRVWND JSR PRTMSG LDX #DLEADER LDA MSGLEN,X STA PRTLEN1 TXA ASL A TAX LDA MSGADR,X STA INDEX LDA MSGADR+1,X STA INDEX+1 LDX DRVPOS JMP SMNU2HL CRET2 JSR GetDParm CRET_A2 LDA DRVNVAL2 STA DEVNVAL2 ;xfer device number display to prompt STA ASCICHR1 LDA #032 ;Limit - Maximum Ascii value allowable +1 STA ZPGTEMP1 LDX #EDITDEVN JSR PRTPMPTM JSR EDIT1NUM ;get single number from user BCS SELENTER LDA ASCICHR1 CMP DRVNVAL2 ;check if device number was changed BEQ FindPmap STA DRVNVAL2 LDA #PMLDREND-SLOTLDR2 ;Volume name becomes invalid with new device STA CfgVLen LDA #081 JSR SetChgs FindPmap LDA SLOTVAL4 STA SLOTNOT2 ;xfer device number display to fault messages STA SLOTNOT3 AND #007 STA TEMPVAL LDA DRVNVAL2 ;Check for valid IDE device STA NOTDEVC1 ;xfer device number display to fault messages STA NOTDEVC2 AND #001 JSR SCANLIST BCC NewPmap1 ;if slot/device # is found in driver list then move on LDX #RELISTD ;driver configuration needs to be saved to proceed JSR ANYKEY0 LDX #SAVEDCFG JSR Query0YN BCS CRET_A2 ;save was declined - go back to enter a device # STA CurPTmap ;Intitalize partition table # to $0 (root level) SEC ;because we don't know the size of the device yet. ROR ChgMade ;change driver update flag to $C0 JSR SAVEDRV2 ;for manditory driver relisting and go save driver parms JSR GetDParm ;scan new driver list & reload current driver parameters BCC NewPmap0 ;if new device # was found then move on LDX #NODEVICE ;IDE device was not found in this slot JSR ANYKEY0 GoCretA2 JMP CRET_A2 ;Go back to prompt for a device # NewPmap0 JSR PRTLAST1 LDY ZPGTEMP1 NewPmap1 JSR GETDDAT2 ;Yreg = drive index to get identification data LDA PMAPVAL LDX PMAPVAL+1 JSR CVTAS2BN STA CurPTmap JSR GetPmap1 ;Get partition map number from user BCS GoCretA2 ;escape was pressed - go back to enter a device # LDA CurPTmap CMP POSITION ;Check if current partition table number was changed BNE $1 LDA ChgMade ;Check if device number was changed ASL A BNE $2 BEQ NewPTnum $1 LDA PTVALUE STA PMAPVAL LDA PTVALUE+1 STA PMAPVAL+1 LDX DRVPOS LDA ChgMade ASL A BEQ $3 $2 LDX TEMPINDX ;load driver index for new device # $3 JSR SETCALL JSR JustPtbl JSR MadeChgs ;Get new partition number NewPTnum LDA PNUMVAL STA PNUMVAL2 ;xfer partition number display to prompt STA ASCICHR1 LDA #038 ;Limit - Maximum Ascii value+1 STA ZPGTEMP1 LDX #EDITPNUM JSR PRTPMPTM JSR EDIT1NUM ;get single number from user BCS GoFndPmp ;escape was pressed - go back to enter Partition Table # LDA ASCICHR1 CMP PNUMVAL BEQ $1 STA PNUMVAL AND #007 STA PartNum JSR JustPnum JSR MadeChgs $1 BIT ChgMade ;Update driver with new configuration bytes BPL $2 LDX #SAVEDCFG JSR Query0YN BCS NewPTnum ;save was declined - go back to enter partition # JSR SAVEDRV2 $2 JMP SELENTER GoFndPmp JMP FindPmap SAVEDRV2 LDX DRVPOS ;Save new driver configuration bytes LDA CurPTmap ASL A LSR DRVNVAL2 ROL A STA DRVNLST,X STA DRIVNUM LDA PNUMVAL AND #007 STA PNUMLST,X STA DCFGNUM LDA DNUMLST,X STA SDNUM1 BRK .BYTE 083 .WORD DIBinfo ;save new driver configuration bytes JSR ERRORCK ASL ChgMade ;Check if we changed an IDE device # in the device list BEQ $2 BMI $3 ;if HB still set then reload driver list. LDY #000 ;Check if this driver is key in driver list $1 LDX DEV0LIST,Y CPX DRVPOS BEQ $3 INY CPY DEVLSTCT BCC $1 $2 RTS $3 JMP GETDNAME MadeChgs LDA ChgMade ORA #080 ;Mark modifications made SetChgs STA ChgMade PRTLAST1 LDX #LDRVWND JSR PRTMSG LDX #DLEADER JSR PRTMSG LDX #PMAPPOS JSR PRTMSG LDA #004 JMP PRTBYTE GNewPmap LDA PMAPVAL LDX PMAPVAL+1 JSR CVTAS2BN STA CurPTmap JMP GetPmap1 ;Get partition map number from user CVTAS2BN AND #00F STX ZPGTEMP0 CPX #SPACE BEQ $1 STA MLPLIER JSR MULTx10 LDA ZPGTEMP0 AND #00F CLC ADC PRODUCT $1 RTS ;Returns with binary value in Areg ;*********************** Partition Drive Routines ************************* PARTITIO LDX #CMDLINE JSR PRTMSG LDX #PARTCMD JSR PRTMSG JSR DISPDRV JSR GetPmap0 ;Get partition map number from user BCS $2 LDA PTVALUE STA PTNUMBER LDA PTVALUE+1 STA PTNUMBER+1 JSR GETPTBL ;Get partition information LDX #002 $1 LDA TOTSECT,X STA PRODUCT,X DEX BPL $1 LDA PTHDRADR STA INDEX LDA PTHDRADR+1 STA INDEX+1 LDY #008 JSR DECIMAL ;Generate 8 digit decimal STA TCAPLEN LDX #CLRVPORT JSR PRTMSG LDX #PARTHDR JSR PRTMSG LDX #TCapBlks JSR PRTMSG LDX #PTMENU1 JSR PRTMSG LDX #PTMENU2 JSR PRTMSG JSR DISPLYPT JSR EDITPART $2 JMP MAINMENU GMaxPtbl LDA TOTSECT+2 ;HB Determine maximum Ptables for this device PHA LSR A ;Get the upper 6 bits = Number of Partition Pages LSR A TAX SEC LDA TOTSECT SBC #001 STA TOTSECT ;Last partition map size LB LDA TOTSECT+1 SBC #000 STA TOTSECT+1 ;Last partition map size MB PLA AND #003 SBC #000 BCS $1 ;if value becomes negative then set maximum possible LDA #003 DEX ;may go $FF if total sectors was zero $1 STA TOTSECT+2 ;Last partition map size HB STX MAXPTBLS ;maximum partition number allowable on this drive RTS ;Subroutine to get partition map number from user ;Requires current drive data ;Determine max qty of partitions for this drive ;Compute maximum size of last partition GetPmap0 LDA #000 ;initialize current partition map #to zero STA CurPTmap LDA #ESC2 BNE SaveESC GetPmap1 LDA #ESC7 SaveESC STA CurVcol JSR GMaxPtbl LDA #000 JSR DIVx10 BNE $2 LDX #020 STX PTLIMIT+1 BNE $3 $2 ORA #030 STA PTLIMIT+1 TXA $3 ORA #030 STA PTLIMIT ;routine - Get Partition Map Number from User ;at entry Xreg=current partition map # GetPmap2 LDX CurPTmap STX POSITION ;save current partition number CPX MAXPTBLS ;if current partition table # greater than maximum BCC $1 LDX MAXPTBLS STX CurPTmap ;then asign the maximum to current partition table # $1 JSR CONVBPTA ;convert binary partition map value to ascii LDA MAXPTBLS BNE $2 JMP SKIPSEL1 ;if only one partition map then skip selection $2 LDA #PTHoffst ;initialize current horiz position STA CurHsel LDX #SelPTNum JSR PRTPMPTM LDX CurVcol ;escape message number JSR PRTESCP LDA #005 JSR PRTBYTE JMP GETCHR4 ;Convert binary partition map number to 2 byte ascii ;On entry Xreg=partition map number CONVBPTA LDA #000 JSR DIVx10 BEQ $1 ORA #030 STA PTVALUE+1 TXA BNE $2 $1 LDX #020 ;eliminate leading zeros STX PTVALUE+1 $2 ORA #030 STA PTVALUE RTS CKRT2 CMP #RTARROW BNE CKLF2 LDA CurHsel CMP #PTHoffst BNE GETCHR4 INC CurHsel LDA #009 JSR PRTBYTE JMP GETCHR4 CKUP2 CMP #UPARROW BNE CKASCI2 LDX CurPTmap CPX MAXPTBLS ;maximum partition map number allowable on this drive BCS GETCHR4 INX BNE ASCI_PT ;always taken ;CFutil5 GETCHR4 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT CMP #DNARROW BNE CKRT2 LDX CurPTmap BEQ GETCHR4 DEX ASCI_PT STX CurPTmap JSR CONVBPTA ;convert binary partition map value to ascii LDX #PTSEL JSR PRTMSG JMP GETCHR4 CKLF2 CMP #LFARROW BNE CKUP2 LDA CurHsel CMP #PTHoffst BEQ GETCHR4 DEC CurHsel LDA #008 JSR PRTBYTE JMP GETCHR4 CKASCI2 CMP #RETURN BEQ CKRET2 CMP #ESCAPE BEQ CKESC2 CMP #SPACE BEQ $1 CMP #030 BCC GETCHR4 CMP #03A BCS GETCHR4 $1 LDY CurHsel STA PTVALUE-PTHoffst,Y JSR PRTBYTE CPY #PTHoffst BNE $2 INC CurHsel BNE GETCHR4 $2 LDA #008 JSR PRTBYTE JMP GETCHR4 CKESC2 LDX #CLRMSGW JSR PRTMSG LDX #CLRPMPT JSR PRTMSG LDA POSITION STA CurPTmap ;restore current partition map number SEC RTS CKRET2 LDA PTVALUE LDX PTVALUE+1 JSR CVTAS2BN CMP MAXPTBLS ;maximum partition map number allowable on this drive BCC $1 ;number is less than the maximum value BEQ SKIPSEL1 ;number is the maximum value LDX #PTnoGood JSR PRTMSG JSR G_ANYKEY JMP GetPmap2 $1 LDX #003 ;Set maximum partition map size possible STX TOTSECT+2 LDX #0FF STX TOTSECT+1 STX TOTSECT SKIPSEL1 STA CurPTmap SKIPSEL2 ASL A ASL A STA PTmapHB CLC ;returns with partition number set @ CurPTmap (2 byte binary), RTS ;PTVALUE (ascii), and partition table address at PTmapHB (byte) ;Subroutine to get start block & partition size from table ; @Entry, PartNum = partition number CONVTRK LDX PartNum LDA BegBlkLB,X STA PRODUCT LDA BegBlkMB,X STA PRODUCT+1 LDA BegBlkHB,X STA PRODUCT+2 TXA ASL A TAX LDA TRKADR,X STA INDEX LDA TRKADR+1,X STA INDEX+1 LDY #006 JSR DECIMAL JMP PRTTRK CONVSIZE LDX PartNum LDA P0sizeLB,X STA PRODUCT LDA P0sizeHB,X STA PRODUCT+1 TXA ASL A TAX LDA BLENADR,X STA INDEX LDA BLENADR+1,X STA INDEX+1 JSR DECIMAL5 JMP PRTSIZE SetBegin CLC LDA BegBlkLB-1,X ADC P0sizeLB-1,X STA BegBlkLB,X LDA BegBlkMB-1,X ADC P0sizeHB-1,X STA BegBlkMB,X LDA BegBlkHB-1,X ADC #000 STA BegBlkHB,X Prt_Part JSR CONVSIZE JSR CONVTRK JMP GETVNAME ;Subroutine to display partition info DISPLYPT JSR GTRKPLEN JSR PTDATES LDX #000 STX PartNum $1 LDA BegBlkLB,X ORA BegBlkMB,X ORA BegBlkHB,X BNE $2 STA P0sizeLB,X STA P0sizeHB,X JSR SetBegin JMP $3 $2 JSR Prt_Part $3 INC PartNum LDX PartNum CPX #008 BCC $1 CREMCAP JSR COMPEND LDA #000 STA PRODUCT STA PRODUCT+1 STA PRODUCT+2 LDX #007 CKPTX LDA P0sizeLB,X ORA P0sizeHB,X BEQ NEXTPT JSR INITPTCK STX ZPGTEMP0 LDY #007 CKPTY CPY ZPGTEMP0 BEQ NXTY LDA P0sizeLB,Y ORA P0sizeHB,Y BEQ NXTY JSR CMPENDS BCS $1 JSR CMPBEGS BCS NEXTPT CPY ZPGTEMP0 BCS NXTY JSR BEG_ENDS BCS NXTY LDA BegBlkMB,Y STA ENDTRK+1 LDA BegBlkLB,Y STA ENDTRK JMP NXTY $1 CPY ZPGTEMP0 BCS NXTY JSR CMPBEGS BCC NXTY JSR ENDS_BEG BCS NXTY LDA EndBlkHB,Y STA BEGTRK+2 LDA EndBlkMB,Y STA BEGTRK+1 LDA EndBlkLB,Y STA BEGTRK NXTY DEY BPL CKPTY JSR CMPDIFF NEXTPT DEX BPL CKPTX CLC ;routine to compute remaining capacity LDA TOTSECT SBC PRODUCT STA PRODUCT LDA TOTSECT+1 SBC PRODUCT+1 STA PRODUCT+1 LDA TOTSECT+2 SBC PRODUCT+2 STA PRODUCT+2 LDA PTLRADR STA INDEX LDA PTLRADR+1 STA INDEX+1 JSR DECIMAL7 CLC ADC #003 LDX #RBLKS JSR PRTMSG1 LDX #BLOCKS JMP PRTMSG INITPTCK LDA BegBlkLB,X ;Xreg = partition number STA BEGTRK LDA BegBlkMB,X STA BEGTRK+1 LDA BegBlkHB,X STA BEGTRK+2 LDA EndBlkLB,X STA ENDTRK LDA EndBlkMB,X STA ENDTRK+1 LDA EndBlkHB,X STA ENDTRK+2 RTS CMPENDS LDA ENDTRK+2 ;Yreg = partition number CMP EndBlkHB,Y BCC $1 BNE $1 LDA ENDTRK+1 ;Yreg = partition number CMP EndBlkMB,Y BCC $1 BNE $1 LDA ENDTRK CMP EndBlkLB,Y $1 RTS CMPBEGS LDA BEGTRK+2 ;Yreg = partition number CMP BegBlkHB,Y BCC $1 BNE $1 LDA BEGTRK+1 ;Yreg = partition number CMP BegBlkMB,Y BCC $1 BNE $1 LDA BEGTRK CMP BegBlkLB,Y $1 RTS BEG_ENDS LDA BegBlkHB,Y CMP ENDTRK+2 BCC $1 BNE $1 LDA BegBlkMB,Y CMP ENDTRK+1 BCC $1 BNE $1 LDA BegBlkLB,Y CMP ENDTRK $1 RTS ENDS_BEG LDA BEGTRK+2 CMP EndBlkHB,Y BCC $1 BNE $1 LDA BEGTRK+1 CMP EndBlkMB,Y BCC $1 BNE $1 LDA BEGTRK CMP EndBlkLB,Y $1 RTS CMPDIFF SEC LDA ENDTRK SBC BEGTRK STA TEMPVAL LDA ENDTRK+1 SBC BEGTRK+1 STA TEMPVAL1 LDA ENDTRK+2 SBC BEGTRK+2 STA TEMPVAL2 CLC LDA PRODUCT ADC TEMPVAL STA PRODUCT LDA PRODUCT+1 ADC TEMPVAL1 STA PRODUCT+1 LDA PRODUCT+2 ADC TEMPVAL2 STA PRODUCT+2 RTS ;Subroutine to get partition info from table GTRKPLEN LDX #007 $1 LDY STBindex,X LDA @PARTTBL,Y STA BegBlkLB,X INY LDA @PARTTBL,Y STA BegBlkMB,X INY LDA @PARTTBL,Y STA BegBlkHB,X LDY VSZindex,X LDA @PARTTBL,Y STA P0sizeLB,X INY LDA @PARTTBL,Y STA P0sizeHB,X JSR VALIDPT DEX BPL $1 RTS ;Subroutine to print partition values GETVNAME JSR GVOLNAME PRTVOL LDA #020 LDY #VOLNLEN BNE PRTSTUF1 PRTSIZE LDA #010 LDY #BLOCKLEN BNE PRTSTUF1 PRTTRK LDA #000 LDY #TRKLEN PRTSTUF1 CLC ADC PartNum ADC PartNum TAX PRTSTUF2 LDA PMSGADR,X STA INDEX LDA PMSGADR+1,X STA INDEX+1 STY PRTLEN1 LDA @INDEX,Y CLC ADC #003 TAY LDA #SPACE BNE $2 $1 STA @INDEX,Y INY $2 CPY PRTLEN1 BCC $1 JMP PRTMSG2 VOLABEL LDX PartNum LDY #Num_Blks LDA #001 ;read 1 block STA @BUFFCALL,Y DEY CLC LDA BegBlkLB,X ADC #002 ;1st block of volume directory STA @BUFFCALL,Y DEY LDA BegBlkMB,X ADC #000 STA @BUFFCALL,Y DEY LDA BegBlkHB,X ADC #000 ORA PTmapHB ;set partition map address STA @BUFFCALL,Y LDY #ATA_Cmd LDA #ATACRead STA @BUFFCALL,Y JSR CALLDRVR JMP ErrHndlr ;Subroutine to get volume name GVOLNAME LDX PartNum TXA ASL A TAY LDA VOLADR,Y STA VOLINDEX LDA VOLADR+1,Y STA VOLINDEX+1 LDA #000 STA VOLINDEX+EXTPG ;Set extended page to local GVOLNAM1 LDA #000 STA EXISTVOL,X LDA P0sizeLB,X ORA P0sizeHB,X BNE GVOLNAM2 LDY #014 LDA #UNDEFLEN STA @VOLINDEX,Y CLC ADC #005 TAY DEY $1 LDA UNDEFINE-5,Y STA @VOLINDEX,Y DEY CPY #005 BCS $1 BCC TAGEXIST ;always branches GVOLNAM2 JSR VOLABEL LDY #000 TYA $1 ORA @BUFFPG0,Y INY CPY #004 BCC $1 CMP #003 BNE NOVOLUME LDA @BUFFPG0,Y CMP #0F1 BCC NOVOLUME AND #00F LDY #014 STA @VOLINDEX,Y CLC ADC #004 TAY $2 LDA @BUFFPG0,Y CMP #02E BEQ $3 CMP #030 BCC NOVOLUME CMP #07B BCS NOVOLUME CMP #03A BCC $3 CMP #041 BCC NOVOLUME CMP #05B BCC $3 CMP #061 BCC NOVOLUME $3 STA @VOLINDEX,Y DEY CPY #005 BCS $2 LDY #029 ;Check volume size matches partition size LDA @BUFFPG0,Y CMP P0sizeLB,X BNE NOVOLUME INY LDA @BUFFPG0,Y CMP P0sizeHB,X BNE NOVOLUME CLC RTS ;returns carry clear - volume name found NOVOLUME LDY #014 LDA #UFTXTLEN STA @VOLINDEX,Y CLC ADC #005 TAY DEY $1 LDA UNFMTTXT-5,Y STA @VOLINDEX,Y DEY CPY #005 BCS $1 TAGEXIST LDY PartNum LDA #081 STA EXISTVOL,Y SEC RTS ;returns carry set - volume name not found ;********************* Partition Editor Subroutines *********************** ;PartNum=current partition number $0 to $7 ;CurVcol=current vertical column in table TRK0($0), BLEN0($1), ;or VOL0 ($2) EDITPART SEC ROR LOCSTAT LDA #000 STA CurVcol NEXTPART STA PartNum CLC ADC #008 ;initial vertical position in window STA SCRHPVP+1 ;vertical position in window RETRY3 BIT LOCSTAT BPL $1 LDX #FESC6 JSR PRTPMPTM LDX #ESC6 JSR PRTESCP LDX #VIEWPORT JSR PRTMSG $1 LDA #000 STA POSITION STA LOCSTAT REPOS3 LDX CurVcol LDA COL_HPOS,X CLC ADC POSITION STA SCRHPVP ;horizontal position in window LDX #CURSER JSR PRTMSG GETCHR3A LDA curVcol ASL A ASL A ASL A ORA PartNum ASL A TAX LDA TRKADR,X STA INDEX LDA TRKADR+1,X STA INDEX+1 GETCHR3 BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT BPL CKDN BIT LOCSTAT BMI GETCHR3 AND #0DF CMP #OAPPLE_R BNE $1 JSR Calc_Beg JMP RETRY3 $1 CMP #OAPPLE_S BNE $3 JSR COMPEND JSR CKPTLAPS BCS $2 LDX #VIEWPORT JSR PRTMSG LDA PartNum JMP NEXTPART $2 LDX #PROMPT0 JSR PRTMSG JSR SAVEPTBL JMP EDITPART $3 CMP #OAPPLE_F BNE GETCHR3 JSR HLFMT SEC ROR LOCSTAT JMP RETRY3 CKDN CMP #DNARROW BNE CKRT JSR SAVEPART BCC $1 JMP RETRY3 $1 LDX PartNum INX TXA AND #007 $2 JMP NEXTPART CKRT CMP #RTARROW BNE CKLF LDX CurVcol LDY ITEM_LEN,X LDA POSITION CMP @INDEX,Y BCS $2 INC POSITION LDA #009 JSR PRTBYTE $2 JMP GETCHR3 CKLF CMP #LFARROW BNE CKUP LDA POSITION BEQ $1 DEC POSITION LDA #008 JSR PRTBYTE $1 JMP GETCHR3 CKUP CMP #UPARROW BNE CKRET JSR SAVEPART BCC $1 JMP RETRY3 $1 LDX PartNum DEX TXA AND #007 JMP NEXTPART CKRET CMP #RETURN BNE CKTAB JSR SAVEPART BCC IncColmn JMP RETRY3 IncColmn LDY CurVcol INY CPY #003 BCC $1 LDY #000 $1 STY CurVcol LDA PartNum JMP NEXTPART CKTAB CMP #TAB BNE CKSPC TAB3 JSR SAVEPART BCC IncColmn JMP RETRY3 CKSPC CMP #SPACE BNE CKASCI JSR FILLSPC JMP REPOS3 CKASCI CMP #ESCAPE BEQ CKESC LDX CurVcol CPX #VOL0 BCC $2 CMP #02E BEQ $3 CMP #041 BCC $1 CMP #05B BCC $3 CMP #061 BCC $1 CMP #07B BCS $4 AND #0DF ;Convert to uppercase BCC $3 $1 LDY POSITION BEQ $4 $2 CMP #030 BCC $4 CMP #03A BCS $4 $3 LDY POSITION CPX #VOL0 BNE $5 CPY ITEM_LEN+2 ;$0F maximum length of volume name BCC $7 $4 JMP GETCHR3 $5 CPX #BLEN0 BNE $6 CPY ITEM_LEN+1 ;$05 maximum length of block size value BCC $7 BCS $4 $6 CPY ITEM_LEN ;$06 maximum length of starting track value BCS $4 $7 STA @INDEX,Y JSR PRTBYTE INC POSITION LDA POSITION LDY ITEM_LEN,X CMP @INDEX,Y BCC $8 STA @INDEX,Y $8 BIT LOCSTAT BMI $4 LDX #CLRPMPT JSR PRTMSG LDX #ESC6A JSR PRTESCP LDA #005 JSR PRTBYTE SEC ROR LOCSTAT JMP GETCHR3A CKESC BIT LOCSTAT BPL ESCRETN LDA #006 JSR PRTBYTE LDX CurVcol BEQ $1 ;TRK0 CPX #VOL0 BNE $2 JSR GETVNAME JMP RETRY3 $1 JSR CONVTRK JMP RETRY3 $2 JSR CONVSIZE JMP RETRY3 ESCRETN LDX #CLRMSGW JSR PRTMSG LDX #CLRPMPT JSR PRTMSG JSR COMPEND JSR CKPTLAPS BCS $1 LDX #VIEWPORT JSR PRTMSG LDA PartNum JMP NEXTPART $1 LDX #MSGWIND JSR PRTMSG LDY #0FE LDX #000 $2 LDA PTVALID,X BEQ $3 TXA ORA #030 INY INY STA PPTNUM,Y INY $3 INX CPX #008 BCC $2 TYA BPL $4 RTS $4 LDX #PTWARN1 CLC ADC MSGLEN,X JSR PRTMSG1 LDX #PTWARN2 JSR PRTMSG PtChange LDX #PTBLMSG JSR Query0YN BCC SAVEPTBL RTS Calc_Beg LDA Partnum CMP #007 BCS $3 STA ZPGTEMP1 ;Save current partition number ADC #031 STA TrkValue LDX #ReCalMsg JSR Query0YN PHP LDA #004 JSR PRTBYTE PLP BCC $2 BCS $3 $1 LDA #080 ;Invalidate partition status STA PTVALID,X JSR SetBegin $2 INC PartNum LDX PartNum CPX #008 BCC $1 LDA ZPGTEMP1 STA PartNum ;Restore current partition number $3 RTS SAVEPTBL LDX #007 $1 LDA PTVALID,X BEQ $3 STX PartNum JSR XFERPART LDA EXISTVOL,X BPL $3 JSR VOLABEL ;Get root directory block LDA #ATACWrit STA @BUFFCALL,Y LDY #004 LDA #000 $2 STA @BUFFPG0,Y ;Invalidate current directory DEY BPL $2 JSR CALLDRVR JSR ErrHndlr LDX PartNum $3 DEX BPL $1 ;Update partition table parameters on drive UDATDRV LDY #MODDATE JSR REVDATE ;Initialize partition table device info field with spaces LDY #PtSIdx+043 ;$10+043 LDX #043 ;68 bytes long LDA #SPACE $1 STA @PARTTBL,Y DEY DEX BPL $1 ;Transfer device information to partition table LDY #PtSIdx ;$10 LDX #000 $2 LDA SerialNo,x STA @PARTTBL,Y INY INX CPX SN_Len BCC $2 LDY #PtRevIdx ;$24 LDX #000 $3 LDA FirmWare,x STA @PARTTBL,Y INY INX CPX FW_Len BCC $3 LDY #PtModIdx ;$2C LDX #000 $4 LDA Model,x STA @PARTTBL,Y INY INX CPX MOD_Len BCC $4 $5 JSR GETCKSUM STA @PARTTBL,Y $6 LDA @PARTTBL,Y STA @BUFFPG0,Y INY BNE $6 JSR WRITPTBL LDX #VIEWPORT JSR PRTMSG JSR PTDATES LDA #004 JMP PRTBYTE BEGPARTN LDA PartNum STA ZPGTEMP1 JMP $2 $1 LDA P0sizeLB,X ;Xreg = partition number ORA P0sizeHB,X BNE $2 JSR SetBegin $2 INC PartNum LDX PartNum CPX #008 BCC $1 LDA ZPGTEMP1 STA PartNum RTS FILLSPC LDX CurVcol LDY ITEM_LEN,X $1 STY ZPGTEMP0 LDA POSITION STA @INDEX,Y TAY LDA #006 JSR PRTBYTE $2 LDA #SPACE JSR PRTBYTE INY CPY ZPGTEMP0 BCC $2 BIT LOCSTAT BMI $3 LDX #ESC6A JSR PRTESCP SEC ROR LOCSTAT $3 RTS CKPTLAPS LDX #000 CKPT1 TXA TAY INY CKPT2 LDA P0sizeLB,Y ORA P0sizeHB,Y BEQ NEXTY LDA BegBlkHB,X CMP EndBlkHB,Y BCC $1 BNE NEXTY LDA BegBlkMB,X CMP EndBlkMB,Y BCC $1 BNE NEXTY LDA BegBlkLB,X CMP EndBlkLB,Y BCS NEXTY $1 LDA BegBlkHB,X CMP BegBlkHB,Y BCC $2 BNE ERRORPT LDA BegBlkMB,X CMP BegBlkMB,Y BCC $2 BNE ERRORPT LDA BegBlkLB,Y CMP BegBlkLB,X BCC ERRORPT $2 LDA EndBlkHB,X CMP BegBlkHB,Y BCC NEXTY BNE ERRORPT LDA EndBlkMB,X CMP BegBlkMB,Y BCC NEXTY BNE ERRORPT LDA BegBlkLB,Y CMP EndBlkLB,X BCS NEXTY NoEdit LDX #CLRMSGW JSR PRTMSG LDX PartNum NEXTY INY CPY #008 BCC CKPT2 INX CPX #007 BCC CKPT1 RTS ERRORPT TXA ORA #030 STA PTCNFLT1 TYA ORA #030 STA PTCNFLT2 STX PartNum LDX #PTOVLAP JSR PRTESCP LDX #RE_EDIT JSR Query0YN BCS NoEdit LDA #000 STA CurVcol RTS COMPEND LDX #007 $1 CLC LDA P0sizeLB,X ADC BegBlkLB,X STA EndBlkLB,X LDA P0sizeHB,X ADC BegBlkMB,X STA EndBlkMB,X LDA #000 ADC BegBlkHB,X STA EndBlkHB,X DEX BPL $1 RTS RESETPT LDA #000 STA TEMPVAL STA TEMPVAL1 LDX PartNum JMP NEWSIZE SAVEPART CLC BIT LOCSTAT BMI $1 RTS $1 LDA #006 JSR PRTBYTE LDX CurVcol BEQ CkTrk ;TRK0 CPX #BLEN0 BEQ CKPTSIZE JMP HLFMT CKPTSIZE JSR BINARY LDA TEMPVAL2 ;if HB is not zero then value is greater than 65535 BNE $1 BIT TEMPVAL1 ;check if value is greater than 32767 ($7FFF) BPL $2 $1 LDX #OUTRANG1 JSR ANYKEY0 JSR CONVSIZE SEC RTS $2 ORA TEMPVAL1 ORA TEMPVAL BNE $3 LDY #005 LDA #001 STA @INDEX,Y LDY #000 LDA #030 STA @INDEX,Y JSR PRTBYTE $3 JMP CkSize PRTPMPTM STX PRT_QUE LDX #PROMPT0 JSR PRTMSG LDX PRT_QUE JMP PRTMSG PRTESCP STX PRT_QUE LDX #MSGWIND JSR PRTMSG LDX PRT_QUE JMP PRTMSG ANYKEY0 JSR PRTPMPTM G_ANYKEY LDX #ESC1B JSR PRTESCP BRK .BYTE 0CA .WORD READCON JSR ERRORCK LDX #CLRMSGW JMP PRTMSG CkTrk JSR BINARY BEQ RESETPT LDA TEMPVAL ORA TEMPVAL1 ORA TEMPVAL2 BNE $1 LDY #007 LDA #001 STA TEMPVAL STA @INDEX,Y LDY #000 LDA #031 STA @INDEX,Y JSR PRTTRK $1 LDA TEMPVAL2 ;Check beginning track limits CMP TOTSECT+2 BCC CkLimits BNE $2 LDA TEMPVAL1 CMP TOTSECT+1 BCC CkLimits BNE $2 LDA TEMPVAL CMP TOTSECT BCC CkLimits $2 LDX #MAXBLOCK JSR ANYKEY0 JSR CONVTRK SEC RTS CkLimits LDX PartNum ;transfer start block to table LDA TEMPVAL2 CMP BegBlkHB,X ;check if track value was changed BNE $1 LDA TEMPVAL1 CMP BegBlkMB,X BNE $1 LDA TEMPVAL CMP BegBlkLB,X BEQ $2 $1 LDA #080 ;Invalidate partition status STA PTVALID,X LDA TEMPVAL2 STA BegBlkHB,X LDA TEMPVAL1 STA BegBlkMB,X LDA TEMPVAL STA BegBlkLB,X $2 LDA P0sizeLB,X ;transfer partition size to temporary STA TEMPVAL LDA P0sizeHB,X STA TEMPVAL1 ;CFutil6 CkSize LDX PartNum ;Check partition size limits SEC LDA TEMPVAL ADC BegBlkLB,X STA TEMPVAL2 LDA TEMPVAL1 ADC BegBlkMB,X STA TEMPVAL3 LDA #000 ADC BegBlkHB,X CMP TOTSECT+2 BCC STORSIZE BNE $2 LDA TEMPVAL3 CMP TOTSECT+1 BCC STORSIZE BNE $2 LDA TEMPVAL2 CMP TOTSECT BCC STORSIZE BEQ STORSIZE $2 LDA TOTSECT SBC BegBlkLB,X STA TEMPVAL LDA TOTSECT+1 SBC BegBlkMB,X STA TEMPVAL1 STORSIZE LDA TEMPVAL1 ;check if partition size has changed CMP P0sizeHB,X BNE NEWSIZE LDA TEMPVAL CMP P0sizeLB,X BEQ REFRESH NEWSIZE LDA #080 ;Invalidate partition status STA PTVALID,X LDA TEMPVAL1 STA P0sizeHB,X LDA TEMPVAL STA P0sizeLB,X REFRESH LDA PTVALID,X BPL $1 LDA EXISTVOL,X BMI $1 TXA ASL A TAY LDA VOLADR,Y STA INDEX LDA VOLADR+1,Y STA INDEX+1 JSR NOVOLUME $1 JSR CONVSIZE JSR BEGPARTN LDX #CLRPMPT JSR PRTMSG JMP CREMCAP ;******************* High Level Volume Format Routines ******************** HLFMT LDX #CLRMSGW JSR PRTPMPTM LDX PartNum LDA EXISTVOL,X BMI CkVname JSR VOLABEL LDY #000 TYA $1 ORA @BUFFPG0,Y INY CPY #004 BCC $1 CMP #003 BNE CkVname LDA @BUFFPG0,Y CMP #0F1 BCC CkVname AND #00F STA ZPGTEMP0 LDX #MSGWIND JSR PRTMSG LDX #ERASMSG1 LDA MSGLEN,X CLC ADC ZPGTEMP0 PHA LDA ZPGTEMP0 CLC ADC #004 TAY $2 LDA @BUFFPG0,Y STA PNAME2-5,Y DEY CPY #005 BCS $2 PLA JSR PRTMSG1 LDX #ERASMSG2 JSR PRTMSG CkVname LDA PartNum ASL A TAX LDA PNAMEADR,X STA INDEX LDA PNAMEADR+1,X STA INDEX+1 LDY #00F LDA @INDEX,Y BNE NewVname LDA #BLTXTLEN STA @INDEX,Y TAY DEY LDA PartNum ORA #030 STA @INDEX,Y DEY $1 LDA BLANK01,Y STA @INDEX,Y DEY BPL $1 LDX #VIEWPORT JSR PRTMSG JSR PRTVOL JMP CkVname NewVname TAY CLC LDX #HFMT0MSG ADC MSGLEN,X STA ZPGTEMP0 DEY $1 LDA @INDEX,Y STA PNAME1,Y DEY BPL $1 LDX #PROMPT0 JSR PRTMSG LDX #HFMT0MSG LDA ZPGTEMP0 JSR PRTMSG1 LDX #HFMT1MSG JSR PRTMSG JSR QUERY_YN BCS NoHLFmt LDX PartNum LDA PTVALID,X ;Check for modified partition BEQ InitVol LDX #PTNUPD JSR PRTESCP JSR PtChange LDX #CLRMSGW JSR PRTPMPTM LDX PartNum LDA PTVALID,X BEQ InitVol NoHLFmt LDX #VIEWPORT JSR PRTMSG JMP GETVNAME InitVol LDY #000 TYA $1 STA @BUFFPG0,Y STA @BUFFPG1,Y INY BNE $1 LDA PartNum ASL A TAX LDA VOLADR,X STA INDEX LDA VOLADR+1,X STA INDEX+1 LDY #014 LDA @INDEX,Y PHA CLC ADC #004 TAY $2 LDA @INDEX,Y STA @BUFFPG0,Y DEY CPY #005 BCS $2 PLA ORA #0F0 STA @BUFFPG0,Y LDY #002 LDA #003 STA @BUFFPG0,Y JSR CNVTDATE LDX #003 LDY #01F $3 LDA TEMPVAL,X STA @BUFFPG0,Y DEY DEX BPL $3 LDY #022 LDA #0C3 STA @BUFFPG0,Y INY LDA #027 STA @BUFFPG0,Y INY LDA #00D STA @BUFFPG0,Y LDY #027 LDA #006 STA @BUFFPG0,Y LDX PartNum LDA P0sizeLB,X LDY #029 STA @BUFFPG0,Y STA TEMPVAL AND #007 STA TEMPVAL2 INY LDA P0sizeHB,X STA @BUFFPG0,Y AND #008 STA TEMPVAL3 LDA P0sizeHB,X LDY #003 $4 LSR A ROR TEMPVAL DEY BNE $4 CLC LDA P0sizeLB,X ADC #0FF LDA P0sizeHB,X ADC #00F ROR A LSR A LSR A LSR A STA PRODUCT ;VOLUME SIZE TOO SMALL IF PRODUCT=0 WBLOCK2 LDY #ATA_Cmd LDA #ATACWrit STA @BUFFCALL,Y LDY #Sect_LB CLC LDA BegBlkLB,X ADC #002 STA @BUFFCALL,Y DEY LDA BegBlkMB,X ADC #000 STA @BUFFCALL,Y DEY LDA BegBlkHB,X ADC #000 ORA PTmapHB STA @BUFFCALL,Y LDY #Num_Blks LDA #001 ;One block at a time STA @BUFFCALL,Y JSR WBLOCK NDIRBLK LDA #000 LDY #004 $1 STA @BUFFPG0,Y INY BNE $1 LDA #002 STA @BUFFPG0,Y LDY #002 JSR INCBUFPG JSR WBLOCK LDY #000 JSR INCBUFPG LDY #002 JSR INCBUFPG JSR WBLOCK LDY #000 JSR INCBUFPG LDA #000 LDY #002 STA @BUFFPG0,Y JSR WBLOCK BITMAP LDA #0FF LDY #000 $1 STA @BUFFPG0,Y STA @BUFFPG1,Y INY BNE $1 CLC LDA PRODUCT ADC #006 PHA $2 PLA CMP #008 BCC $3 SBC #008 PHA LDA #008 $3 TAX LDA BITINDEX,X STA @BUFFPG0,Y INY CPX #008 BEQ $2 DEC PRODUCT JSR WBLOCK LASTBIT LDA #0FF LDY #002 $1 STA @BUFFPG0,Y DEY BPL $1 BMI $3 $2 JSR WBLOCK $3 DEC PRODUCT BNE $2 LDX TEMPVAL2 LDA BITINDEX,X EOR #0FF LDY TEMPVAL LDX TEMPVAL3 BNE $6 $4 STA @BUFFPG0,Y LDA #000 INY BNE $4 $5 STA @BUFFPG1,Y INY BNE $5 BEQ $7 $6 STA @BUFFPG1,Y LDA #000 INY BNE $6 $7 JSR WBLOCK LDX PartNum LDA #000 STA EXISTVOL,X LDX #HFMTCMP JSR ANYKEY0 LDX #VIEWPORT JMP PRTMSG INCBUFPG CLC LDA @BUFFPG0,Y ADC #001 STA @BUFFPG0,Y RTS WBLOCK JSR CALLDRVR BEQ BUMPSECT LDX #DIRERR JSR PRTPMPTM JSR DevErrCk JMP ErrHndlr BUMPSECT LDY #Sect_LB CLC LDA @BUFFCALL,Y ADC #001 ;One block at a time STA @BUFFCALL,Y DEY $1 LDA @BUFFCALL,Y ADC #000 STA @BUFFCALL,Y DEY BNE $1 RTS ;************************** Misc Subroutines ****************************** XFERPART LDX PartNum LDY STBindex,X LDA P0sizeLB,X ORA P0sizeHB,X BNE $1 LDA #000 STA @PARTTBL,Y INY STA @PARTTBL,Y INY STA @PARTTBL,Y LDY VSZindex,X STA @PARTTBL,Y INY STA @PARTTBL,Y JMP VALIDPT $1 LDA BegBlkLB,X STA @PARTTBL,Y INY LDA BegBlkMB,X STA @PARTTBL,Y INY LDA BegBlkHB,X STA @PARTTBL,Y LDY VSZindex,X LDA P0sizeLB,X STA @PARTTBL,Y INY LDA P0sizeHB,X STA @PARTTBL,Y VALIDPT LDA #000 STA PTVALID,X RTS ;Subroutine to Display Date PREPDATE BRK .BYTE 063 .WORD TIMEDATE JSR ERRORCK LDY #004 LDA YEAR,Y AND #001 STA MLPLIER JSR MULTx10 INY LDA YEAR,Y AND #00F CLC ADC PRODUCT STA PRODUCT ASL A ADC PRODUCT TAX LDY #004 $1 LDA MMONTHS-3,X STA DATEDISP,Y INY INX CPY #007 BCC $1 LDA #SPACE STA DATEDISP,Y INY LDX #006 LDA YEAR,X CMP #030 BEQ $2 STA DATEDISP,Y INY $2 INX LDA YEAR,X STA DATEDISP,Y INY LDA #02C STA DATEDISP,Y INY LDA #SPACE STA DATEDISP,Y INY LDX #000 $3 LDA YEAR,X STA DATEDISP,Y INY INX CPX #004 BCC $3 LDA #004 STA DATEDISP,Y INY STY DATELEN RTS ;Convert SOS ascii date to SOS binary packed format CNVTDATE BRK .BYTE 063 .WORD TIMEDATE JSR ERRORCK LDY #002 LDA YEAR,Y AND #00F STA MLPLIER JSR MULTx10 INY LDA YEAR,Y AND #00F ADC PRODUCT STA TEMPVAL1 INY LDA YEAR,Y AND #00F STA MLPLIER JSR MULTIPLY INY LDA YEAR,Y AND #00F ADC PRODUCT ASL A ASL A ASL A ASL A ASL A STA TEMPVAL ROL TEMPVAL1 INY LDA YEAR,Y AND #00F STA MLPLIER JSR MULTIPLY INY LDA YEAR,Y AND #00F ADC PRODUCT AND #01F ORA TEMPVAL STA TEMPVAL ;Convert SOS ascii time to SOS binary packed format LDY #009 LDA YEAR,Y AND #00F STA MLPLIER JSR MULTIPLY INY LDA YEAR,Y AND #00F ADC PRODUCT STA TEMPVAL3 INY LDA YEAR,Y AND #00F STA MLPLIER JSR MULTIPLY INY LDA YEAR,Y AND #00F ADC PRODUCT STA TEMPVAL2 RTS MULTx10 LDA #00A ;Multiply by 10 STA MLPCND MULT8bit LDA #000 STA MLPCND+1 STA MLPCND+2 ;24 bit multiplicand by 8 bit multiplier MULTIPLY LDA #000 STA PRODUCT STA PRODUCT+1 STA PRODUCT+2 LDX #008 $1 ASL PRODUCT ROL PRODUCT+1 ROL PRODUCT+2 BCS $3 ASL MLPLIER BCC $2 CLC LDA PRODUCT ADC MLPCND STA PRODUCT LDA PRODUCT+1 ADC MLPCND+1 STA PRODUCT+1 LDA PRODUCT+2 ADC MLPCND+2 STA PRODUCT+2 BCS $3 $2 DEX BNE $1 $3 RTS ;at Exit - result in PRODUCT (LB), PRODUCT+1 (MB), PRODUCT+2 (HB) ; @Entry: HSB in PRODUCT+2, MSB in PRODUCT+1, LSB in PRODUCT, ; address for results in INDEX DECIMAL3 LDY #003 BNE CLRHSB DECIMAL5 LDY #005 CLRHSB LDA #000 STA PRODUCT+2 BEQ DECIMAL DECIMAL7 LDY #007 DECIMAL STY DECPLACE DEY $1 LDA PRODUCT+2 BEQ $3 LDX #000 CMP #00A BCC $2 TAX LDA #000 JSR DIVx10 $2 STX PRODUCT+2 $3 LDX PRODUCT+1 JSR DIVx10 STX PRODUCT+1 LDX PRODUCT JSR DIVx10 STX PRODUCT ORA #030 STA TEMPVAL,Y DEY BNE $1 TXA ORA #030 STA TEMPVAL,Y LDX #000 $4 LDA TEMPVAL,X CMP #030 BNE $6 INX CPX DECPLACE BCC $4 BEQ $6 $5 LDA TEMPVAL,X $6 STA @INDEX,Y INY INX CPX DECPLACE BCC $5 TYA LDY DECPLACE STA @INDEX,Y RTS ;at Entry Xreg=LSB Dividend, Areg=MSB Dividend DIVx10 STX ZPGTEMP0 LDX #008 CLC $1 ROL ZPGTEMP0 ROL A CMP #00A ;Divisor = $0A BCC $2 SBC #00A $2 DEX BNE $1 ROL ZPGTEMP0 LDX ZPGTEMP0 RTS ;at Exit: Xreg=Quotient, Areg=Remainder ;Get device identification info GETDDATA LDY CURDRIVE GETDDAT2 LDX DEV0LIST,Y LDA SLOTLST,X ORA #030 STA SlotVal2 STA SlotVal3 TYA ASL A CLC ADC IBuffHB STA DevIDpg0+1 LDA DRVNLST,X LDX #013 LSR A BCS $1 LDX #009 $1 LDY #009 $2 LDA DRV0MSTR,X STA DEVICE,Y DEX DEY BPL $2 GSERIAL LDY #SerIdx ;$14 LDX #000 $1 LDA @DevIdpg0,y PHA INY LDA @DevIDpg0,y CPX #000 BNE $2 CMP #020 BEQ $3 $2 STA SerialNo,x INX $3 PLA CPX #000 BNE $4 CMP #020 BEQ $5 $4 STA SerialNo,x INX $5 INY CPY #SerIdx+SerLen ;$14+$13 BCC $1 STX SN_Len GREVISN LDY #RevisIdx ;$2E LDX #000 $1 LDA @DevIDpg0,y PHA INY LDA @DevIDpg0,y CPX #000 BNE $2 CMP #020 BEQ $3 $2 STA FirmWare,x INX $3 PLA CPX #000 BNE $4 CMP #020 BEQ $5 $4 STA FirmWare,x INX $5 INY CPY #RevisIdx+RevisLen ;$2E+$07 BCC $1 STX FW_Len GMODEL LDY #ModelIdx ;$36 LDX #000 $1 LDA @DevIDpg0,y PHA INY LDA @DevIDpg0,y CPX #000 BNE $2 CMP #020 BEQ $3 $2 STA Model,x INX $3 PLA CPX #000 BNE $4 CMP #020 BEQ $5 $4 STA Model,x INX $5 INY CPY #ModelIdx+ModelLen ;$36+017 BCC $1 STX MOD_Len ;Get Device Compatibility LDY #LBAidx ;$63 LDA @DevIDpg0,y ;Check for LBA support AND #002 ORA #001 ;Set for no CFA feature support TAX LDY #000 LDA @DevIDpg0,y CMP #08A ;Check for CFA Feature support BNE $6 ;Must have idetification bytes $848A in 1st word INY LDA @DevIDpg0,y CMP #084 BNE $6 LDX #002 $6 STX MODE_ID ;$01=device does not support either CFA feature set or LBA mode ;$02=device supports LBA mode and CFA feature set ;$03=device supports LBA mode but doesn't support CFA feature set ;Get Maximum PIO Mode supported by device GetPIO LDY #PIO1idx ;$6A LDA @DevIDpg0,y ;Check for advanced PIO support AND #002 BEQ Mode0_2 LDY #PIO2idx ;$46 INC DevIDpg0+1 ;Increment to next address page LDA @DevIDpg0,y ;Check for PIO mode >5 support DEC DevIDpg0+1 ;Restore current address page CMP #001 BCC Mode3_4 AND #003 ORA #034 BCS StorePIO ;always branches Mode3_4 LDY #PIO3idx ;$80 LDA @DevIDpg0,y ;Check for PIO mode 3 or 4 support AND #003 ADC #032 BNE StorePIO ;always branches Mode0_2 LDY #PIO4idx ;$67 LDA @DevIDpg0,y ;Check for PIO mode 0,1, or 2 support AND #003 ORA #030 StorePIO STA PIOmode GetCapcy LDY #CapacIdx+CapacLen+1 ;$72+$02+$01 LDX #CapacLen ;3 bytes long LDA @DevIDpg0,y ;check for capacity too large for 24 bits BEQ $2 LDA #0FF ;Set maximum drive size of 16777215 blocks $1 STA TOTSECT,x DEX BPL $1 LDX #007 LDA TooLrg,x STA TOTCAP,x DEX BPL $2 LDA #008 BNE $4 $2 DEY $3 LDA @DevIDpg0,y STA PRODUCT,x STA TOTSECT,x DEY DEX BPL $3 LDA PTHDRADR STA INDEX LDA PTHDRADR+1 STA INDEX+1 LDY #008 JSR DECIMAL ;Generate 8 digit decimal $4 STA TCAPLEN RTS ;Get Partition Table Block GETPTBL JSR ClrDates ;Clear partition table date display values JSR CLRCALL GPTABLE LDA #001 LDY #Num_Blks STA @BUFFCALL,Y LDA PTmapHB ;Set absolute sector address of partition map LDY #Sect_HB STA @BUFFCALL,Y LDY #ATA_Cmd LDA #ATACRead STA @BUFFCALL,Y JSR CALLDRVR BEQ $1 LDX #PTReadER JSR PRTPMPTM JSR InitPTbl LDA #000 STA CURDRIVE ;invalidate current drive selected JSR DevErrCk JMP ErrHndlr $1 LDY #000 $2 LDA @BUFFPG0,Y STA @PARTTBL,Y INY BNE $2 JSR GETCKSUM EOR @PARTTBL,Y ;Yreg=$00 BEQ InitRetn InitPTbl JSR ZEROPTBL LDY #ORIGDATE JSR REVDATE InitRetn RTS ;Clear the partition table dates display values ClrDates LDX #007 LDA #020 $1 STA ORGDATE1,X STA NEWDATE1,X DEX BPL $1 RTS ;Routine to pause before returning to main menu PAUSE LDX #ESC1B JSR PRTESCP BRK .BYTE 0CA .WORD READCON JSR ERRORCK JMP MAINMENU ;Initialize call block with zeros CLRCALL LDY CURDRIVE LDX DEV0LIST,Y SETCALL LDA DNUMLST,X STA CALLREF1 STA CALLREF2 STA DFMTREF LDY #006 LDA #000 $1 STA @BUFFCALL,Y DEY BPL $1 RTS ;Call Driver Routine CALLDRVR BRK .BYTE 083 .WORD BUFFCTRL STA ERRCODE BNE GDevErr STA Status ;$0 CLC RTS ;No error - Carry is clear and Areg = 0 GDevErr BRK ;Get error data from driver .BYTE 082 .WORD ERRSTAT BEQ DevErrCk JMP ERROR_YES DevErrCk LDA Status LSR A LDA ERRCODE RTS ;Return status ERR bit in carry and Areg = SOS call error (not zero) ;Status ;Err_Data - byte $0 = error code ; Bit 7 = BBK bad block has been detected ; Bit 6 = UNC uncorrectable error was encountered ; Bit 5 = 0 (undefined) ; Bit 4 = IDNF requested block ID is in error or can't be found ; Bit 3 = 0 (undefined) ; Bit 2 = ABRT command was aborted or an invalid command ; Bit 1 = 0 (undefined) ; Bit 0 = AMNF general error ;Err_Data - byte $1 thru $3 = block # (LB, MB, & HB) ;Err_Data - byte $4 = # of blocks left to complete command ;Convert binary value to hexidecimal ascii bytes routine ;at entry Areg contains binary value to convert BINHEX PHA AND #00F ORA #030 CMP #03A BCC $1 ADC #006 $1 STA GENERR PLA LSR A LSR A LSR A LSR A ORA #030 CMP #03A BCC $2 ADC #006 $2 STA GENERR+1 RTS ;at exit hex ascii values are in GENERR+1=HB, GENERR=LB WRITPTBL LDX #UPDATMSG JSR PRTMSG JSR WPTBLDAT BRK ;format call to initialize driver .BYTE 083 .WORD DFMTCALL JSR ERRORCK LDX #CmpltMsg JSR PRTMSG JMP Wait1sec WPTBLDAT JSR CLRCALL LDY #ATA_Cmd LDA #ATACWrit STA @BUFFCALL,Y LDA #001 LDY #Num_Blks STA @BUFFCALL,Y LDA PTmapHB ;set partition address LDY #Sect_HB STA @BUFFCALL,Y JSR CALLDRVR BNE $1 RTS $1 LDX #UPDATERR JSR PRTPMPTM JSR DevErrCk JMP ErrHndlr ;routine to revise partition table dates ;at entry Yreg=location in partition to place current date REVDATE LDX #004 $1 LDA YEAR,X STA @PARTTBL,Y INY INX CPX #008 BEQ $2 CPX #004 BEQ $4 CPX #006 BEQ $3 BNE $1 $2 LDX #002 $3 LDA #02F STA @PARTTBL,Y INY BNE $1 $4 RTS ;at entry address to decimal values in INDEX ;Xreg=index for length of decimal ie: $07 & $05 BINARY LDA #000 STA TEMPVAL STA TEMPVAL1 STA TEMPVAL2 STA TEMPVAL3 CLC LDY ITEM_LEN,X LDA @INDEX,Y BEQ $3 TAY DEY LDA @INDEX,Y AND #00F STA TEMPVAL DEY BMI $3 $1 LDA @INDEX,Y AND #00F BEQ $2 STA MLPLIER LDX TEMPVAL3 LDA MULTPCND,X STA MLPCND LDA MULTPCND+1,X STA MLPCND+1 LDA MULTPCND+2,X STA MLPCND+2 JSR MULTIPLY BCS $3 LDA TEMPVAL ADC PRODUCT STA TEMPVAL LDA TEMPVAL1 ADC PRODUCT+1 STA TEMPVAL1 LDA TEMPVAL2 ADC PRODUCT+2 STA TEMPVAL2 BCS $3 ;Range overflow $2 INC TEMPVAL3 INC TEMPVAL3 INC TEMPVAL3 DEY BPL $1 $3 RTS ;at exit - binary value is in TEMPVAL=LB, TEMPVAL1=MB, TEMPVAL2=HB Query0YN JSR PRTPMPTM QUERY_YN BRK ;Query user for Yes/No response .BYTE 0CA .WORD READCON JSR ERRORCK LDA INPUT AND #0DF CMP #Ascii_N BEQ $2 CMP #ESCAPE BEQ $2 CMP #Ascii_Y BEQ $1 CMP #RETURN BNE QUERY_YN $1 CLC $2 PHP LDA #01E JSR PRTBYTE PLP RTS ;at exit - carry is clear if response was yes ;carry set if response is no PROCEND .EQU * CODELEN .EQU *-CODELOAD