The HP-85 and 87 have the option of an Assembler ROM that gives access to memory and input / output ports that cannot
be controlled directly from the standard Basic. The best source of
information for the HP-85 Assembler is the Assembler ROM manual, which is available on one of
the HP Calculator museum CD-ROMs.
Example programs
With the
Assembler ROM (or EPROM) installed, there are some additional commands
available. When the machine is powered on, it defaults to Basic mode. The
ROM adds a new command: ASSEMBLER which puts the machine in Assembler
mode. To return to Basic mode the command is: BASIC Some new functions
are added which can be used in Basic programs or in immediate mode. The
first converts a decimal value to octal (base 8). For example: OCT (8) returns 10,
as this is 8 in decimal. Similarly: DEC (377) returns 255, as
377 in octal equals 255 in decimal. These commands are useful as nearly
all the assembler commands, addressing and programming use octal. The MEM command displays
memory locations on the screen, and is the equivalent to PRINT PEEK in most
other Basics. With additional parameters it changes he contents of RAM (equivalent to POKE).
Unfortunately the MEM command does not allow the result to be assigned to a
variable. The following
examples show the various options. Note these examples are for the HP-85. MEM
100000 gives an output of: 373 212 373 212 373 212 030 213
315 376 315 376 315 376 377 376
377 376 377 376 377 017 252 000
000 000 000 000 000 000 000 000
000 000 004 000 000 000 000 140
127 044 000 000 000 000 000 000
000 000 000 000 013 000 000 000
000 000 000 000 000 000 000 000
{ { { M~M~M~~
~~ *
`W$
MEM 100000 This shows by default the first 64 (100 in octal) bytes from memory
address 100000 octal (32768 decimal). Each value is first shown in octal
then in ASCII (if printable). The range of the HP-85 memory addresses is
from 0 to 177777 (0 to 65535 in decimal). Of this 0 to 77777 is
ROM and the remainder from 100000 up is RAM (on a 32K RAM machine).
To specify how many bytes to display, the command is:
MEM 14000,10
which gives a result of:
162 136 250 035 114 310 337 367
r^( LH_w
MEM 14000
ie 8 bytes (or 10 in octal). Note that this also sets the default
number of bytes to dump until the machine is reset.
The option ROMs on an HP-85 are 8K in size and reside in the 24K to 32K
address space. Multiple plug-in ROMs and EPROMs share this address space,
and are enabled as needed. This is performed using the ROM number,
starting from the system ROM which is 0 up to the maximum of 254. To dump
bytes from ROM number 19 (23 in octal) the command is:
MEM 60000:23
The MEM command can be used to change RAM contents using the following
command:
MEM 10100=1,10,0,200,377
This updates the contents of 5 bytes as follows:
Address 10100 is loaded with 1
Address 10101 is loaded with 10 (8 in decimal)
Address 10102 is loaded with 0
Address 10103 is loaded with 200 (128 in decimal)
Address 10104 is loaded with 377 (255 in decimal)
All of the MEM parameters can be variables eg
MEM A1:R,C
dumps C bytes starting at address A1 of ROM number R.
In assembler mode the ALOAD command reads in a source program from mass
storage, and ASTORE stores the current program in memory. This is similar to the
Basic mode LOAD and STORE, for example:
ALOAD "FTOCS"
looks on the current mass storage device for a file called FTOCS and
reads it into memory. Note that assembler source files are in a file type
called extended, and are shown as type **** in a CAT directory
listing.
To assemble a source file in memory the command is: ASSEMBLE
"FTOC",1 The 1 is needed to force the assembler output to be
stored back on mass storage as a binary program file named FTOC rather than loaded in memory. The output file
is a binary program only if the source says it is, or a data file for a
program declared as a ROM program. Note any errors during assembly are
directed to the printer, these can be directed to the CRT by typing: PRINTER
IS 1 before typing ASSEMBLE.
Return to top.
Parts List
|