[comp.sys.handhelds] Documents for HP48SX ML programming.

ervin@pinbot.enet.dec.com (Joseph James Ervin) (03/30/91)

Marc,

I couldn't reach you directly (REPLY failed, host unknown), so I'm
posting this information to the conference in the hopes that it will be
of use to others trying to do machine language programming/

 
 
>How do you program in machine code??
>manuals docs?? assemblers?? tools!!!
 
 
Your questions regarding information for machine language programming
are similar to some that I asked, and which got virtually no response from
the net.  
 
So, let me share with you my recent experiences.
 
To my knowledge there is no official documentation or books which describe
how to do ML programming on the HP48SX.  Here are some sources of
information that have served me well.
 
First, check out Alonzo Gariepy's notes on the  Saturn processor, which is the
processor HP used in the 28 and also in the  48SX.  This will give you a decent
introduction to the instruction set and the basic architecture of the
processor.
 
Then, you should read Alonzo Gariepy's notes on doing ML programming on  the
HP48SX.   These notes provide some useful information, and give some  decent
examples of how to do things.Next, I recommend you take a look at the
internals description by Derek Nickel.
This gives a decent explanation of the different data types used  in the
48SX,
and how they are each represented.  Of all the internals lists that have
been
posted recently, I believe that his has the best descriptions of  the
various
object types, their prologs and how they are stored.
 
Next, I recommend that you get the list of internal addresses that Jake
Schwartz.  This gives a good description of all (?)the known internal
addresses 
and what they do.
 
Finally, I suggest you get the Star assembler written by Jan Brittenson.
After
reading the README. file and the STAR.REF files which come as part of
the Star 
assemlber, you should have a pretty decent feel for how to program the
48SX.
STAR was written by Jan Brittenson, and he has put in a good effort to
make it
fairly transportable.  I was able to compile and run it on a VAX/VMS
system 
without requiring much effort on my part.
 
Lastly, let me make one more suggestion.  READ THE DOCUMENTS I HAVE
MENTIONED
ABOVE, in the order I have specified them.  Alonzo's notes will give you
a
decent foundation regarding the architecture of the SATURN processor and
the
instruction set.   Derek's notes will give you a good foundation  in the
object
types and how the 48SX stores information internally.  After reading
these
documents, I have been able to undertake a fairly non-trivial ML
project,  the
fruits of which will appear in this conference shortly, with luck.
 
I hope that helps.
 
>>>Joe Ervin
 
P.S. All of the documents mentioned above are available on Wayne's mail
server;
a service that I highly recommend.  Below are Waynes directions for
accessing 
his mail server. 
 
 
 
	How to use the Wayne's Mail Server
	====================================
 
The Wayne's Mail Server can temporally be reached at e-mail address
"wscott@ecn.purdue.edu" with a subject line of "HP-MAIL-SERVER".  If 
you don't use the correct subject the mail will be sent to me and that
would be a bother.  If your mailer doesn't understand domain addresses,
try a nearby gateway like "uunet".
 
When the Mail Server receives a message, It reads the mail headers
to determine the requester's address. If a "Reply-To:" header is
found, the indicated address is used. If not, it uses the address as
specified in the "From:" header.  You can overide this path with
the path command below.
 
The message body is scanned for server commands. Every line in the
message should contain a valid server command.
 
A report is sent to you by return mail. Any requests will be handled
as soon as the load of the server system permits.
 
	NOTE: The mail server is still under development. Things
	may -and will- change in the near future.
 
The Server's Archives
=====================
By default the server get files from the HP-48 archive.  If you want to
use the HP-28 archive include the HP28 command below.
 
Files are stored in the archives in one of the following formats:
 
Plain: normal ASCII text.
 
Shell Archive: ASCII files which can be unloaded using the
    Unix sh(1) program.
    Shell Archives have names ending in ".shar".
 
Compressed: 16-bit compression using the compress(1) utility.
    Compressed files have names ending in ".Z".
 
