Post Reply 
HP-71B assembler
06-15-2015, 06:17 AM
Post: #1
HP-71B assembler
Hello all,

I'd like to point to asm71, a cross assembler to create LEX or BIN files for the
HP-71B.

The first version was created in 1986 in Turbo Pascal. With minor changes it compiles well with the Free Pascal compiler. So it is on github now:

http://www.github.com/bug400/asm71.

There are binaries for LINUX, Windows (32bit) and Mac OS/X. See:

http://www.github.com/bug400/asm71/releases.

Regards
Joachim
Find all posts by this user
Quote this message in a reply
06-15-2015, 09:48 PM
Post: #2
RE: HP-71B assembler
(06-15-2015 06:17 AM)jsi Wrote:  I'd like to point to asm71, a cross assembler to create LEX or BIN files for the
HP-71B.

Thank you! I've wanted something like this for sometime. I never knew about the existing Pascal version. I look forward to playing with this.
Find all posts by this user
Quote this message in a reply
06-16-2015, 05:23 AM
Post: #3
RE: HP-71B assembler
Thank you Joachim. I will try that.

Best regards
Tobie
Find all posts by this user
Quote this message in a reply
06-17-2015, 05:17 AM
Post: #4
RE: HP-71B assembler
Working great on Mac OS X.
Thank you!
Visit this user's website Find all posts by this user
Quote this message in a reply
06-22-2015, 06:18 PM
Post: #5
RE: HP-71B assembler
(06-15-2015 06:17 AM)jsi Wrote:  Hello all,

I'd like to point to asm71, a cross assembler to create LEX or BIN files for the
HP-71B.

The first version was created in 1986 in Turbo Pascal. With minor changes it compiles well with the Free Pascal compiler.

Not another assembler yet...

I understand why in the 80'ties and early 90'ties different mnemonics were created and used for writing Saturn assembler code. HP hasn't published his HP-Tools and later only his Mess-Dos version of the Saturn Assembler, version 1.56, 12/20/89.

So each community build their own tools:

Class Mnemonics or also called Alonzo mnemonics (Alonzo Gariepy)
  • CLASS and CLDIS Clarke assembler and disassembler, written 1991 by Lutz Vieweg.
  • STAR, the Saturn Macro Assembler, Copyright (C) 1990, 1991 Jan Brittenson.

HP Mnemonics
  • ASM71 (Linux, Mac, Win32)
  • Areuh for building JPC Rom (PPC Paris Rom)
  • SASM Ver. 1.56, 12/20/89
  • GNU HP Tools 2.1
  • HP Tools 3.0.8 (FreeBSD, Linux, Win32)
  • HP Tools 3.0.9 (Win32, Mac)

But in 1998 with the source code release of the HP Tools 3.0 (3.0.2) everything changed IMHO. Now a reference implementation for all Saturn CPU's was available and it later was expanded with the Saturn+ opcodes (switch -P 3) and MASD instruction set. Furthermore SASM can produce raw code suppressing the object files header or code for a separate linker process. I personally use the separate linker process to link with the compiled entry point table of the calculator. Entry point table files are available for many HP Saturn based calculators, also for the HP71. Finally the HP Tools v3.0.8 binaries were published for FreeBSD, Linux and Win32 and v3.0.9 for Mac.

The last point is, when you want to use the symbolic names in the Emu28/Emu42/Emu48 and Emu71/Win emulator code debugger or the RPL Object Viewer you need the entry point table in HP Tools 3.0 object file format.

The advantage of ASM71 I see is, it can use the simplified LEX table macros introduced by the Forth/Assembler module and the integrated creation of the LIF header for LEX and BIN files.

For the HP Tools SASM assembler you need an asm file template for configuring the LEX tables and a program to add the LIF header like JFG's alifhdr program. So for me one Saturn compiler, the HP Tools 3.0.9 fits all.

Here's my LEX template for the HP Tools SASM package:
Code:

    TITLE LEX TEST
* ***********************************
* ENTRY POINTS
* ***********************************
=FNRTN1    EQU    #0F216

* ************************
* --LEX    header--
* ************************
    CON(2)    #5D        LEX ID
    CON(2)    #01        LOWEST TOKEN
    CON(2)    #04        HIGHEST    TOKEN
    CON(5)    0        NEXT LINKED LEX
    NIBHEX    F        NO SPEED TABLE
    CON(4)    (TxtbSt)+1-(*)    OFFSET TO TEXT TABLE
    CON(4)    0        OFFSET TO MESSAGE TABLE
    CON(5)    0        OFFSET TO POLL HANDLER
* ************************
* ------MAIN TABLE------
* ************************
    CON(3)    (ONEt)-(TxtbSt)
    REL(5)    ONEf
    NIBHEX    F        keyword is a BASIC function

    CON(3)    (TWOt)-(TxtbSt)
    REL(5)    TWOf
    NIBHEX    F        keyword is a BASIC function

    CON(3)    (THREEt)-(TxtbSt)
    REL(5)    THREEf
    NIBHEX    F        keyword is a BASIC function

    CON(3)    (FOURt)-(TxtbSt)
    REL(5)    FOURf
    NIBHEX    F        keyword is a BASIC function

