Post Reply 
Help - Assembly programming on Debug4x (HP50G)
06-13-2019, 05:13 AM
Post: #7
RE: Help - Assembly programming on Debug4x (HP50G)

xName and NULLNAME are used for library creation only.
I honestly do not remember how the whole library thing works and how to tell debug4x to generate one :-( it is was so long ago!

Anyhow, the MASD syntax also encourages you to use a "." as a separator between an instruction and a field. It does make the code more readable as it visually links the 2 and separates one instruction from the next...
It is also better when programming ON the calc where the . is a single key while the space is shifted...

as in:
from memory, for instructions that are of the form reg=reg_operator_reg, you can even omit the reg= as in A+B.A C+C.B This is especially useful on the calc small screen... (and of course you can put as many instructions as you want on one line)...

For example, this code extracts the square root of A.A (as integers of course, result in C.A)


The syntax makes it nice and compact, the initialization and finalization code is clearly visible before and after the braketed loop zone..
And of course, no labels! which makes it so much easier to compile and copy/paste somewhere else in your code!

If/when you DO have to use labels, use local labels for small stuff.
Local labels are labels that start with a . in their names as in: *.loop for example.
Local labels are local in between 2 global labels.
They also get compiled as soon as they get out of scope, which means that you can reuse their name in various sub routines... example:

some code
some more code
GOTO .loop

some code
*.loop <- here, I can reuse the nane .loop as the previous .loop is now "defunct" as it was 100% processed when the compiler hit the *sub_routine_2 label.
some more code
GOTO .loop

Enjoy ASM coding!

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Help - Assembly programming on Debug4x (HP50G) - cyrille de brébisson - 06-13-2019 05:13 AM

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