$GENERAL UTILITY FOR USING PX-8 FEATURES $WRITTEN IN DAN ROSS'S SIL ASSEMBLY LANGUAGE AUTOSEMI 1; CPU 2 DEF ^=#100 DEF WARM_BOOT=0 DEF BDOS=5 DEF COMMAND=#5D $1ST CHAR 2ND WORD IN CPM COMMAND DEF OBJECT=#6D $1ST CHAR 3RD WORD DEF LINE =#81 $0 WHEN NO COMMAND DEF CONSCRN1=#F0DD DEF CONSCRN2=#F0F1 DEF SYSTEM_PFKS=#F11A DEF OUT_STRING=9 DEF TAB=9 DEF LF=#A DEF CR=#D DEF STOP=#24 DEF CONOUT=#EC0C DEF ADCVRT=#EC72 A<-. LINE; A>>? :NO_COM IF0GO. DO_INSTRUCT A<-. COMMAND ?<.DE,INC,REPEAT) HL<- CONSCRN1; CALL SENDC HL<- CONSCRN2; CALL SENDC ENABLE; GO. WARM_BOOT :SENDC .HL->A; A+1->A; IF0RET A-1->A; A->C HL\/; CALL CONOUT; /\HL HL+1->HL; GO SENDC :SCREEN_MODE BYTE #1B,#D0,0,#27,9,#1B,#D1,0,#1B,#95,0 BYTE #1B,#D3,1,#1B,#2A,#FF,#FF,#FF,#FF BYTE #1B,#33,#1B,#D6,0,#FF; :SCREEN_MODE_END :PROGRAM_PFKS BYTE 11,"PX Battery",#D," " BYTE 10,"PX Screen",#D," " BYTE 10,"PX PFKeys",#D," " BYTE 10,"PX Inputs",#D," " BYTE 11," PFKoff",#1B,#D3,1,#D," " BYTE 15,"PX Temperature",#D BYTE 14,"PX Get Screen",#D," " BYTE 14,"PX Get PFKeys",#D," " BYTE 10,"ERA *.BAK",#D," " BYTE 10,"C:STAT A:",#D," " :DO_PF_KEYS DE<- SYSTEM_PFKS; HL<- PROGRAM_PFKS :COMM BC<- 16*10; (.HL->.DE,INC,REPEAT) HL<- PFK_DISPLAY; CALL SENDC GO. WARM_BOOT :PFK_DISPLAY BYTE #1B,#D3,0,255 :DO_IN_PORTS HL<- PORTS_USED :EACHR .HL->C; .CIN->A; HL\/ CALL WRITE_REG C<- " "; CALL CONOUT C<- " "; CALL CONOUT; /\HL HL+1->HL; .HL->A; ?<B; IF~0GO EACHB RET :DO_BATTERY C<- 3; CALL ADCVRT; A?\/ CALL WRITE_REG C<- "="; CALL CONOUT; /\A?; A?\/ A<-A- #D8; A<-A& #FC DE<- VOLTS; A->L; 0->A; A->H HL+DE->HL; CALL SENDC; /\A? ?<.DE,INC,REPEAT) GO. WARM_BOOT :TEMPERATURE A<-IN. 5 ?<OUT. 6 A<- 2; A->OUT. 1 :WAIT A<-IN. 5 ?<. #F1D6 $CHANGE DRIVE E: TO PHYSICAL DRIVE 1 DE<- #F24C; DE->. #F246 $GIVE DRIVE 1 THE NEW 320K DPB A<- #1F; A->. #F248 $INCREASE ITS ALLOCATION VECTOR BY 2 BYTES :XFER HL<- DPB_320K; BC<- 15 (.HL->.DE,INC,REPEAT) $PUT 320K DISK PARAMETER BLOCK IN NEXT VECTOR DE<- DISK_MSG; GO. FINISH :DISK_MSG BYTE "Drive 1 is 320k capacity till RESET. DON!T USE ON UNLOCKED 280K DISKS",STOP :DPB_320K BYTE #40,0,4,#F,1,#9F,0,#3F,0,#80,0,#10,0,0,0 $CF CPM MANUALS :DISKF A<- "3"; A->. DISK_MSG+8 $G: BECOMES PHYSICAL DRIVE 3 A<- 5; A->. #F1D8 $TO MAKE ROOM FOR NEW DPB DE<- #F26C; DE->. #F266 $GIVE DRIVE 3 THE NEW 320K DPB A<- #63; A->. #F268 $INCREASE ITS ALLOCATION VECTOR BY 2 BYTES GO XFER :DO_INSTRUCT DE<- BRIEF; DE->. NO_COM+1 DE<- INSTRUCTIONS; GO. FINISH :INSTRUCTIONS BYTE "When you have read these instructions, install the short version",LF,CR BYTE "by immediately issuing the CPM/M command SAVE 4 PX.COM which will",LF,CR BYTE "omit these instructions. The PX commands available will be",LF,CR BYTE "as follows (only the capitalized initials matter):",LF,LF,CR BYTE "PX Battery",LF,CR BYTE TAB,"reports the battery voltage +/- 1/8th volt",LF,LF,CR BYTE "PX Temperature",LF,CR BYTE TAB,"reports the internal temperature +/- 2",144," C",LF,LF,CR BYTE "PX Input",LF,CR BYTE TAB,"reports in ascending order the 16 Z80 input ports used by PX-8",LF,LF,CR BYTE "PX Pfkeys",LF,CR BYTE TAB,"redefines all 10 PFKeys to values saved in PX.COM",LF,CR BYTE TAB,"First use PX GET PFK to save your own defaults unless",LF,CR BYTE TAB,"you want to see PXNSTALL's defaults",LF,LF,CR BYTE "PX Screen",LF,CR BYTE TAB,"redefines screen and cursor modes as saved in PX.COM",LF,CR BYTE TAB,"First use PX GET SCREEN to save your current mode unless",LF,CR BYTE TAB,"you want to see PXNSTALL's defaults",LF,LF,CR BYTE "PX Get Pfkeys",LF,CR BYTE TAB,"then SAVE 4 PX.COM saves current PFKey definitions in a new PX.COM",LF,LF,CR BYTE "PX Get Screen",LF,CR BYTE TAB,"then SAVE 4 PX.COM saves current screen and cursor mode in a new PX.COM",LF,LF,CR BYTE "PX 320k 1 (or 3)",LF,CR BYTE TAB,"changes until next System Reset the Disk Parameter Block",CR,LF BYTE TAB,"of Floppy Disk Drive 1 (or 3) from 280k to the full 320k",CR,LF BYTE TAB,"available on the micro floppy disk.",CR,LF BYTE TAB,"Also Disk Drive E (or G) is changed to be Floppy Disk Drive 1 (or 3)",CR,LF BYTE TAB,"as areas reserved for FDD2 (or FDD4) are used by the new DPB.",CR,LF,LF BYTE "CAUTION: Don't use FDD2 (or FDD4) after this change.",CR,LF BYTE TAB," PF-10 users can't anyway--so it won't matter.",CR,LF BYTE "CAUTION: Writing on a 280k disk in the system after this reset will",CR,LF BYTE TAB,"destroy information already on it unless the disk has been",CR,LF BYTE TAB,"LOCKDISKed to 280k. Also, writing to a 320k disk in a system set for",CR,LF BYTE TAB,"280k will destroy information on the disk unless the disk",CR,LF BYTE TAB,"has been LOCKDISKed to 320k. The current setting of the system",CR,LF BYTE TAB,"can be discovered using C:STAT D:DSK:.",CR,LF,LF BYTE TAB,"Note that 2k bytes of those available are used by the directory.",CR,LF BYTE TAB,"A 320K DISK WILL NOT BE COMPATIBLE",CR,LF BYTE TAB,"with other models of EPSON computers, nor will a disk LOCKDISKed",CR,LF BYTE TAB,"to 280k. This is because the 320k system makes available",CR,LF BYTE TAB,"5 tracks (0-3,39) that are reserved for use by other EPSON models",CR,LF BYTE TAB,"but which are not used at all by a PX-8 280k system.",CR,LF BYTE TAB,"The directory area is shifted from track 4 to track 0.",CR,LF,LF BYTE TAB,"Unlocked 280k disks should be used to exchange information",CR,LF BYTE TAB,"with other EPSON owners and 320k or LOCKDISKed 280k disks",CR,LF BYTE TAB,"should only be used in your own system or with others in the know.",LF,LF,CR BYTE TAB,TAB,"USE OF LOCKDISK.COM",LF,LF,CR BYTE "LOCKDISK 320k",LF,CR BYTE TAB,"will write a fake full directory on track 4 so the disk cannot be",LF,CR BYTE TAB,"accidently changed by a 280k system. This fake directory appears",LF,CR BYTE TAB,"as R/O file 320KBYTE.DSK on the otherwise empty directory on track 0.",CR,LF BYTE "LOCKDISK 280k",LF,CR BYTE TAB,"will write a fake full 320k directory on track 0 so it cannot be",LF,CR BYTE TAB,"accidently changed by a 320k system.",LF,LF,CR BYTE "In the wrong system, a locked disk will simply have a full directory.",LF,CR BYTE "Locking a disk as 320k will destroy all files written",LF,CR BYTE "on it by a 280k system or by a 320k system,",LF,CR BYTE "and make it incompatible with other EPSON computers",LF,CR BYTE "that use reserved tracks 0, 1, 2, 3, or 39.",LF,LF,CR BYTE "Locking a disk as 280k will only destroy information",LF,CR BYTE "written on it by a 320k system. Old 280k files will",LF,CR BYTE "be preserved, but the disk may be incompatible with",LF,CR BYTE "other EPSON computers that use reserved track 0.",LF,CR,LF BYTE "Altering R/O files named 320KBYTE.DSK or 280KBYTE.DSK on",CR,LF BYTE "a locked disk will unlock it!",CR,LF,LF BYTE "A locked 320k disk relocked to 280k will be locked out both ways.",CR,LF BYTE "It is best to lock a freshly formatted disk one way or the other",CR,LF BYTE "and keep it that way, but OLD 280k DISKS WITH VALUED FILES SHOULD",CR,LF BYTE "BE LOCKED TO 280k TO PROTECT THE FILES FROM ACCIDENTAL DESTRUCTION",CR,LF BYTE "IF YOU PLAN TO USE THE 320k SYSTEM EVEN SOME OF THE TIME.",CR,LF,LF BYTE "A locked 280k disk can be made compatible with other EPSON models",CR,LF BYTE "again by copying the system tracks back onto it--which also unlocks it.",CR,LF BYTE "So keep at least one unlocked 280k disk with these tracks on it.",CR,LF,LF BYTE "If using COPYDISK to make copies of a 320k disk, be sure to copy",CR,LF BYTE "system tracks as well since they will have files written on them now.",CR,LF,LF BYTE "Be sure to keep a permanent copy of PX.COM where a 280k system can",CR,LF BYTE "access it. Else a system reset can make all your 320 disks inaccessible",CR,LF,LF BYTE "Now SAVE 4 PX.COM, or whatever you want to call it.",CR,LF BYTE "And don't use PX 3 - unless you understand what it does.",LF,STOP END #100  or whatever you want to call it.",CR,LF BYTE "And don