* ************************
* ---Text table---
* ************************
TxtbSt

* names must be in alphabetical order

FOURt    CON(1)    (+)-(*)-2    cmdlen * 2 - 1
    NIBASC    \FOUR\
+    CON(2)    #04        TOKEN ID (entry in main table)

ONEt    CON(1)    (+)-(*)-2    cmdlen * 2 - 1
    NIBASC    \ONE\
+    CON(2)    #01        TOKEN ID

THREEt    CON(1)    (+)-(*)-2    cmdlen * 2 - 1
    NIBASC    \THREE\
+    CON(2)    #03        TOKEN ID

TWOt    CON(1)    (+)-(*)-2    cmdlen * 2 - 1
    NIBASC    \TWO\
+    CON(2)    #02        TOKEN ID

TxTbEn    NIBHEX    1FF        TEXT termination
*
********************************
* ONE entry
********************************

* IDS v1 7.5.1 Entry point
*    NIBHEX    8        bit parameter numeric
*    NIBHEX    4        bit parameter string
*    NIBHEX    2        bit parameter array
*
*    NIBHEX    C        3rd parameter numeric or string (if present)
*    NIBHEX    8        2nd parameter numeric
*    NIBHEX    4        1st parameter string
*    NIBHEX    23        argument count range (min=2,max=3)

    NIBHEX    00        argument count range (min=0,max=0)
ONEf    CON(3)    #024        NOP3 break for Emu71
        C=0     W               Clear all digits in register C.
        P=      14              Set the pointer register to the most-significant
        LCHEX   1               Load the most-significant digit in register C's
        GOVLNG  FNRTN1          Send the result back to the system.

********************************
* TWO entry
********************************
    NIBHEX    00        argument count range (min=0,max=0)
TWOf    CON(3)    #024        NOP3 break for Emu71
        C=0     W               Clear all digits in register C.
        P=      14              Set the pointer register to the most-significant
        LCHEX   2               Load the most-significant digit in register C's
        GOVLNG  FNRTN1          Send the result back to the system.

********************************
* THREE entry
********************************
    NIBHEX    00        argument count range (min=0,max=0)
THREEf    CON(3)    #024        NOP3 break for Emu71
        C=0     W               Clear all digits in register C.
        P=      14              Set the pointer register to the most-significant
        LCHEX   3               Load the most-significant digit in register C's
        GOVLNG  FNRTN1          Send the result back to the system.

********************************
* FOUR entry
********************************
    NIBHEX    00        argument count range (min=0,max=0)
FOURf    CON(3)    #024        NOP3 break for Emu71
        C=0     W               Clear all digits in register C.
        P=      14              Set the pointer register to the most-significant
        LCHEX   4               Load the most-significant digit in register C's
        GOVLNG  FNRTN1          Send the result back to the system.
    END

And this my batch file RPL71.BAT to assemble a single source file:
Code:

@echo off
if not exist %1.a goto quit
sasm -e -N -P 1 -a %1.lst %1.a
echo LL %1.lr > %1.m
echo SUPPRESS XR SU >> %1.m
echo SE %SASM_LIB%\HP71EP.o >> %1.m
echo RE %1.o >> %1.m
sload -H -o %1 %1.m
type %1.lr
alifhdr %1 %1.dat
:quit

The resulting dat file is then transferred over the DOSLINK device to a real HP71 or Emu71/Win with the help of a small BASIC program running on the HP71.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-24-2015, 04:37 PM
Post: #6
RE: HP-71B assembler
...the LEX file can be loaded directly with "COPY :DOSLINK TO :PORT(1)" without a BASIC Programm. PORT(1) must be a RAM32k module, for example.
I have tested this with you famous 71 Windows Emulator EMU71.

A Basic Programm is needed for a text file without LIF Header.

Best regards
Tobie
Find all posts by this user
Quote this message in a reply
06-24-2015, 05:46 PM
Post: #7
RE: HP-71B assembler
(06-24-2015 04:37 PM)charger73 Wrote:  ...the LEX file can be loaded directly with "COPY :DOSLINK TO :PORT(1)" without a BASIC Programm.

That's not what I meant with "small BASIC" program. I meant this sort:
Code:

10 RESTORE IO
20 PURGE ILTST
30 COPY :DOSLINK
40 CLEAR :DOSLINK
50 OFF

When you load the same but modified LEX file over and over you might be happy with a program like above. :)
Visit this user's website Find all posts by this user
Quote this message in a reply
06-24-2015, 07:06 PM
Post: #8
RE: HP-71B assembler
ok. thank you for this small basic tool ;-)
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)