This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using Macro's in NHET



Hello,

I am new to the NHET and trying to understand the NHET functions. I have done the NHET "Getting started Guide". Now I looking for solutions of complex instructions like an "if". In the NHET Assembler User Guide chapter 4 are some macros defined. There I found an .if instruction. I tried to run macro examples in the HET IDE, but it did not work. I cant assemble the listed macro instructions. For example I tried to define a macro:

Example 4-1. Macro Definition, Call, and Expansion


Macro definition: The following code defines a macro, ADCNST3, with three parameters:


1 ADCNST3.macro arg1, arg2, arg3
2 ADCNST { data = arg1 dest = arg2 min_off = arg3 }
3 .endm
4


Macro call: The following code calls the ADCNST3 macro with three arguments:


5.ADCNST3 0FFFFh, 21h, 0AAAh


Macro expansion: The following code shows the substitution of the macro definition for the macro call. The
assembler passes the arguments (supplied in the macro call) by variable to the parameters (substitution
symbols).


HA 2000
1 0152 1AAA FFFF FFFF ADCNST { data = 0FFFFH dest = 21H min_off
= 0AAAH }


If you want to include comments with your macro definition but do not want those comments to appear in the
macro expansion, use an exclamation point to precede your comments. If you do want your comments to
appear in the macro expansion, use an asterisk or semicolon. See Section 4.8 for more information about
macro comments.


But this causes an error:

>> Can't find end of macro definition -- Aborting!


Does anyone have any suggestions?

Thanks.



  • Your question has been forwarded to the owner of HET assambler. We will get back to you as soon as possible.

    Thanks,

    Haixiao

  • Hey Haixiao,

    thanks for your fast answer. But the owner of HET assembler do not answer yet. Did you have some assembler example code for the NHET, which uses macros? Then I can test, if other code will produce the same errors.

    Best regards

  • I have lots of experience with NHET but I never use Micro. Personally, I don't think it is necessary. Can you tell me your goal and maybe I can give you some examples instead of being hold by the Micro.

    Thanks,

    Haixiao

  • Hello,

    Thanks for your offer. I want to use the NHET for the commutation of an bldc motor. I have 3 hallsignals from which the NHET should estimates the rotor status and sets the bridge transistors. I  know this can be realizied easy in the TMS570, but for my product the TMS570 needs to run with as few as possible interrupts.

    I have wrote an assambler code, which do these required functions. Nevertheless macro instruction are interesting for me to generate other solutions. Can I get in contact with the assembler owner, whom you mentioned before?