How do I write the JMP command in a program? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: Not HP Calculators (/forum-7.html) +--- Forum: Not quite HP Calculators - but related (/forum-8.html) +--- Thread: How do I write the JMP command in a program? (/thread-2602.html) |
How do I write the JMP command in a program? - Roger Ward - 12-11-2014 12:51 PM I've started inputting the IEEE 754 conversion program found on here but can't figure out how to add the JMP command. First occurence required is - JMP ZeroF, shortly after there's a JMP SpecF. I'm doing this on the WP34s itself not opn the emulator. Can anyone help? Cheers Roger RE: How do I write the JMP command in a program? - Dieter - 12-11-2014 01:21 PM (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:
And finally you could also use the listing "as is", feed it to the assembler and transfer the result to your hardware 34s. Dieter RE: How do I write the JMP command in a program? - Roger Ward - 12-11-2014 01:40 PM Dieter Yes, that's the program and thanks for your clear explanation! I'm not a programmer so this is all new to me. Will keep going now. Cheers Rogr RE: How do I write the JMP command in a program? - Dieter - 12-11-2014 02:16 PM (12-11-2014 01:40 PM)Roger Ward Wrote: I'm not a programmer so this is all new to me. OK, in this case a complete "translation" may be helpful. There are some other lines that have to be entered differently from what the assembler-generated listing says. Code:
This should look close to what you see in the display. Dieter RE: How do I write the JMP command in a program? - Roger Ward - 12-11-2014 03:53 PM Thanks again Dieter for your time. This make even more sense Cheers Roger RE: How do I write the JMP command in a program? - Paul Dale - 12-11-2014 09:37 PM (12-11-2014 01:21 PM)Dieter Wrote: 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. It is a bit more sophisticated than this. JMP will also insert a label and use a GTO instruction if the branch range is too far for BACK and SKIP. - Pauli RE: How do I write the JMP command in a program? - walter b - 12-12-2014 01:11 PM (12-11-2014 09:37 PM)Paul Dale Wrote:(12-11-2014 01:21 PM)Dieter Wrote: 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. JMP is not generated by the assembler but is a pseudo-command the assembler translates. Please see pp. 189f of the downloadable manual v3.1, pp. 212f of the printed manual v3.2, or pp. 323ff of the printed manual v3.3 in this matter. d:-) |