Post Reply 
Help - Assembly programming on Debug4x (HP50G)
11-19-2020, 07:52 PM
Post: #16
RE: Help - Assembly programming on Debug4x (HP50G)
(11-19-2020 04:36 PM)JeffB Wrote:  D0= 80120 % or D1= a value

P= 1

The Debug4x errors are

error: Unknown instruction 80120
error: Unknown instruction D0=
*** ERROR: Invalid expression *** P=
*** ERROR: Missing expression ***
error: Unknown instruction 1

I think you're on the right track, you just need to reformat things a bit.

The Saturn assembler that Debug4x uses doesn't like to have constants supplied as the value for an assignment for D0 or D1. This code:
Code:
D0=80120
will generate an error from the compiler: error: Thou shall not use constants, it's BAD!

There's at least 2 ways I can think of to get this to compile the way you want it in a CODEM...ENDCODE block. The first is probably the preferred way, as it helps to create more readable code:
Code:
CODEM
   DC MyVar       80120
   ...
   D0=(5)MyVar
   ...
ENDCODE

The second will also work, but Saturn code is difficult enough to read already... taking shortcuts like this will only make debugging harder:
Code:
DO=(5)($80120)

The issue with P=1 was probably because the assembler couldn't make sense of what followed the D0= in the first place, which confused it with the subsequent code. Once you fix the D0= statement, I'd guess the P=1 will be fine.
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) - DavidM - 11-19-2020 07:52 PM



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