The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

Poking a string directly into the 71B as a lex file problems
Message #1 Posted by Jerry Raia on 20 Aug 2010, 1:10 p.m.

Ok here is what I am trying to do. I want to poke a lex file into the 71B as just a plain string not using the pokelex basic program. I assembled the lexfile on my pc. All this lex file does is display the number one (this is the sample in the 71B forth/assembler rom manual). I have the file length correct when I make the dummy file. When I poke the string into the 71B directly on top of the Dummy file as the pokelex program does it creates it fine. The keyword even works and displays the "1" but the file chain must be getting trashed because after that I can no longer create a new file. When I do a CAT ALL the files are all there until I get to the end of the list, then I get strange characters and I have to reset the 71B (INIT:3).

Here is how I'm doing this on the 71b:

CREATE TEXT DUMMY,34 ! LENGTH REPORTED BY THE DUMPLEX PROG AS WELL
DIM F$[100] ! ACTUAL LENGTH OF STRING
A$=ADDR$('DUMMY')
ENTER 1; F$ ! GETS THE STRING FROM THE PC VIA THE RS232 INTERFACE 
POKE A$,F$ 
I know the string I'm trying to poke is correct and matches what the dumplex program shows. What am I missing here? any ideas?

Edited: 26 Aug 2010, 9:27 p.m. after one or more responses were posted

      
Re: Poking a string directly into the 71B as a lex file problems
Message #2 Posted by J-F Garnier on 24 Aug 2010, 12:38 p.m.,
in response to message #1 by Jerry Raia

You are corrupting the file chain with this method. A cleaner way is to encapsulate your LEX file with a LIF header, and do a "COPY :1", the HP-71B will take care of the file chain.

I made such a tool: aLIFhdr (add LIF header), available in my JPC ROM page here

J-F

            
Re: Poking a string directly into the 71B as a lex file problems
Message #3 Posted by Jerry Raia on 25 Aug 2010, 4:50 p.m.,
in response to message #2 by J-F Garnier

Yes thanks I figured thats what I was messing up. I did find a way and that was to add NIBHEX 00000 to the end of the source file. The dummy text file has a FFFFF at the end which was not being accounted for. I'm sure you already knew that. I will your try your solution as it is cleaner. Thank you for the link! :)

Edited: 25 Aug 2010, 11:29 p.m.

            
Re: Poking a string directly into the 71B as a lex file problems
Message #4 Posted by Jerry Raia on 25 Aug 2010, 5:54 p.m.,
in response to message #2 by J-F Garnier

BTW any change of seeing emu71 on 64 bit windows, or perhaps making the source code available?

I cant copy anything except a string of ascii characters to my HP71. So I had to use this method. I'll use the sample lex file from the Forth/Assembler ROM manual:

0003 00000 B4549575         NIBASC 'KEYWORD '
     00008 F4254402 
0004 00010 802E             NIBHEX 802E     file type lex
0005 00014 00               CON(2) 0        flags and copy code
0006 00016 82               CON(2) #28      * creation time
0007 00018 90               CON(2) #09      *
0008 0001A 20               CON(2) #02      * creation date
0009 0001C 80               CON(2) #08      *
0010 0001E 01               CON(2) #10      *
0011 00020 94000            REL(5) FiLeNd   offset to next file
0012 00025 D5               CON(2) #5D      flex file ID
0013 00027 10               CON(2) 001      lowest token
0014 00029 10               CON(2) 001      highest token
0015 0002B 00000            CON(5) 0        next lex table link
0016 00030 F                NIBHEX F        no speed table
0017 00031 7100             REL(4) 1+TxTbSt text table offset
0018 00035 0000             CON(4) 0        no msg handler
0019 00039 00000            CON(5) 0        no poll handler
0020 0003E                  * * * M A I N   T A B L E * * *
0021 0003E 000              CON(3) (TxEn01)-(TxTbSt)
0022 00041 41000            REL(5) FNCT     Keyword code starts at this label
0023 00046 F                CON(1) #F       The keyword is a BASIC function
0024 00047                  * * * T E X T   T A B L E * * *
0025 00047          TxTbSt
0026 00047          TxEn01
0027 00047 5                CON(1) 05
0028 00048 F4E454           NIBASC 'ONE'    This keyword is called "ONE"
0029 0004E 10               CON(2) 1
0030 00050 1FF              NIBHEX 1FF      End of BASIC keyword tables   
0031 00053 00               NIBHEX 00       Minimum and Maximum number of parame
0032 00055 AF2      FNCT    C=0    W        Clear register C
0033 00058 2E               P=     14       Point to most signifcant digit in C
0034 0005A 301              LCHEX  1        Load a hex 1
0035 0005D 8D612F0          GOVLNG =FNRTN1  Send result to the system
0036 00064 00000            NIBHEX 00000    Padding for copy to 71B

Notice the padding at the end. This makes the file big enough to cover the end of the dummy text file which is FFFFF and not included in the size of the text file in bytes. Now I can copy the string to the 71 and run this basic program. It's sloppy but it works. I'm sure there are better ways to do this.

10 DESTROY ALL                                                                  
20 INPUT "LENGTH? ";L  ! Length of Lex String                                                         
30 DIM F$[L]                                                                    
40 SFLAG -23                                                                    
50 ENTER :1 ;F$        ! Get string from RS232 Interface                                                             
60 T$=F$[33,37]        ! Get length of lexfile after header                                                         
70 T=HTD(REV$(T$))                                                              
80 N=IP((T-4)/2)       ! Compute size of Dummy file                                                    
90 CREATE TEXT DUMMY,N                                                          
100 A$=ADDR$('DUMMY')                                                           
110 POKE A$,F$         ! Poke it over the Dummy file                                                         
120 DISP "DONE!"   

Edited: 27 Aug 2010, 7:50 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall