Post Reply 
Help - Assembly programming on Debug4x (HP50G)
06-12-2019, 07:24 AM
Post: #3
RE: Help - Assembly programming on Debug4x (HP50G)
Yes, the following in Debug4x works just fine:
Code:
RPL

::
   BINT1
   CODEM
      C=DAT1 A
      ?C=0 A
      GOYES QUIT
      D1=D1+ 5
      D=D+1 A
      *QUIT
      GOVLNG =LOOP % =LOOP is 2D564 on the 48 and 05149 on the 49, which returns to RPL
   ENDCODE
;

Since you are invoking the MASD compiler (via CODEM), you could also use this alternative form to do the same thing:
Code:
RPL

::
   BINT1
   CODEM
      C=DAT1 A
      ?C#0 A ->{
         D1=D1+ 5
         D=D+1 A
      }
      GOVLNG =LOOP
   ENDCODE
;

In this tiny example, there's not a significant advantage to the latter form. Both versions compile to the same size object and do the same thing. But coding in this manner makes it easier as projects grow, since you don't have to keep up with jumps and labels for simple skips. The MASD preprocessor essentially creates indexed labels as needed so you don't have to worry about them when using this syntax. It can also help by making the code easier to use in other projects without having to worry about label conflicts.
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 - 06-12-2019 07:24 AM



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