UDOS for an 8KW HP21xx Minicomputer ----------------------------------- UDOS is a tiny HP21xx minicomputer operating system for the VDRIVE USB disk module. It requires a suitable interface to translate commands sent by the HP into stream file operations, in summary... 120000 = 1010000000000000 read from VDRIVE, follow by read transfer 121bbb = 10100010bbbbbbbb write to VDRIVE, byte in low 8 bits of command 122000 = 1010010000000000 sync VDRIVE (call before starting operations) 123000 = 1010011000000000 clear VDRIVE 130000 = 1011000000000000 open read file, follow by filename[cr] 131000 = 1011001000000000 read from file, follow by read transfer 132000 = 1011010000000000 read using paper-tape emulator mode 134000 = 1011100000000000 open write file, follow by filename[cr] 135bbb = 10111010bbbbbbbb write to file, byte in low 8 bits of command 136000 = 1011110000000000 close write file (write remaining buffered bytes) 137000 = 1011111000000000 get usb_error value, follow by read transfer All commands except for the open file commands consist of a single command/flag cycle. The interface firmware responds to the command signal by fetching the 16 bit word from the HP output lines, doing what ever is indicated, if data is requested placing the data on the HP input lines, then briefly toggling the flag signal which clears the command signal, at which point the HP software can read whatever is on the input lines. The read from VDRIVE command returns 100000 octal if there is no data. The file open commands require additional command/flag cycles to transfer the filename, followed by a CR (ascii 13). File opens, reads and writes are buffered by the firmware since the VDRIVE requires fixed-size transfers. This command set is supported by the PIC-based USB disk adapter, operation with the original 8052-based VDRIVE mod requires a hack to implement the read using paper-tape emulator command (132000). The UDOS menu only has essential operations... 1) SAVE BINARY 2) ATTACH FILE 3) DOS PROMPT 4) RUN FROM 2 > Option 1 prompts for a filename then writes the entire 8KW memory from 2 to 17677 to the file in absolute binary (ABS) format. Note - if the file exists, the new binary is appended to the end rather than replacing the file. To replace an existing file use the DOS PROMPT option then use DLF [filename] to erase the file first. UDOS doesn't have a binary load, rather it opens the file for read and uses the firmware's "read as PTR" command so the HP's stock papertape loader can load the selected binary file. The attach option can also be used to attach IPL or data files to load into HP-IPL/OS (or other applications). Option 3 runs a raw VDRIVE dos shell. Useful commands include... DIR - list a disk directory DIR FILENAME - list information about a specific file DLF FILENAME - delete a file REN OLDNAME NEWNAME - rename a file (be careful, a PC will see the old name) RD FILENAME - list the contents of a file to the console (garbage if not text) CD DIRNAME - change to another directory (CD .. for up, CD / for root) MKD DIRNAME - create a new directory DLD DIRNAME - delete an empty directory FWV - print firmware version (at least 3.65 or 3.66 needed, current is 3.68) Refer to the Vinculum Firmware User Manual for more information. The VDRIVE supports many more commands but be careful as some cannot be used from an ASCII-based terminal and some commands can directly manipulate files and raw disk sectors. Use the FWV command before getting too far, if < 3.65 then the firmare in the VDRIVE2 module should be upgraded to avoid issues. Option 4 simply jumps to location 2 to rerun the host binary. With HP-IPL/OS this restarts HP-IPL/OS, with HPBASIC (and the UDOS mod) this starts the embedded BASIC program running. There are two versions of UDOS - The udos_c2.abs binary is a stand-alone version that loads at 17000 octal and can be added to HP-IPL/OS or about anything else not using the top 0.5KW of memory. The hhooks.abs overlay loads at 16400 octal and links to udos_c2.abs to provide stack pop/push and other code to easily access internal UDOS functions using RUN commands. The hhooks.ipl package implements simple file commands as HP-IPL/OS words. The udos_b2.abs binary is designed to be used with the preconfigured basic1.abs binary obtained from: http://oscar.taurus.com/~jeff/2100/index.html It loads between 16350 octal and the beginning of the HPBASIC drivers (17217), puts a jump to 5137 in locations 2/3 (autorun), puts a jump to UDOS in locations 77/76 to run UDOS when BYE is entered, and adjusts locations 106 and 116 to make room for UDOS. To install, load basic1.abs, load udos_b2.abs, then run from location 100. For more BASIC program memory remove the matrix functions as indicated in the udos_b2.asm comments. Binaries saved using UDOS will contain the interpreter plus BASIC code, run from location 2 to start the BASIC program. Running from 100 will erase the BASIC program for entering new programs. The binaries can be assembled using an HP cross assembler such as Eric Smith's Asm21 (http://www.brouhaha.com/~eric/software/asm21/). A modified version of Asm21 is included with the HP-IPL/OS testing archive (http://newton.freehostia.com/hpiplos_main_testing.zip), which also includes essential details for the VDRIVE interface(s), assembled versions of these files, and preconfigured HP-IPL/OS builds containing UDOS. Here is the stand-alone version that can also be used with HP-IPL/OS... --------- file udos_c2.asm -------------------------------- ASMB,A,B,L * * tiny dos for VDRIVE2 module 11/16/10 WTN * 9/25/10 - original version * 11/16/10 - with driver fix * HP-to-VDRIVE2 interface firmware commands... * 120000 = 1010000000000000 read from VDRIVE, follow by read transfer * 121bbb = 10100010bbbbbbbb write to VDRIVE, byte in low 8 bits of command * 122000 = 1010010000000000 sync VDRIVE * 123000 = 1010011000000000 clear VDRIVE * 130000 = 1011000000000000 open read file, follow by filename[cr] * 131000 = 1011001000000000 read from file, follow by read transfer * 132000 = 1011010000000000 read from file using paper-tape emulator mode * 134000 = 1011100000000000 open write file, follow by filename[cr] * 135bbb = 10111010bbbbbbbb write to file, byte in low 8 bits of command * 136000 = 1011110000000000 close write file * 137000 = 1011111000000000 get usb_error value, follow by read transfer * ORG 17000B TOMEM EQU 17700B Last memory location + 1 to save TTY EQU 11B TTY console slot USB EQU 12B USB adapter slot * jump targets JMP MENU main entry * hooks for calling subs externally DEF DOSPR dos prompt DEF ATPTR attach file to PTR DEF SVBIN save memory to file DEF G1BS get one byte from VDRIVE2 (if ready) DEF S1BS send one byte to VDRIVE2 DEF SYNC call VDRIVE2 sync code DEF CLEAR call VDRIVE2 clear-response code DEF ORF open read file, follow by filename DEF GSB get one stream byte from open file DEF OWF open write file, follow by filename DEF SSB send one stream byte to open file DEF CLO close write file DEF USTAT get status DEF S1W send one word to interface DEF R1W read one word from interface ** optional, use as needed... * DEF GSLN get and send line to VDRIVE2 * DEF GVDR get and print VDRIVE2 response * DEF RPTR read bytes via papertape emulation * DEF ORFN open read filename (type in) * DEF OWFN open write filename (type in) * DEF GSFN get and send filename (type in) * DEF WFVDR wait for one byte from VDRIVE2 (caution) ** var locations * DEF TEMPA last char pressed (to check if esc) * send one word to interface S1W NOP IF1 OTA USB IF2 STC USB,C IF3 SFS USB JMP *-1 IF4 CLC USB JMP S1W,I * receive one word from interface R1W NOP IF7 LIA USB JMP R1W,I * command 120xxx - get one byte from VDRIVE2 (bit 15 set if not ready) G1BS NOP LDA G1BCM JSB S1W JSB R1W JMP G1BS,I G1BCM OCT 120000 * command 121bbb - send byte bbb to VDRIVE2 S1BS NOP AND BMASK IOR S1BCM JSB S1W JMP S1BS,I BMASK OCT 377 S1BCM OCT 121000 * command 122xxx - sync with VDRIVE2 SYNC NOP LDA VSCMD JSB S1W JMP SYNC,I VSCMD OCT 122000 * command 123xxx - clear VDRIVE2 responses CLEAR NOP LDA VCLCM JSB S1W JMP CLEAR,I VCLCM OCT 123000 * command 130xxx - open stream file for read * must follow by sending filename + cr to interface ORF NOP LDA ORFCM JSB S1W JMP ORF,I ORFCM OCT 130000 * command 131xxx - get one byte from input stream file GSB NOP LDA GSBCM JSB S1W JSB R1W JMP GSB,I GSBCM OCT 131000 * command 132xxx - read bytes via PTR interface RPTR NOP LDA PTRCM JSB S1W JMP RPTR,I PTRCM OCT 132000 * command 134xxx - open stream file for write * must follow by sending filename + cr to interface OWF NOP LDA OWFCM JSB S1W JMP OWF,I OWFCM OCT 134000 * command 135bbb - send byte to output stream file SSB NOP AND BMASK IOR SSBCM JSB S1W JMP SSB,I SSBCM OCT 135000 * command 136xxx - close output stream file CLO NOP LDA CLOCM JSB S1W JMP CLO,I CLOCM OCT 136000 * command 137xxx - get USB status USTAT NOP LDA USTCM JSB S1W JSB R1W JMP USTAT,I USTCM OCT 137000 * console driver (adapted from HP-IPL/OS) * TTY input CHRIN NOP * LINKAGE LDB CMD2 * GET TTY INPUT COMMAND TTYP5 OTB TTY * SET INPUT MODE TTYP6 STC TTY,C * START TTY INTERFACE TTYP7 SFS TTY * GOT CHAR FROM CONSOLE? JMP *-1 * NO, KEEP CHECKING TTYP8 LIA TTY * GET CHAR FROM INTERFACE TTYPA CLC TTY * TURN OFF INTERFACE AND CON2 * AND WITH 7 BIT MASK JMP CHRIN,I * RETURN WITH CHAR IN A CMD2 OCT 160000 * TTY input command CON2 OCT 177 * TTY output CHROT NOP * LINKAGE LDB CMD1 * GET TTY OUTPUT COMMAND TTYP1 OTB TTY * SET OUTPUT MODE AND CON2 * AND WITH 7 BIT MASK TTYP2 OTA TTY * SEND CHAR TO INTERFACE TTYP3 STC TTY,C * SEND CHAR TO CONSOLE TTYP4 SFS TTY * INTERFACE DONE? JMP *-1 * NO, WAIT TILL DONE TTYP9 CLC TTY * TURN OFF INTERFACE JMP CHROT,I * RETURN FROM CHROT CMD1 OCT 120000 * TTY output command * mid-level subs... * wait for VDRIVE2 response and return byte * this probably isn't needed, could be needed by ext code * only use if expecting response or it'll hang WFVDR NOP WFVD1 JSB G1BS SSA JMP WFVD1 JMP WFVDR,I * initialize VDRIVE2, sync, send ECS[cr]IPA[cr], clear response VECS NOP JSB SYNC sync up with VDRIVE LDB VINIA get address of init string VECS1 LDA 1,I get doublechar SSA skip if sign is 0 JMP VECS2 done sending AND HIMSK ALF,ALF JSB S1BS send high byte to VDRIVE LDA 1,I get doublechar AND BMASK JSB S1BS send low byte to VDRIVE INB increment pointer JMP VECS1 loop to send more bytes VECS2 JSB CLEAR clear VDRIVE response JMP VECS,I exit sub VINIA DEF *+1 address of chars to send OCT 42503,51415,44520,40415 ECS[cr]IPA[cr] OCT 177777 terminate * get and send line to the VDRIVE2 one character at a time * no buffering, no backspace/editing - press ESC to abort * for sending filenames and dos prompt GSLN NOP GSLN1 JSB CHRIN get character from console CPA LFCHR is it a line feed? JMP GSLN1 yes - ignore, get next char STA TEMPA save character to compare JSB S1BS send character to VDRIVE2 LDA TEMPA get character that was sent CPA RTCHR was it a return? JMP RETEX yes - exit sub with a line feed CPA ESCHR was it escape? JMP ESCEX yes - escape exit JMP GSLN1 no - get more * exit code... double-check to make sure VDRIVE2 is good with this ESCEX JSB SYNC sync/clear VDRIVE2 error response RETEX LDB CRLFA send space space crlf JSB PRTXT JMP GSLN,I exit sub TEMPA OCT 0 RTCHR OCT 15 LFCHR OCT 12 ESCHR OCT 33 * get and print VDRIVE2 response GVDR NOP GVDR1 JSB G1BS get byte from VDRIVE2 SSA skip if bit 15 is not set JMP GVDR,I not ready - exit sub CPA LFCHR is it a line feed? RSS yes - listing file, skip print JSB CHROT print character CPA RTCHR is it a return character? RSS yes - skip next JMP GVDR1 no - loop for more LDA LFCHR get linefeed char JSB CHROT print it JSB DELAY delay a bit JMP GVDR1 loop for more output * delay sub DELAY NOP LDB MDELV get negative delay value DEL1 JMP *+1 waste time... JMP *+1 JMP *+1 ISZ 1 increment, skip if zero JMP DEL1 not zero - loop JMP DELAY,I MDELV DEC -20000 * get and send filename to interface GSFN NOP CLA FNLEN start with length = 0 GSFN1 JSB CHRIN get char from user STA TEMPA save to detect escape JSB S1W send to interface CPA RTCHR was enter pressed JMP GSFNR yes - exit sub with a line feed CPA ESCHR was escape pressed JMP GSFNE yes - jump to escape exit ISZ FNLEN no - increment filename length JMP GSFN1 loop for more chars GSFNE LDA RTCHR escape exit - send CRLF to console JSB S1W send CR to interface JSB CLEAR clear VDRIVE2 error response GSFNR LDB CRLFA JSB PRTXT print space space crlf JMP GSFN,I FNLEN OCT 0 length of filename * open read filename ORFN NOP JSB ORF send open read file command JSB GSFN get and send filename JMP ORFN,I exit sub * open write filename OWFN NOP JSB OWF send open write file command JSB GSFN get and send filename JMP OWFN,I exit sub * "dos" prompt... press ESC to exit DOSPR NOP JSB VECS initialize VDRIVE2 for "human" DOS1 JSB GSLN get chars and send to VDRIVE2 LDA TEMPA get last char pressed CPA ESCHR was it escape? JMP DOSPR,I yes - exit sub JSB DELAY delay a bit JSB GVDR print response JMP DOS1 get next dos command * attach file to PTR ATPTR NOP JSB ORFN open read filename LDA TEMPA get last char pressed CPA ESCHR was it escape? JMP ATPTR,I yes - exit sub JSB USTAT get USB status OTA 1 display status SZA,RSS skip if error JSB RPTR enable PTR mode if no error JMP ATPTR,I exit sub * save binary file in ABS format * saves from 2-17677 (all memory except for boot loader) SVBIN NOP * detect whether PTP or VDRIVE2 firmware... JSB CLO close write file CLA JSB SSB try to write a 0 byte JSB USTAT get status - should be error SZA,RSS if error skip to get filename JMP DOPTP no error returned, do a PTP-style save JSB OWFN open write filename LDA FNLEN get length of filename typed SZA,RSS skip if non-zero JMP SVBIN,I exit sub if nothing entered LDA TEMPA get last char CPA ESCHR esc? JMP SVBIN,I yes - exit sub JSB USTAT get USB status OTA 1 display status SZA skip if no error JMP SVBIN,I exit if error DOSAV JSB SZERB send 16 zero bytes (leader) LDA STADR STA MEMCT set starting address * encode loop SVB1 LDA ENADR LDB MEMCT CMB,INB ADA 1 A = end - counter STA REMWD save remaining words to do SZA,RSS JMP SVBEN if 0 then at end, finish write LDB RECSZ CMB,INB ADA 1 A = remaining - record size LDB RECSZ default record size SSA skip if complete record LDB REMWD number of words in last record STB RECLM save for record limit LDA 1 put in A JSB SSB write # words in record CLA JSB SSB write a zero byte LDA MEMCT get mem address STA CHKSM store in checksum AND HIMSK ALF,ALF JSB SSB send high byte of address LDA MEMCT AND BMASK JSB SSB send low byte of address CLA STA RECCT clear record counter * word loop SVB2 LDA MEMCT,I get word from memory LDB CHKSM ADB 0 STB CHKSM add to checksum STA 1 save mem word to buffer AND HIMSK ALF,ALF JSB SSB send high byte of word LDA 1 get buffered memory word AND BMASK JSB SSB send low byte of word ISZ MEMCT increment memory counter ISZ RECCT increment record counter LDA RECCT CPA RECLM done? RSS yes - skip to write checksum JMP SVB2 no - write more words LDA CHKSM AND HIMSK ALF,ALF JSB SSB write high byte of checksum LDA CHKSM AND BMASK JSB SSB write low byte of checksum JMP SVB1 loop to write another record * finish writing binary SVBEN JSB SZERB send 16 zero bytes (trailer) JSB CLO close write file JSB USTAT get status OTA 1 display status JMP SVBIN,I exit sub * do a PTP save - this works because the VDRIVE interface firmware is * very simple, disk commands have low byte clear so just adds leader DOPTP LDB PTPTA JSB PRTXT JMP DOSAV PTPTA DEF *+1 ASC 3,[PTP] tell user it's doing a PTP save OCT 6412,177777 STADR OCT 2 start address of save ENADR DEF TOMEM end address + 1 of save MEMCT OCT 0 mem counter RECCT OCT 0 record counter RECLM OCT 0 words in current record CHKSM OCT 0 record checksum * RECSZ OCT 33 record size (words in each record) RECSZ EQU ESCHR save a word REMWD OCT 0 remaining words HIMSK OCT 177400 high-byte mask (reuse BMASK for low mask) * sub to write leader/trailer SZERB NOP LDB NZERC get negative zero count SZER1 CLA JSB SSB send zero byte ISZ 1 inc counter, skip if done JMP SZER1 send more zero bytes JMP SZERB,I exit sub NZERC DEC -16 send 16 zero bytes * print subroutine, address in B * terminates if bit 15 of text word set PRPTR OCT 0 print pointer PRTXT NOP STB PRPTR PRTX1 LDA PRPTR,I get packed double char SSA skip if sign is 0 JMP PRTXT,I exit sub if sign set AND HIMSK ALF,ALF JSB CHROT print high byte LDA PRPTR,I AND BMASK SZA skip if zero JSB CHROT print low byte ISZ PRPTR inc print pointer JMP PRTX1 loop to print more * main menu MENU LDB MENPR JSB PRTXT print menu MENU1 JSB CHRIN get selection CPA OPT1 is it 1) save binary? JMP OPT1C yes - do it CPA OPT2 is it 2) attach file? JMP OPT2C yes - do it CPA OPT3 is it 3) dos prompt? JMP OPT3C yes - do it CPA OPT4 is it 4) run from 2 JMP OPT4C yes - do it JMP MENU1 no - get another keystroke OPT1 DEC 49 OPT1C LDB SVPRM JSB PRTXT print "SAVE TO: " JSB SVBIN JMP MENU OPT2 DEC 50 OPT2C LDB ATPRM JSB PRTXT print "ATTACH FROM: " JSB ATPTR JMP MENU OPT3 DEC 51 OPT3C LDB PRINS JSB PRTXT print dos prompt instructions JSB DOSPR JMP MENU OPT4 DEC 52 OPT4C LDB CRLFA JSB PRTXT JMP *+1,I OCT 2 MENPR DEF *+1 OCT 6412 ASC 7,1) SAVE BINARY OCT 6412 ASC 7,2) ATTACH FILE OCT 6412 ASC 7,3) DOS PROMPT OCT 6412 ASC 7,4) RUN FROM 2 OCT 6412 ASC 1,> OCT 177777 SVPRM DEF *+1 OCT 6412 ASC 5,SAVE TO: OCT 177777 ATPRM DEF *+1 OCT 6412 ASC 7,ATTACH FROM: OCT 177777 PRINS DEF *+1 OCT 6412 ASC 6,ESC TO EXIT CRLFP OCT 6412 OCT 20015 OCT 177777 CRLFA DEF CRLFP END --------- end udos_c2.asm --------------------------------- If loaded into HP-IPL/OS, the UDOS memory needs to be protected by entering: @BLK 17000 PUT @END 16777 PUT (unless already set lower by say Octapus) A word can be made to run UDOS... OCTAL DEFINE UDOS 17000 RUN END Here is a word that can be used to change the I/O slot used by UDOS... --------- begin dcon.ipl ---------------------------------- ; configure dos interface slots ; usage: slot DCON OCTAL DEFINE DCON 17000 17050 +DO ;addresses to scan (must be before TTY code) INDEX GET 170000 AND 100000 SUB IFZ ;if an I/O instr? INDEX GET 177700 AND OVER OR ;change the slot INDEX SWAP PUT ;write back to memory ENDIF +LOOP DROP 355 GET ;get TTY slot 17110 17170 +DO ;addresses to scan (must be after USB code) INDEX GET 170000 AND 100000 SUB IFZ ;if an I/O instr? INDEX GET 177700 AND OVER OR ;change the slot INDEX SWAP PUT ;write back to memory ENDIF +LOOP DROP END CONSOLE --------- end dcon.ipl ------------------------------------ More usage from HP-IPL/OS can be obtained by (assembling and) loading the following to provide a stack-based interface to the drivers with MS streaming support... --------- file hhooks.asm --------------------------------- * minimal UDOS hooks for HP-IPL/OS 9/26/10 ORG 16400B JMP DS1W 16400 RUN = send word to the interface JMP DR1W 16401 RUN = read word from the interface JMP DS1BS 16402 RUN = send byte to VDRIVE JMP DG1BS 16403 RUN = get byte from VDRIVE (bit 15=busy/end) JMP DSYNC 16404 RUN = sync VDRIVE JMP DCLR 16405 RUN = clear VDRIVE response JMP DORF 16406 RUN = open read file JMP DGSB 16407 RUN = read byte from file JMP DOWF 16410 RUN = open write file JMP DSSB 16411 RUN = write byte to file JMP DCLO 16412 RUN = close write file JMP REMSI 16413 RUN = redirect MS input from open file JMP REMSO 16414 RUN = redirect MS output to open file JMP DSTAT 16415 RUN = get status POP EQU 324B PUSH EQU 323B NEXT EQU 321B DS1W JSB POP,I pop the stack JSB 17016B,I send word to interface (S1W) JMP NEXT,I DR1W JSB 17017B,I get word from interface (R1W) JSB PUSH,I push to the stack JMP NEXT,I DS1BS JSB POP,I pop byte to send JSB 17005B,I send to VDRIVE JMP NEXT,I DG1BS JSB 17004B,I get byte/word from VDRIVE JSB PUSH,I push to stack JMP NEXT,I DSYNC JSB 17006B,I sync JMP NEXT,I DCLR JSB 17007B,I clear JMP NEXT,I DORF JSB 17010B,I open read file JMP NEXT,I DGSB JSB 17011B,I get stream byte JSB PUSH,I push byte to stack JMP NEXT,I DOWF JSB 17012B,I open write file JMP NEXT,I DSSB JSB POP,I pop byte from stack JSB 17013B,I send stream byte JMP NEXT,I DCLO JSB 17014B,I close write file JMP NEXT,I REMSI LDA GSBA,I redirect stream read to MS input STA 350B JMP NEXT,I GSBA OCT 17011 address with address of GSB subroutine REMSO LDA SSBA,I redirect MS output to stream write STA 351B JMP NEXT,I SSBA OCT 17013 address with address of SSB sub DSTAT JSB 17015B,I call get stat sub JSB PUSH,I JMP NEXT,I END --------- end hhooks.asm ---------------------------------- The memory used by the hooks package should be protected by entering: @BLK 16400 PUT @END 16377 PUT (unless already set lower by say Octapus) The following IPL code defines words that call the hooks... --------- file hhooks.ipl --------------------------------- ;minimal VDRIVE file access words for 8KW HP-IPL/OS w/ UDOS ;initial code 9/26/10 debugged 9/29/10 ;requires hhooks.abs loaded at 16400 to translate the RUN commands... ; 16400 RUN = send word on stack to the interface ; 16401 RUN = read word from the interface and pushes to stack ; 16402 RUN = send byte on stack to VDRIVE ; 16403 RUN = get byte from VDRIVE and push to stack (bit 15=busy/end) ; 16404 RUN = sync VDRIVE ; 16405 RUN = clear VDRIVE response ; 16406 RUN = open read file - follow by sending filename[cr] to interface ; 16407 RUN = read byte from file and push to stack ; 16410 RUN = open write file - follow by sending filename[cr] to interface ; 16411 RUN = write byte on stack to file ; 16412 RUN = close write file ; 16413 RUN = redirect MS input from open file ; 16414 RUN = redirect MS output to open file ; 16415 RUN = get status and push error code to stack ; OCTAL DEFINE $>VI ;send string to interface $LEN IFNZ DO $HEAD 16400 RUN $LEN WHILE $DROP ENDIF END DEFINE $>VD ;send string to VDRIVE module $LEN IFNZ DO $HEAD 16402 RUN $LEN WHILE $DROP ENDIF END DEFINE $>VC ;sends string + cr to VDRIVE $>VD 15 16402 RUN END DEFINE &WFD ;wait for response (1st byte of response discarded) DO 16403 RUN 100000 AND WHILE END DEFINE VECS ;sends ECS[cr]IPA[cr] to put in human mode 16404 RUN "ECS" $>VC "IPA" $>VC 16405 RUN END DEFINE PVDR ;print VDRIVE response DO 16403 RUN 377 AND DUP IFNZ DUP 12 SUB IFNZ DUP PCHR ENDIF DUP 15 SUB IFZ 12 PCHR ENDIF ENDIF WHILE END DEFINE VDIR ;lists a directory 16404 RUN VECS "DIR" $>VC &WFD CRLF PVDR END DEFINE VDEL ;deletes a file $LEN IFNZ 16404 RUN VECS "DLF " $>VD $>VC &WFD 16405 RUN ENDIF END DEFINE VSTAT ;pushes status to stack 16415 RUN END DEFINE VREAD ;usage: "file" VREAD - attaches file to MS input 16406 RUN $>VI 15 16400 RUN 16413 RUN VSTAT IFNZ " error " $PRINT ENDIF END DEFINE VAPPEND ;usage: "file" VAPPEND - sends MS out to a file 16404 RUN 16410 RUN $>VI 15 16400 RUN 16414 RUN VSTAT IFNZ " error " $PRINT ENDIF END DEFINE VWRITE ;usage: "file" VWRITE - erases and sends MS out to file $DUP VDEL VAPPEND END DEFINE VCLOSE ;closes a write file 16412 RUN END DEFINE VLD ;usage: "file" VLD - load an IPL file VREAD VSTAT IFZ OCT 177777 SVPRM DEF *+1 OCT 6412 ASC 5,SAVE TO: OCT 177777 ATPRM DEF *+1 OCT 6412 ASC 7,ATTACH FROM: OCT 177777 PRINS DEF *+1 OCT 6412 ASC 6,ESC TO EXIT CRLFP OCT 6412 OCT 20015 OCT 177777 CRLFA DEF CRLFP END --------- end udos_b2.asm --------------------------------- Install by overlaying the assembled .abs on top of basic1.abs and run from location 100. For more memory remove the matrix instructions as directed in the source code. Location 2/3 is set to a jump that automatically runs the BASIC program (if one exists) to preserve the program when reloading. With HPBASIC running, enter BYE to run UDOS. ----------------------------------------------------------- Last modified 11/19/10