Post Reply 
Help - Assembly programming on Debug4x (HP50G)
06-13-2019, 03:22 PM
Post: #8
RE: Help - Assembly programming on Debug4x (HP50G)
Jeff,

If your goal is to simply have multiple program objects in the same source code file for experimentation, you don't need to create a library for that with Debug4x. You can use something like this:
Code:
RPL

INCLUDE DirMacro.s

ASSEMBLE
   Dir <test>
RPL
::
   "Hello world!"
   CODEM
      SAVE
%     ...
      LOADRPL
   ENDCODE
;

ASSEMBLE
   Dir <test2>
RPL
::
   "How are you?"
   CODEM
      SAVE
%     ...
      LOADRPL
   ENDCODE
;

This requires you to have the DirMacro.s file in your Debug4x "Include" folder. I can't recall if Debug4x comes with that pre-installed or not; if it isn't, here's the contents of that file on my system:
Code:
RPL 

**************************************************************
*  Directory building macro
*
*  Invoke this way:
*  ASSEMBLE
*    Dir  "name"
*    saturn code     (if any)
*  RPL
*    :: rpl code  ;       (if any)
*
*  All directory entries must be in the same file
*  All source in the file will be part of the same directory.
**************************************************************
ASSEMBLE
Dir  MACRO
  IFNDEF   $dir$st
    CON(5) =DORRP
    CON(3) #7FF        * Number of attached libraries
    REL(5) $dir$st       * Offset to last directory entry
    CON(5) 0        * constant 00000
  ELSE
    CON(5) (*)-$dir$st  * size of the previous entry
  ENDIF
$dir$st = *               * used by next call to macro
    CON(2)  (($dir$nm$0)-2-(*))/2
    NIBASC  "$1"
$dir$nm$0 = *           * must be unique because of fwd reference
    CON(2)  ((*)-2-$dir$st)/2
=$1 EQU     *           * make entry in symbol table
  ENDM
RPL

Note that the order of objects in the compiled directory object this creates is the opposite of the ordering in the source. So in this case, the above source file example creates a directory with two objects in it, test2 and test (in that order).

Hope this helps!
- David
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-13-2019 03:22 PM



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