Post Reply 
How do I write the JMP command in a program?
12-11-2014, 01:21 PM (This post was last modified: 12-11-2014 01:27 PM by Dieter.)
Post: #2
RE: How do I write the JMP command in a program?
(12-11-2014 12:51 PM)Roger Ward Wrote:  I've started inputting the IEEE 754 conversion program found on here

What program do you refer to? Is it this one in the old forum?
[wp34s] Converting to/from IEEE 754 Binary64 (Double Precision)

(12-11-2014 12:51 PM)Roger Ward Wrote:  but can't figure out how to add the JMP command.

Sure - there is no JMP command. ;-)

JMP is a shorcut generated by the 34s assembler. The actual program uses SKIP (forward jump) or BACK (backward jump) instead, stating the number of skipped lines. Since these numbers may change during editing, the assembler has this handy JMP command that allows jumping to symbolic labels.

Take a look at the listing. In the left column you will notice some labels: ZeroF, SpecF, InfF, ZeroI, SpecI and InfI. Whenever a JMP to one of these labels occurs, you could count the number of program lines between that point and the target label and insert a SKIP command. So if I got it right, JMP ZeroF would be a SKIP 044, because there are 44 lines between the JMP and the respective label. Of course that's cumbersome and error prone.

Much easier: use regular labels like LBL 01, LBL 02, LBL 03 at the position of ZeroF, SpecF, InfF etc. and replace the JMP commands with simple GTOs.

Example:
Code:

            LBL A
            LocR 001
            CL[alpha]
            x=0?
            GTO 01     // was JMP ZeroF
            SPEC?
            GTO 02     // was JMP SpecF
            ...

            LBL 01     // was label ZeroF
            CF .01
            x=-0?
            SF .01
            BASE 16
            FS? .01
            SB 63
            RTN

            LBL 02      // was label SpecF
            [infinity]?
            GTO 03      // was JMP InfF
            ...

            LBL 03      // was label InfF
            CF .01
            x<0?
            SF .01
            ...

And finally you could also use the listing "as is", feed it to the assembler and transfer the result to your hardware 34s.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How do I write the JMP command in a program? - Dieter - 12-11-2014 01:21 PM



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