Tar: standard UNIX tar(1) format.
    Tar archives have names ending in ".tar".
 
Compressed Tar: compressed tar archive.
    Compressed tar archives have names ending in ".tar.Z".
 
When requesting a file you do not have to specify the format-specific
extension. A request for a file "foo" will automatically be changed to
"foo", "foo.tar", "foo.shar", "foo.Z", "foo.tar.Z" whichever is
available.
 
The file "INDEX" contains a list of files in the archives.
 
Command Syntax
==============
A command consists of a keyword (verb), followed by zero or more
arguments, depending on the command. Command verbs may be specified in
all uppercase letters, lowercase or whatever mixed case. In other
words: case is not significant in command verbs. Case *IS* significant
in command arguments.
Empty lines are ignored.
 
The following commands are understood by the server:
 
PATH <address>
--------------
    The return address used by the server is set to the indicated
    <address>. This must be a valid address by which you can be
    reached. It may contain a domain-based address.
    Use this command if you are not sure that the return addresses
    generated by your mail system are reliable.
 
END or EXIT
-----------
    The remainder of the message is ignored. This can be useful if a
    .signature is appended to the message.
 
LIMIT <number>
--------------
    Specify the maximum number of bytes which may be sent in a single
    mail message. Transfers exceeding this amount will be split
    before sending.
    The amount may be specified in Kbytes, e.g. "30K".
    The default value is 64K.
    NOTE: setting the limit will only affect "send" and "resend"
    commands following this command.
    NOTE: due to mailer overhead, it is possible that the size of the
    mail which reaches you will (slightly) exceed this limit.
 
HP28
----
    Use the HP-28 archive for ALL commands.  Note: it is not possible
at
    this time to get files from both the HP-48 directory and the HP-28
    directory in one message.
 
UUENCODE
--------
    The requested items will be uuencoded before sending. Because most
    archives are binary files, they are always encoded before sending.
    Uuencoding is default.
    Use "send uudecode" to obtain the uudecode/uuencode programs.
    NOTE: setting the encoding will only affect "send" and "resend"
    commands following this command.
 
BTOA
----
    The requested files will be encoded using "btoa". Btoa encoded
    files are smaller than uuencoded files, but not everyone can
    handle btoa encoded files yet.
    Use "send btoa" to obtain the btoa/atob coding programs.
    NOTE: setting the encoding will only affect "send" and "resend"
    commands following this command.
 
SEND <item>
-----------
    The specified <item> is looked up in the server archives. If
    found, it will be sent to you by e-mail. Multiple items may be
    specified with one SEND command.
    NOTE: the names of the <item>s are case sentive!
 
RESEND <item> <part> [<part>...]
--------------------------------
    Re-send the indicated <part>s of this item. This is useful if not
    all parts of a multi-parts transmission did arrive correctly.
    When re-transmitting, the encoding and limit used must be
    identical to those of the original transmission.
 
LATEST <days>
-------------
    Prints a list of all of the files that have been added to
    the current archive in the last <days> days.
 
HELP
----
    This command gives a list of server commands.
 
TEST
----
    This command is for testing. No files will be sent if you use
    this, but a confirmation message will be sent to the return path as
    determined from the mail headers or the "path" command.  You may
    use this to find out if your address is valid, and to check the
    status of your request.
   
Sample Mail Server Report
=========================
 
Sending:
 
	path jv@mh.nl
	btoa
	send INDEX bio
	resend zoo 2 3 4
	send foo
	end
 
will generate the following report:
 
	From: Wayne's Mail Server <wscott@ecn.purdue.edu>
[1]	To: jv@mh.nl
	Subject: Your request
	Date: Sun, 1 Oct 89 18:25:39 MET (+0100)
 
	Wayne's Mail Server 1.0
 
	Processing mail headers ...
[2]	Return address: "Johan Vromans <jv@mhres.mh.nl>"
 
	Processing message contents...
 
	Command: path jv@mh.nl
[3]	=> Return address: "jv@mh.nl"
 
	Command: btoa
	=> Encoding = btoa
 
	Command: send INDEX bio
	=> Send: INDEX
	=> Send: bio
 
	Command: resend zoo 2 3 4
	=> Resend: zoo, parts 2,3,4
 
	Command: send foo
	=> Send: foo
 
	Command: end
	=> Okay
 
	Your message has been processed.
	The following requests have been queued:
 
	  request format (uncoded size) encoding limit remarks
	  ------- --------------------- -------- ----- -------
[4]	  INDEX   Plain (5K)            plain
	  bio     Compressed Tar (6K)   btoa       64K
	  zoo     Compressed Tar (171K) btoa       64K Parts 2,3,4 only
	  foo     Unknown                              Request skipped
 
	These requests will be sent to you as soon as the load of
	the server system permits.
 
	Mail Server finished.
 
As you can see, the return mail is sent to the address [1] indicated
by the PATH command [3]. If the PATH command were not issued, the
address from the message header [2] would have been used.
In the list of requests [4] the format and the size of the files are
shown. Note that the size is the size *before encoding*!
Finally, the request "foo" could not be found and is skipped.
 
Some time later the following mails will arrive:
 
    From                  Size      Subject
    -------------------- --------- ----------------------------------
    Wayne's Mail Server   73/4301  "INDEX (complete) ascii"
    Wayne's Mail Server   96/7394  "bio.tar.Z (complete) btoa encoded"
    Wayne's Mail Server  829/65453 "zoo.tar.Z (part 2 of 4) btoa
encoded"
    Wayne's Mail Server  829/65453 "zoo.tar.Z (part 3 of 4) btoa
encoded"
    Wayne's Mail Server  325/25578 "zoo.tar.Z (part 4 of 4) btoa
encoded"
 
Files which are sent in parts have all pieces clearly marked as such:
 
    ------ begin of zoo.tar.Z -- btoa encoded -- part 2 of 4 ------
    #(_0M#C)R-&3BEIu9#I[oEFn;50r5kb6%CJq%=NMgE3in`tMpnX0rOEYPWNM...
    =69S\PiSodA"*lArTZ.-(g6DL2A6_5>DMuFV/&S7H/]XEgLe(l@e;-Rqr:iZ...
    ...
    ...
    $`eP&iGea"a#e[F!oeo1r@U/FP;::i"V)j_EW+.(U*&IrTJ+u'9=$MY7s*CC...
    uI=a5*Wj^#1LD,&>MZKY@H1_a9QE$$4[+?[ePhh"h2Ub"/a,(ES*ZH"nK"6d...
    ------ end of zoo.tar.Z -- btoa encoded -- part 2 of 4 ------
 
Unpacking
=========
You may obtain the following packages from the server:
 
    btoa	   btoa/atob support programs
    uudecode	   uuencode/uudecode support programs
    PC.starter     A text file with how to get uudecode on your PC.
    compression    A list of available compression program and where to
find 
		   them.
 
These packages are send unencoded.
 
Send me mail if you have problems unpacking some files.
 
If you have Larry Wall's "perl" program, you can retrieve the program
"unpack.pl" from the server. This will help you in unpacking the
mails.
By the way: the server software is also written in perl.
The software is based on the Multihouse Research Mail Server 1.23
 
For questions, information and remarks:
 
	Wayne Scott
 
________________________________________________________________________
________
Wayne Scott             |  INTERNET:   wscott@ecn.purdue.edu
Electrical Engineering  |  BITNET:     wscott%ecn.purdue.edu@purccvm
Purdue University       |  UUCP:      {purdue,
pur-ee}!ecn.purdue.edu!wscott
________________________________________________________________________
________
				"To iterate is human.  To recurse, divine."
------ end of HELP -- ascii -- complete ------