MASD & Macro - Hewlett Packard

This is a discussion on MASD & Macro - Hewlett Packard ; Hello I've been trying lately to use some macro with MASD, as a way to avoid some GOSUB...RTN for some small repetitive code. This seems possible for SASM, but i could not find any equivalent in the documentation of MASD. ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: MASD & Macro

  1. MASD & Macro

    Hello

    I've been trying lately to use some macro with MASD,
    as a way to avoid some GOSUB...RTN for some small repetitive code.

    This seems possible for SASM, but i could not find any equivalent in
    the documentation of MASD.

    What i'm willing to do is something as simple as :

    %MACRO AddUChar
    %D+1.A RTN
    %ENDM

    There is not even a parameter at this stage : just some code inlining.

    Is that possible ?

    Note : i've seen that it is possible to use "INCLUDE subcode_file.s"
    for this purpose,
    but this does not seem appropriate for some small code inlining.

    Regards

  2. Re: MASD & Macro

    On 10 nov, 22:09, Yann wrote:
    > ...but this does not seem appropriate for some small code inlining.

    Hi, maybe this sample is for you.
    !RPL !NO CODE
    CODE
    DC AddUChar 107E
    SAVE
    GOSUB label
    LOADRPL
    *label
    $(4)AddUChar
    ENDCODE
    @

    What is 107E?, "107E" SREV ->CD (now Nosy):
    D=D+1 A
    RTN
    @

    How to get the Machine Code (107E)?
    compile your code (macro), then CD-> SREV

    .... another sample code about this:
    http://www.gaak.org/hp/cobin/

    Cheers,
    - Gaak -

  3. Re: MASD & Macro

    OK, thanks Gaak,
    i needed a bit of time to understand this one, but i think i got it :

    Instead of having a code inlining,
    you suggest to create the compiled code in binary format directly,
    build an Hex-chain from it,
    and add it at the required position in the MASD code.

    I believe that's a nice & unexpected work-around, which should work.
    And it's clever, however, it's complex too.

    I'm mostly worried if there is a need to change the code sequence
    later.
    For example, if i finally need D+2.A, or D+1.S, or whatever other
    change.
    Or a more complex sequence.
    That would require manual translation into binary too.
    So yes, it can be done, but i would very much prefer to let the
    compiler do the translation job.
    Well, if that is possible, of course...

+ Reply to Thread