^ma5 75^pl-62 0 0 ^ceTAPE FILE DESCRIPTIONS John R Baker ^sk2^ceMNEM2 ^sk1^paThis TEXT file is the HP71 CPU Instruction Set, sorted by HEX. Instructions on the 71 range in length from 2-18 nibbles (1-9 bytes). The sort is thus based on the first byte. Wherever Field Selection or a Jump Distance is concerned, I substituted 0 or 8. For further information, see IDS Volume 1, Chapter 16; or Hardware IDS, Chapter 4. NOTE!, Early versions of IDS Volume 1, Chapter 16 had numerous errors in the opcodes, the Hardware IDS has all errors corrected. This set is correct, if you compare to early IDS and discover a difference. I got the incorrect IDS in June 1984. ^sk1^ceBEEPLEX AND BEEPLEXT ^sk1^paBEEPLEX is the assembled LEX file and BEEPLEXT is the source TEXT file. I wrote these as an exercise in using the piezo-electric beeper. The file has four keywords; CHIRP, MGUN, SING, and ZAP. They are all Statements and none take parameters. ^sk0CHIRP, makes a 'chirping' sound which I'm sure will be familiar. ^sk0MGUN, is merely a loop counter for a bunch of Chirps. It has a sort of 'phasor' sound. ^sk0SING, gives a upward sweeping tone. It is just a loop counter which increments the frequency each pass. ^sk0ZAP, is a downward frequency sweep followed by a low tone. ^paIf you are new to Assembly language, study the comments in the source files. If you don't have the IDS, there is enough about entry and exit conditions to be helpful. ^sk1^ceCURLEX AND CURLEXT ^sk1^paThis file was written for Richard Nelson of CHHU to move the cursor in the HP71 display 21 positions left or right. I should have trapped out CALC mode, it was not intended to work there. In CALC mode, many system pointers have totally different meanings. This file can be easily customised (like any other on this tape). The file is a poll handler that is active whenever it is in memory, a 'keys' file is not needed. Every time a key is pressed a poll is issued, we answer the poll and test if USER mode is active and whether the blue shifted left or right arrow keys were pressed. If so we save some stack levels (we need more than there are), then we send the escape sequence for left or right cursor 21 times as controlled by a loop counter. There are many other ways to do it but this one is friendly to HPIL display video. We then restore the hardware stack levels we saved and exit the poll. Notice some housekeeping we do as exiting. ^ad ^sk2^ceCOMLEX AND COMLEXT ^sk1^paThis is a combined (for me that is ) LEX file. I wrote it last September and October (I didn't know about CHHU, PPC had it and did not publish it). It contains ten keyword, Statements and Functions as follows: ^sk0CLOCK, a Statement, displays a running clock in the LCD, sending to HPIL was too sluggish. Pressing the 'ON' key returns to the BASIC main execution loop. ^sk0CMDSTKQ, A numeric Function, takes no parameters, and returns the current command stack size as 1-16 decimal. In BASIC you may do something like C=CMDSTKQ, set variable C to the Command Stack size. ^sk0CMDSTK , a Statement, has one required parameter. It sets the current size of the Command Stack to , which must evaluate to 1-16. In BASIC you may do things like; CMDSTK~C , CMDSTK~16 , CMDSTK~A+B/C , CMDSTK 32-X . ^sk0CNTRSTQ, a numeric Function, returns the current system contrast. The value is 0-15. ^sk0CRATEQ, a numeric function, returns the current Character Rate as 0-7.969 (inf). ^sk0DSP$, a string Function, returns a string representing the current display form. Such as, STD, FIX 2, ENG 3, SCI 9, etc. You may do things in BASIC like; D$=DSP$ , IF DSP$#"STD" THEN STD , etc. ^sk0LOCK$, a string Function, returns a string representing the current Lockword (password). If there is no lockword the null$ is returned. ^sk0LRATEQ, a numeric Function, returns the current display Line Rate as 0-7.969 (inf). ^sk0PWIDTHQ, a numeric Function, returns the current PWIDTH. ^sk0WIDTHQ, a numeric Function, returns the current display Width. ^sk1Most of this file will be obsoleted by a soon-to-be released file from HP. It has two keywords, SYSTEM and SYSTEM$, which each take arguments. As an example, SYSTEM("WIDTH"), would return the current WIDTH. ^sk1^ceNOPRIVT ^sk1^paThis is source code only, no assembled file. You use this file at your own risk. The file has one Keyword, RLIST , a Statement, which takes a filename as a parameter. It was written to list to a printer the contents of a PRIVATE BASIC program. It works just like PLIST except you cannot specify line numbers, I set 1,9999 in assembly. Since the HP71 is an open machine, privacy is a joke with FORTH, I chose to make this file available. It was written in about half an hour so there is NO error trapping, for BASIC files only. ^ad ^sk2^ceSCPLEX AND SCOPET ^sk1^paThis file implements an HPIL analyzer similar to the one in the 41c Development Module. Due to the file length, there are minimal comments in the source code. I have included a copy of a hand commented listing file. To understand it really requires some familiarity with the IDS but I will give the basics. ^paThis code is just the 'kernel' of the analyzer, I have made this public domain. I will be marketing in the future, a deluxe analyzer. ^sk1^paThere are two keywords in the file: ^sk0DELBUF, a Statement, takes no parameters, deletes from memory the system buffer created by Keyword SCOPE. The system buffer uses the last scratch ID, #FFF, and is normally saved by a poll handler in the LEX file. If the LEX file is deleted from memory, the buffer will disappear next time the system is configured. The buffer may be manipulated from FORTH, if so desired. ^sk1SCOPE, a Statement, accepts no parameters (in this version), and invokes the analyzer mode. Upon entering scope mode, the HP71 becomes an invisable device on the loop (not controller, talker, or listener). At entry, a system buffer is created, if it did not already exist. System buffers have a 7 nib header followed by the data area. in the first 5 nibs of Data area pointer, PT, which is the 'current' frame in the buffer. We set the first nib of the buffer header to 1 so the system treats PT as an 'Update Address'. This keeps PT current if the buffer gets moved in memory. Once inside scope mode, only nine keys are active: ^pa'ON', causes scope mode to exited, control is returned to the BASIC interpreter. ^pa'S', toggles frame store mode on and off. To prevent memory corruption, store mode is turned off if the buffer would overflow and the HP71 chirps to let you know. ^pa'ENDLINE', returns the buffer pointer to 'HOME' (PT=0), and displays the frame stored there. ^pa'v' and '^', the up and down arrow keys. Step the pointer through the buffer but not past either end. After pressing either key, the frame at the new PT is displayed. ^pa'0' , '1' , '2' , these three digit keys set no frame delay, a little delay, a little more delay, respectively. The actual timing is controlled in a loop and may be easily changed. ^pa'B', displays the current size of the buffer in 'frames'. ^sk1^paI have packed and speeded the code considerably, but this version works well. It serves to demonstrate the idea. The analyzer is one big loop. At the top of the loop we check if the 'ON' key is pressed, if so we exit. Else we put the CPU to sleep (low power state) waiting for a key press or a received frame. If a key is pressed, we wake and process it (doing whatever) and return to the main loop to start over (and probably go back to sleep!). Things get intresting talking to HPIL. ^ad ^sk2^paIn the HP71, there is a second CPU (with its own ROM and RAM) inside the HPIL module. It communicates through a 16 nibble 'Mailbox' which is configured into the address space ( just like RAM, ROM, Card Reader, Display, etc). Currently, with presently available hardware, the mailbox resides at 20000-2000F hex. The HP71 will support multiple mailboxes (hence multiple HPIL loops). The HPIL you now own has multiple loop syntax built-in. HP did not tell us because the hardware is not yet available, full details (including syntax) are in the HPIL IDS Vol 1, chapter 3. Regarding the HPIL IDS, when you order HPIL-IDS #82401-90023, you WILL receive BOTH vol 1 and 2. The mailbox is split in half, to and from the I/O CPU. There is a whole instruction set for the I/O CPU which we may use by writing to the mailbox. A look at the instruction set of HPIL IDS, chapter 5 reveals the true power of this HPIL. When entering scope mode, we write the proper command to the mailbox to set the I/O CPU mode. ^paBack at the main loop, when a frame is received, the I/O CPU wakes the HP71 CPU by driving the *CD bus line low (it was precharged high prior to CPU shutdown).When we wake, a system routine is called. First it checks to see if a hardware timer expired. If not, the service request poll is issued. To make a long story short, we check to see if a frame is waiting, if so all we do is set a flag (the 1 nib following the 5 nib PT) saying 'frame now waiting'. We then exit the poll handler. After returning from the poll, we check the flag, if 'frame waiting' then we display and optionally store then return to the main loop. ^paIt would not be appropriate to answer the service request poll always, so we first test for the buffer existence, if yes we then check the flag (scope active). This makes the analyzer behave properly. ^sk1^ceFIX2 ^sk1^paThis file, written by HP, fixes (in RAM, using the 'new opcode' hooks) the B=B+B A bug in the Assembler. All you do is enter the TEXT file as printed and LOADF it from FORTH. Without this fix, trying to assemble a B=B+B A instruction results in trashing the symbol table. ^sk1^ceJUMPER ^sk1^paThis file, written by HP (see HPIL IDS, V1, Chap 7) allows us to use routines in the 16k HPIL ROM. Being able to call subroutines in the HPIL ROM saves us code sometimes. This file can be merged into another to save all the keying. For details see HPIL IDS V1, Chapter 7. ^ad ^sk2^ceGPIOSET ^sk1^paThis is my only BASIC program. It was written to allow reading, writing, and testing of the HP 82166 & 82165 converters. It will list to a printer, the converters control registers, and allow setting them as well. It uses the KEYWAIT$ keyword (in the circuit analysis ROM among others). You will undoubtedly notice that my BASIC style follows my Assembly style. I find BASIC difficult to read otherwise. ^sk2^paI hope that other folks can get some use/amusement/information out of this hodgepodge of electronic/magnetic bleeps and bloops on tape and in silicon. I have tried to write the comments in the source code files to allow easy understanding. It's been tremendous fun to write, I can assure you there's a lot more coming. ^sk1^ceBest wishes, ^sk0John R Baker ^sk0 142 Johns Court ^sk0Charles Town, WV 25414