Summary of words from HP-IPL/OS 1.65 (1/1/12) Base version... EXECUTE - pops stack and executes from address contained there RUN - pops stack and runs machine code there WBOOT - restarts hpiplos without running autostart words AND - pops stack twice, does bit-wise AND and pushes result OR - pops stack twice, does OR and pushes result XOR - pops stack twice, does XOR and pushes result ADD - pops stack twice, adds the two and pushes result SUB - subtracts 1st pop from 2nd pop and pushes res. (3 2 SUB pushes 1) MUL - pops two items from stack, multiplies and pushes results DIV - divides 2nd pop by 1st pop and pushes res. (6 2 DIV pushes 3) INC - pops stack, adds one and pushes results DEC - pops stack, subtracts one and pushes results ROL - pops stack, rotates left, pushes results ROR - pops stack, rotates right, pushes results ASL - pops stack, shifts left (lsb 0), pushes results ASR - pops stack, shifts right (msb 0), pushes results NOT - pops stack, reverses 1's and 0's and pushes results 2CPL - pops stack, does 2's compliment and pushes results DUP - pops stack and pushes twice, duplicating the top entry DROP - pops stack to nothing OVER - duplicates stack over current (1 2 OVER yields 1 2 1 on stack) ROT - swaps two items over current (1 2 3 ROT yields 2 1 3) SWAP - swaps the top two stack items GET - pops stack, gets memory there and pushes data PUT - a b PUT writes b to location a DO - pushes address of next instruction on return stack - starts a loop UNTIL - pops stack, if zero continues DO loop WHILE - pops stack, if not zero continues DO loop PNUM - pops stack and prints as a number CRLF - prints a new-line to the console DECIMAL - sets number-radix to 10 with leading zeros suppressed OCTAL - sets radix to 8, displays numbers as 6 digits BINARY - sets radix to 2, displays numbers as 16 digits SP>S - pushes stack pointer to stack (pushes 1st unused pos. BEFORE the push) SB>S - pushes stack base to stack XP>S, XB>S, YP>S, YB>S, ZP>S, ZB>S - pointer/base for X/Y/Z stacks >STEP - pops stack and sets +DO increment used by next +LOOP (do not use within nested loops unless outer loop inc is 1) +DO - pops startval and endval and sets up a loop INDEX - pushes current DO index +LOOP - adds one to index and if <> endval repeats loop DMPS - dumps the stack DEFINE name - starts a new word definition END - terminates a definition PCHR - pops stack and prints as a single character PWRD - pops stack and prints as a double-character $PRINT - prints string on the X stack IFNZ - pops stack, if not 0 continues else jumps to corresponding ELSE/ENDIF IFZ - pops stack, if zero continues else jumps to ELSE or ENDIF IF<0 - pops stack, if less than zero continues else jumps to ELSE or ENDIF ELSE - when run jumps to corresponding ENDIF ENDIF - terminates an IFZ/IFNZ/IF<0/ELSE block CASE - pops stack and searches for matching condition = < > <= >= <> - condition markers, must be followed by number, const or var DEFAULT - optional default condition marker for when no matches ENDCASE - terminates a case structure S>X - pops (system) stack and pushes to X stack X>S - pops X stack and pushes to system stack S>Y, S>Z, Y>S and Z>S provide same for Y and Z stacks X>>Y, X>>Z, Y>>X, Z>>X - string moves S>SR - pops stack and writes to Switch Register SR>S - reads Switch Register and pushes to stack $CPY - string copy from X to Y (leaving on X) $DUP - duplicates string on X $SWAP - swaps 2 strings on X $DROP - removes string from X $IN - inputs string up to CR and pushes (without CR) to the X stack $GET - n $GET gets byte# n from string on X and pushes to system stack $PUT - n b $PUT puts b into byte# n of string on X $LEN - pushes true character length of string on X to S $CREATE - n b $CREATE creates a string on X containing n bytes of b $ADR - pushes address of first element of string on X $XTEST - prints error message and restarts if value on stack is below XB $STR - pops stack and converts to a string on X CHRIN - inputs one character and pushes to stack RND - pushes random number to S $APPEND - pops stack and appends character to string on X $HEAD - removes 1st char from string on X and pushes to stack $TAIL - removes last char from string on X and pushes to stack $IN - inputs string up to but not including return to string on X $VAL - pops string on X and pushes value to stack (0 if not a number) $CAT - combines two strings on X into one string <>CON - resets I/O to console CONSOLE - like <>CON but also sets MS to papertape >PTP - redirects output to papertape punch MS - directs regular text output to mass storage BACI - sets print output to go to BACI interface TBG - pops stack and loads value into the tbg 1 for 1ms, 2 for 10ms, 3 for 100ms etc TBGZERO - zeros the tbg counter (locations 473 low, 474 high) !100MS - zeros/starts the TBG with 100ms count (autostarts) T>>S - pushes timer low, then pushes timer high TIME>>S - pushes 10ths, seconds, minutes then hours PTIME - prints elapsed time since last reset >WDT - pops stack and sets watchdog timeout (12 oct = 1 second) +WDT and -WDT - enable/disable watchdog !WDA - autostart word that indicates a timeout Tbg.ipl uses RENAME from extra.ipl to rename +IRQ to !IRQ when loading to ensure interrupts are enabled. Location 270 holds the default TBG slot. Default is slot 10. ---------------------------------------------------------------------- Double-word support in double.ipl file... (CREATE) n1high n1low n2high n2low DADD pushes high,low of n1 + n2 high low D2CPL pushes high,low of cmp(high/low)+1 (2's complement) n1 n2 EMUL - pushes high,low of n1(16)*n2(16) n1high n1low n2 EDIV - pushes result, remainder of n1(32)/n2(16) n1high n1low n2high n2low DSWAP - makes stack n2high n2low n1high n1low "decimal" $DVAL - converts decimal number string to high,low on stack high low $DSTR - converts high,low to decimal number string Requires HP2100/HP21MX. ---------------------------------------------------------------------- Double-word shifts/rotates in the bigshift.ipl file... (CREATE) These pop a double word and push a double word result. DASL - double arithmetic shift left (0-->bit 0, bit 31 remains) DASR - double arithmetic shift right (bit 31-->bit 30) DLSL - double logical shift left (0-->bit 0) DLSR - double logical shift right (0-->bit 31) DROL - double rotate left DROR - double rotate right Requires HP2100/HP21MX. ---------------------------------------------------------------------- DMS support in the dms.ipl file... (requires CREATE and 64KW+ HP21MX) !DMS - initialises DMS (autostarts) -DMS - disables DMS SDMA - sets DCPC ports A,B (DMA) to system map UDMA - sets DMA to user map adr UJUMP - jumps to address in user map adr SJUMP - jumps to address in system map page dmspage SPAGE - sets page (0-37) to dmspage (0-???) srcadr destadr wordcnt C>ACOPY - copies current map to alternate map srcadr destadr wordcnt A>CCOPY - copies alternate map to current map n USPACE - sets user space to 32KW block n (1st user block = 0) DMSTATUS - pushes value of DMS status register ABSLOAD - uses DMS to load ABS file from MS input into alternate map addr MSUSER - redirects MS in/out to the alternate map UPTR - psuedo-variable containing MSUSER pointer GOUSER - copies hpiplos to alt, turns off irq/auto and UJUMPs to 2 GOSYSTEM - copies hpiplos to alt, turns on auto and SJUMPs to 2 ALTSAVE - copies hpiplos to alt and adds swap/run code to 77000 ---------------------------------------------------------------------- Magnetic Tape support in the magtape.ipl file... (requires CREATE and DMS) MTINIT - initializes mag-tape drive MTREAD - pops length then address and performs DMA read from mag-tape MTWRITE - pops length then address and performs DMA write to mag-tape (example 24000 400 MTWRITE to write 400 words from mem at 24000) (use UDMA first and SDMA after to write data from alt mem) GAP - writes inter-record gap GAPMARK - writes gap and file mark to separate tape files FS1R - forward space one record BS1R - back space one record FS1F - forward space one file BS1F - back space one file RWLP - rewind to load point RWOL - rewind to off-line MTSTATUS - pushes mag-tape status word MTWAIT - waits for MT to finish last command ?MTERROR - prints MT error if error condition MTSCAN - lists mag-tape contents MTGEN - writes system to magtape Configured for 13181 controller in slots 14/15. ---------------------------------------------------------------------- Extra magtape support in the mtextra.ipl file... (requires MAGTAPE) These words define something like a Tape Operating System that allows magtape files to have descriptive names and records the lengths and load addresses (if binary) to allow easy loading. MTGEN and the HP-IPL/OS base was modified to place the version up front for easy retrieval, the data file format uses a header record based on the first few words of the system file format to permit the same code to display both HP-IPL/OS versions and data filenames. The "ID" record format is... (# in octal u.o.n.) 0 - 15400 (magic # 1) 1 - load address or 0 if text 2 - length of data record(s) 3 - number of data record(s), usually 1 4 - 6412 (magic # 2) 5 to 16 - 20(dec) character "filename" 17 - not used The data record(s) follow the ID record after a gap. Presently only one data record is used (for 2 records total) but you can write functions that process multiple data records if needed. IDREC - 16(dec) word array variable for storing ID records. MTDIR - displays magtape "directory", listing versions of HP-IPL/OS builds and filenames of 2-record "files", or number of records if either magic number is missing from the first record. DLTF - deletes last tape file after confirming. file# MTSEEK - skip to the specified file. file# MTBOOT - boots a HP-IPL/OS system magtape file. "Filename" startadr recordlen #records MMTID - make ID record and gap. "Filename" startadr endadr MTSAVE - save an area of memory to magtape. file# MTLOAD - "loads" the specified file, if system then boots, if binary loads into memory, if text copies to the alternate map then redirects into the console to load IPL files. "Filename" ByteLen MS2MT - copies MS input to magtape file. Note.. length in bytes must be exact! file# MT2MS - copies magtape file to MS output "Filename" block# #words B2MT - write block memory to magtape file. file# block# MT2B - read magtape file into block(s) file# MTSHOW - read magtape file into alt. map and display as text. "DefName" D2MT - writes high-level definition to magtape file. In the mtbackup.ipl file... MTBACKUP - saves magtape to simh-compatible MT file attached to MS out MTRESTORE - restores or adds MT file attached to MS in to magtape Note... recently I found that MTBACKUP no longer functioned under sim (and likely never worked on real hardware), did scary stuff to it to make work again.. beware. Also newer simh hp2100 sims write large gaps of 376 377 377 377 sequences between records, MTRESTORE was not programmed to handle these. MTRESTORE was designed to input the output of MTBACKUP, or the output of the MAKE_MT.BAS utility. ---------------------------------------------------------------------- 12555 XY Display support in the n_rocks.ipl file... (requires CREATE) address length +XYDISPLAY - show a display list -XYDISPLAY - turn off the display DLRESET - zero the display list to start a new graphic. Known bug - when the display list is short (or zero) the clock will stop and the processor slows. After longer than 10 or so entries things smooth out. @DLBASE - variable containing the address of the display list @DLP - variable containing the (relative) display list pointer, normally indicates display list length @DLD - variable containing default intensity (default=2) @DLI - variable containing current intensity (default=2) Intensity = how many DL entries per plotted pixel. With M-series machines this can (probably) be set to 1. The 12555 is not fully compatible with E/F series machines, set @DLD and @DLI to 2. @BLANK - indicates if XY display has blanking, set to 0 if not @X and @Y - variables for X and Y coordinates n PEN - set intensity to n PEN- - set intensity to 0 (no plot, useful for moving the pen) PEN+ - set intensity to default x y PLOT - plot pixel x,y and set the @X/@Y variables. x y UNPLOT - remove (all) pixel(s) x,y "dir" n DRAW - draw a line from the current @X/@Y n pixels long. "dir" can be "N" "S" "E" "W" "NE" "SE" "NW" or "SW". Does not plot the 1st pixel to avoid double-plotting junctions, use PLOT to start it off. Example 30 30 PLOT "E" 20 DRAW "N" 20 DRAW etc. @FROM and @TO - variables specifying from-to addresses for XYMOVE x y XYMOVE - add x and y to memory from @FROM to @TO (caution!) PEN++ - performs PEN+ and plots current @X/@Y (used by $XYPRINT) @FSIZE - controls $XYPRINT "font" size, specifies base size of segments. Each letter is @FSIZE * 2 wide/tall with @FSIZE pixels to the left and below. "STRING" $XYPRINT - prints text to the XY display at @X/@Y XYHOME - positions @X/@Y to print text starting at the top left XYCRLF - moves to the next line x y seg OCTAGON - draws an octagon, seg specifies segment size N_ROCKS - an XY display demo, pops stack and loops that many times Configured for XY display in slot 20. ---------------------------------------------------------------------- HPIB support in the hpib.ipl file... CBUS - SENDS A CONTROL WORD TO THE 59310B INTERFACE ?BUS - GETS A STATUS WORD FROM THE 59310B INTERFACE >BUS - TRANSMITS A BYTE OVER THE HPIB BUS FP - parses string and pushes fp fp FP>$ - pushes string with fp value fp FSGN - pushes -1, 0 or 1 for fp sign/zero fp FSQR - pushes fp square root Example... calculate 4.56/1.23 + 2.34 and print results... "4.56" $>FP "1.23" $>FP FP/ "2.34" $>FP FP+ FP>$ $PRINT 6.04732 (a calculator gives result as 6.04731707317073...) ---------------------------------------------------------------------- Terminal support The screen.ipl file provides basic VT100/ANSI support words... ESC - outputs ascii 27 followed by [ to start esc sequences row column POS - positions cursor for next print CLS - clear the screen forground background COLOR - sets print/cls color (some terms don't allow setting background and parm is ignored) -COLOR - go back to normal screen colors Requires double.ipl, POS uses the $DSTR to convert to decimal. The hpscreen.ipl version supports selecting HP or ANSI terminal... TTYPE - variable w/ terminal type, 0 for HP (default), 1 for ANSI TERMINAL - toggles terminal type (color not supported in HP mode) For HP2645 graphics terminals the hp2645.ipl file should be loaded and *GT run to select a normal text display. ---------------------------------------------------------------------- Printer support in the print.ipl file... !LPT - patches slot to location 277, container for subroutines CKLPT - reads LPT device and pushes status (0 means not available) MSLPT - sets MS out to LPT device (CONSOLE to undirect) +PE - echos all console I/O to printer -PE - disables printer echo byte >LPT - sends a single byte to the printer "string" $LPT - sends a string to the printer NLPT - sends a newline (CRLF) to the printer Defaults to an interface in slot 20, to change use CONFIG (or change location 277) then 2 RUN to restart. This is experimental, it works with the SimH HP2100 LPT device but may not work with all hardware. The +PE word does a call to CKPRN to check status and does nothing if 0 is returned, to disable this check the first 3 instructions after "WA" should be cleared... "+PE" $DEFADR PNUM (prints an address) address+1 0 PUT address+2 0 PUT address+3 0 PUT ...for example if 53200 printed do 53201 0 PUT 53202 0 PUT 53203 0 PUT (be very careful! a typo can corrupt the system in memory) As with any console stream driver disable (-PE or 2 RUN) before removing. If mixing with other console drivers enable/disable them in nested order. ---------------------------------------------------------------------- Alternate-Memory utilities altutil.ipl contains... ZAM - Zero Alternate Memory (stand-alone version) HLT - halts the computer for attaching, swapping, etc ALTRUN - runs system in alt mem (ALTSAVE must have been run first) RUNABS - Load and run an ABS attached to MS input (PTR) PTHEADER - Writes 8 zeros to MS output (PTP) (used by ALTABS) from to AAOUT - Writes alt mem to MS out in ABS format ALTABS - Saves alt mem to ABS file attached to MS out from to ALTDUMP - Dumps alt mem to terminal CLRHALT - Saves system to alt mem, halts with empty system ALTHALT - Swaps system with system in alt mem then halts fcam.ipl contains... (req's altutil.ipl) _FLG _XFR _LNZ _CNT - variables used by these words _MCZ - variable containing max consecutive zeros for FCAM FCAM - find Code in Alt Mem address value APUT - puts value into altmem address AGET - pushes value from altmem ?MSOUT - prints current MS out redirection - default MS out = PTP _PAD - variable containing # of pad words for AM2ABS _CBD - variable containing code boundary for AM2ABS _TRA - variable containing transition address between pad/boundary AM2ABS - saves contents of altmem to ABS file attached to MS out F2ABS - wrapper for AM2ABS that loads file into altmem then runs AM2ABS ---------------------------------------------------------------------- Utilities for encoding/decoding text binaries... These can be useful for saving binary code from real hardware when there is no PTP interface to send it out the usual way, also can be useful for loading binaries when the PTR emulator requires burning eproms etc by pasting the encoded binary to the console with suitable delay settings (HyperTerminal etc). CONGEN in congen.ipl - does a 'sysall' to console as text L2ABS in log2abs.ipl - converts text-binary on MS in to ABS binary on MS out LDENC in ldenc.ipl - loads/runs text-binary from MS in conalt.ipl contains... startadr endadr ALTENC - encodes alternate memory as text CONGEN - same as stand-alone version but using ALTSAVE ALTENC ALTGEN - encodes specified range in alt-mem as text CONALT - "loads" text-binary pasted to console into alt-mem. bkfile.ipl contains... (requires conalt.ipl) "FILE" BKFILE - encodes a file as text "FILE" REFILE - restores encoded text to a file ---------------------------------------------------------------------- Disk driver support in the disk.ipl file... word >IDE Send Command to interface FILE - redirects MS output to a buffered file for writing buffer bytepos SEEK - sets file pointer in a buffer to specified byte buffer CLOSE - closes specified buffer (reloading dir block) "filename" buffer CNF - creates new file in specified buffer "filename" buffer DEL - deletes a file in specified buffer srcbuf destbuf BCOPY - copies buffer to buffer, both must be open buffer RELEASE - releases specified buffer (marks buffer as unused) -SFS - turns off SFS, abandoning all buffered directories and files ?SFS - shows status of SFS buffers SFS is based on buffer states, DIRECTORY can only be used if the buffer is not being used or contains a previous directory. OPEN/REOPEN/CNF/DEL can only be used if a directory is buffered, FILE and CLOSE can only be used if a file is open, afterwards the directory is reloaded. RELEASE immediately abandons the specified buffer regardless of state. Note - don't perform direct manipulation of disk structures unless all related buffers are released first. Otherwise SFS will have stale data in memory. For safety, SFS programs should RELEASE buffers when done with them. Always make sure all buffers are released (-SFS) before saving a build to make sure it doesn't start up with open files (generally not good). Visible variables... CWA - Control Word Array containing control words for each buffer FPA - File Pointer Array containing byte pointers for buffered files FSA - File Size Array containing byte file sizes for buffered files FCA - File Control Array containing FCW's for buffered files LAA - Load Address Array containing LA's for buffered files RAA - Run Address Array containing RA's for buffered files FNA - File Number Array containing file numbers of buffered files DNA - Drive Number Array containing drive #'s of buffered files or dirs VNA - Volume Number Array containing volume #'s of buffered files or dirs FSS - File System Status variable containing status of last operation (0=ok) NDEA - Number of Directory Entries Array (from block 6) DBLA - Directory Block Low Array (from block 6) DBHA - Directory Block High Array (from block 6) FSLA - File Space Low Array (from block 6) FSHA - File Space High Array (from block 6) CWA, FPA, FSA and FSS are actually located in zero page, the high level "variables" are constants that push zp addresses, ie FPA INC GET pushes file ptr for buffer 1. CWA bits... (1) Bit 0 - if 1 then a file is loaded into buffer (busy) (2) Bit 1 - if 1 then a directory block is loaded into buffer (4) Bit 2 - if 1 then a volume index block is loaded into the buffer (when???) (8) Bit 3 - if 1 then buffer is dirty (file changed, needs writing upon close) FSS values... 177777 - programming error (incorrect parms) 171717 - non-existent buffer specified (DIRECTORY) 000010 - file not open error 000011 - DMS not enabled error 000012 - buffer busy error 000013 - dir not loaded error 000014 - file already open in another buffer error 000015 - file already exists error 000016 - invalid directory error 004XXX - device error, XXX = error code from L - saves definition to buffered library "NAME" A>L - copies IPL text from alternate memory to the library "NAME" L>A - copies a library "file" chunk to alternate memory "NAME" MS>L - copies MS input to the library (terminates when 0 received) Note - Library IPL files must end with LIBEND to run and forget. No conversion is performed by MS>L etc, if importing existing run-and-forget-compatible packages change final CONSOLE to LIBEND. Library file format... ;;;FILE:SegmentName: [IPL code or other text lines] LIBEND [additional ;;;FILE -- LIBEND segments] Maximum line length for IPL code is 76 characters + CRLF (78 characters for non-IPL text when using A>L and L>A). Previous versions of the library used a 128 byte to mark the end of a library file. This version has no terminator and instead uses the 0 returned by SFS when reading past EOF. Maximum library size is 177774 bytes, if that size is displayed by LDIR then the last segment is probably broken, "Name" LFORGET to remove. Before the library can be used enter a command like $VOL "LIBRARY" SETLIB to define and create an empty library file. The setting is saved with the build, but be sure to -SFS to shut down SFS before using XSAVE or DGEN. When the build is reloaded enter LIB to open the default library. The library save words automatically form the ;;;FILE tag from the specified name string. Single self-contained high-level words can be added to an open library using "Name" D>L with no further effort, however every word/variable used by the target word must be in the dictionary. Note... the library contents are immediately available, but nothing is actually written to disk until LCLOSE is used. If an error occurs enter -SFS to abandon the changes. If compatibility with L>A is not important and the package is for load-only, existing IPL disk files ending with CONSOLE can be added to the library as-is by copying to alternate memory ("File" F2AM) then using "Name.IPL" A>L to copy to an open library. The .IPL is just to remind that it's a load-only package, don't try to run it with R. It's better to replace CONSOLE with LIBEND (on a line by itself, no leading spaces) to avoid possible bugs. To save space in the library remove comments and unnecessary spaces. Run-and-forget library apps must be composed so that the library name is the same as the name of the first definition, which must be the word that runs the app, and must end with LIBEND to trigger processing. There must not be an immediate CONSOLE or the load will halt without running, leaving the app in the dictionary. Generalized run-and-forget segment... OCTAL DEFINE Name ;Name = library segment name "MAIN" $DEFADR DUP IFZ DROP ELSE EXECUTE ENDIF END VARIABLE VarName ;any variables required by the app DEFINE SubWord ...word required by the app but might not be in the dictionary END ...any other words needed by the app DEFINE MAIN ;named to match $DEFADR string ...main app code here END LIBEND Existing run-and-forget-compatible apps like fed.ipl are already in this format and only require changing the ending CONSOLE to LIBEND, but for best results the comments should be removed to take up roughly half the space. Library segments can be composed with FED/AEDIT and saved to a file, then debugged using XLOAD (LIBEND is equivalent to CONSOLE), once functional add to the library using F2AM then A>L. Or just "Name" A>L if still in alt mem (like if merely changing CONSOLE to LIBEND). Library code can be composed using a PC editor (CRLF line ends), attaching to PTR and doing [MSPAPER if MS not paper] "File" MS>L to copy to an open library. See the comments in sfslib.ipl for more information. ---------------------------------------------------------------------- Full-screen "array" editor in the fed.ipl and fedutil.ipl files... Requires DMS, [hp]screen.ipl, disk load/save requires XDOS The LDTXT utility also requires SFS. AEDIT is an alternate memory editor capable of composing text and IPL code. To keep things simple each line is 78 characters long plus a CRLF, accessed 23 lines at a time. This limits the maximum file size to 782 lines (34 pages) but this is sufficient for most applications. The data must be in array-format to be editable, utilities are provided for converting regular text to and from the array representation. AEDIT resumes editing array data in alt-memory where last exited, or from the beginning if no array data present. Once an IPL file has been created it can be loaded into the dictionary using: 2 MSUSER restart to take effect 357 - PTR (reader) slot / 300 - buffer pointer for CONIN, TOKEN 301-305 - stack pointers for S,R,X,Y and Z 315 - @TL - token length - length of word found by TOKEN 316 - @TB1 - token buffer 1 - 1st 2 chars of word 317 - @TB2 - token buffer 2 - next 2 chars of word 321 - link to NEXT - JMP 321,I to return to HPIPLOS 323 - link to SPUSH - JSB 323,I to push A to sys stack 324 - link to SPOP - JSB 324,I to pop sys stack to A 325-334 - similar links to push,pop for R,X,Y and Z 337 - link to CHROT(*) - JSB 337,I outputs A to console 340 - link to CRLF - JSB 340,I prints crlf to console 341 - link to CHRIN(*) - JSB 341,I to get char from console to A (* can be changed to change console to a different device) 342 - link to PTWD - JSB 342,I to print A as 2 characters 343 - link to PBFL - A=w.length, B=addr, JSB 343,I to print "string" (not a HPIPLOS string, but for printing ML messages) 344 - link to PTRIN - JSB 344,I to get byte from PT to A 345 - link to PTROT - JSB 345,I to write byte in A to PT 346 - ZIN vector - normally points to CHRIN for input 347 - ZOUT vector - normally points to CHROT for output (all user input/output goes thru ZIN/ZOUT - redirectable to console or papertape using <>CON, PTP definitions) 350 - ZMINP or MS input vector - default PTR 351 - ZMOUT or MS output vector - default PTP 410 - holds the current number radix for reading, don't write to since tables and everything needs to be changed to change radix. 435 - holds value for end of input buffer (614) 436 - holds value for start of input buffer (500, note previous location 477 must contain a space for proper operation) 437 - holds start of system stack (620) 440 - holds end of system stack (777) 441 - holds start of return stack (1000) 442 - holds end of return stack (1177) 443 - holds start of X stack (1200) 444 - holds end of X stack (1377) 445 - holds start of Y stack (1400) 446 - holds end of Y stack (1577) 447 - holds start of Z stack (1600) 450 - holds end of Z stack (1777) 451 - @DIC - holds start of dictionary (4000) 452 - @USR - holds start of user dictionary 453 - @BLK - holds the end of dictionary space+1 454 - @END - holds the end of hpiplos memory 457 - address of warm-boot machine code 460 - prompt copied to 464 on startup (default "? ") 461 - global interrupt enable, set/reset by !IRQ/-IRQ 462 - IENAV - interrupt enable vector, JSB IENAV,I instead of STF 0 463 - contains the address of the sign-on message (starting w/crlf) 464 - current prompt 465 - if non-zero autostarting is enabled 470 - holds address of PIOCS subroutine, A=patchlist, B=new slot# 471 - holds address of CHRIN subroutine 472 - holds address of CHROT subroutine 473 - timer low (tbg option) 474 - timer high (tbg option) 475 - link to interrupt save sub (ISAVE) JSB ISAVE,I to save state 476 - link to interrupt restore sub (IREST) JSB IREST,I to restore HPIPLOS string format... addr highbyte lowbyte 1200 H E "HELLO" is first string on X 1201 L L 1202 O ? 1203 5 character length = 5 1204 4 word length for easy copying Memory map including Octapus... (32K version, numbers in octal) 2-3 Jump to 2000 10-37 contain JSB dummy,I links to avoid interrupt errors 40-77 various irq/etc stuff added by some options 100-147 Reserved for the user 150-177 Temp memory used by some IPL utility words 200-237 SFS zero-page variables 240-257 Vectors for disk driver 260-477 Zero page constants, links, variables 500-615 HP-IPL/OS input buffer 620-777 System stack 1000-1177 Return stack 1200-1377 X stack 1400-1577 Y stack 1600-1777 Z stack 2000-3777 Core HP-IPL/OS code 4000-??? Dictionary @BLK-@END(*) Up to 16 1K-word memory blocks (typically 2-4 used) 70000-72377 OCTAPUS-E 72400-76377 Room for drivers buffers display lists etc (**) 76400-77037 Alt-mem swap/run buffer/program, entry at 77000 77040-77677 More room for drivers buffers etc 77500-77677 128 words for transient code (boot/load/page/etc) 77700-77777 Actual HP bootrom (*) the @END location determines last block location, default 67777 @BLK determines 1st block location, set by ALLOCATE (**) entire range from 72400-77677 can be used for user programs/data but some HP-IPL/OS operations may overwrite memory over 76400. Memory above 75777 is not preserved by DGEN XSAVE MTGEN etc, and the stock SYSALL word for making ABS files does not save anything over 72377 (modifying to save more is trivial - change the '72377' value to something else). For short machine code sequences the best way to preserve it is encode it into an autostarting IPL word using the MKLDR or MKCLDR utilities, or simply push the code to the stack and use a +DO loop to PUT it in memory where needed. Here's a chart of ZP temp usage as of 1.65... (if I didn't miss any..) xutils.ipl ABS2F 157 ldenc.ipl LDENC 150 life.ipl LIFE 110-121 mkhpasm.ipl MKHPASM 175-176 msupatch.ipl MSUPATCH 150 n_rocks.ipl N_ROCKS 112-125 altutil.ipl ALTRUN 150-151 RUNABS 150-151 ALTABS 150-155 AAOUT 152-153 ALTDUMP 150-151 CLRHALT 150 ALTHALT 150-151 binpatch.ipl BINPATCH 150-155 bugs2.ipl BUGS 100-107 conalt.ipl all words 150 cylons.ipl CYLONS 100 dm2.ipl DMENU 150-156, 157 when calling ABS2F dmenu.ipl DMENU 150-156 fcam.ipl AM2ABS F2ABS 152-153 (AAOUT) sfslib.ipl A>L MS>L 150 sham.ipl SHAM 150-151 siobcs.ipl FOR2 150 sioutil.ipl SIOPATCH 150, 152-153 (AAOUT) cross.ipl all words 150-155 ---------------------------------------------------------------------- Thread Details -------------- HP-IPL/OS uses an indirect-threaded interpreter that implements a system stack (S), return stack (R) and 3 auxillary stacks (X Y and Z). Word Address (WA) is the address HP-IPL/OS interprets to run a word, it contains the Code Address which points to actual machine code. If pointed to the ENSEC code, the current WA+1 is pushed to the return stack and the code following it is interpreted until RTSEC is encountered which pops the return stack, returning execution to the previous thread which called the "high-level" definition. Low level definitions generally have the next address in the WA location (DEF *+1), the machine code executes until an indirect jump to the NEXT code (JMP ZNXT,I) is executed. Definition names are encoded to save space, only the first four characters and the length are significant. Don't use names like TEMP1 and TEMP2 together, to HP-IPL/OS they are equal. Low-level definitions are encoded in the dictionary like... length <--- prev. link (or beginning of dictionary) first 2 characters of name next 2 characters of name link to next definition >---. WA ------> code address >----------. | 1st ML instruction <----' | remaining ML instructions | JMP ZNXT,I to return | (optional data) | next length or 0 <--------' High-level definitions (beginning with ENSEC) are encoded like.. (using the example DEFINE TEST[cr]"HELLO " $PRINT 7 PNUM END) 4 length <---- link from prev. definition "TE" first 2 characters "ST" next 2 characters .--< link to next definition WA----|--> address of ENSEC | address of the string push code | 4 length in 16-bit words | "HE" | "LL" | "O " | 6 character length of the string | address of $PRINT | address of literal push code | 7 | address of PNUM | address of RTSEC `--> next length or 0 ---------------------------------------------------------------------- HP-IPL/OS main page: http://newton.freehostia.com/net/oldcomp/hp2100/ Testing and updates page: http://newton.freehostia.com/net/hpiplos.html Terry Newton (wtn90125@yahoo.com)