<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Make macros for assembler language in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467050#M728191</link>
    <description>I have a short code in asm, and i want to duplicate it a lot of time with minor change.&lt;BR /&gt;I found a begin of explication in m4. But i don't have example on my hp server.&lt;BR /&gt;I cannot use #define because i need, when the macro is expanded, to repect the asm format:&lt;BR /&gt;label opcode opcode_param information&lt;BR /&gt;and each line must on separte line (not as C).&lt;BR /&gt;&lt;BR /&gt;Somebody can help me?</description>
    <pubDate>Fri, 24 Nov 2000 07:53:09 GMT</pubDate>
    <dc:creator>Sacha Hnatiuk</dc:creator>
    <dc:date>2000-11-24T07:53:09Z</dc:date>
    <item>
      <title>Make macros for assembler language</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467050#M728191</link>
      <description>I have a short code in asm, and i want to duplicate it a lot of time with minor change.&lt;BR /&gt;I found a begin of explication in m4. But i don't have example on my hp server.&lt;BR /&gt;I cannot use #define because i need, when the macro is expanded, to repect the asm format:&lt;BR /&gt;label opcode opcode_param information&lt;BR /&gt;and each line must on separte line (not as C).&lt;BR /&gt;&lt;BR /&gt;Somebody can help me?</description>
      <pubDate>Fri, 24 Nov 2000 07:53:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467050#M728191</guid>
      <dc:creator>Sacha Hnatiuk</dc:creator>
      <dc:date>2000-11-24T07:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Make macros for assembler language</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467051#M728192</link>
      <description>save your macro to a file.&lt;BR /&gt;Edit with vi you main code.&lt;BR /&gt;At every line where you want to insert your macro code do&lt;BR /&gt;&lt;BR /&gt;:r &lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;this inserts the contents of &lt;FILE&gt; into your vi&lt;BR /&gt;Of course this is a manual procedure, hope this is what you need.&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Fri, 24 Nov 2000 08:03:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467051#M728192</guid>
      <dc:creator>Rainer_1</dc:creator>
      <dc:date>2000-11-24T08:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Make macros for assembler language</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467052#M728193</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Instead of typing&lt;BR /&gt;:r file&lt;BR /&gt;to insert the file at cursor position from within vi&lt;BR /&gt;you could as well use the include statement, like in&lt;BR /&gt;#include "you_macro_file"&lt;BR /&gt;&lt;BR /&gt;The disadvantage of these 2 solutions is that the same file will be used.&lt;BR /&gt;To allow for minor changes, you should probably modify your initial asm file with some conditional steps like&lt;BR /&gt;#ifdef&lt;BR /&gt;#else&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Nov 2000 08:44:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467052#M728193</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2000-11-24T08:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Make macros for assembler language</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467053#M728194</link>
      <description>It would be worth your looking at the "Program Structure" section of the "HP Assembler Reference Manual" (available at &lt;A href="http://docs.hp.com" target="_blank"&gt;http://docs.hp.com&lt;/A&gt; -&amp;gt; development tools and distributed computing -&amp;gt; Assembler) since this indicates that you can combine several assembly language instructions on the same line by separating them with "!" and using the ".LABEL" directive for the labels.</description>
      <pubDate>Fri, 24 Nov 2000 10:52:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467053#M728194</guid>
      <dc:creator>Andy Bennett</dc:creator>
      <dc:date>2000-11-24T10:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Make macros for assembler language</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467054#M728195</link>
      <description>To make macro for assembly code, you must:&lt;BR /&gt; -put a "!" between each instructions&lt;BR /&gt; -put a "\" to change line in the declaration like for C&lt;BR /&gt; -Use .LABEL directive to make a LABEL inside the macro and don't add any instruction after: use ! between the label and the instruction.&lt;BR /&gt; -To create local label use macro's arguments like the exemple at the end; the #arg will keep the "#" inside the label name!!!!&lt;BR /&gt; -Don't forget the "; macro" at the end of the description.&lt;BR /&gt;&lt;BR /&gt;Exemple&lt;BR /&gt;#define Toto(var1,var2) .EXPORT label#var1#var2,CODE ! .LABEL label#var1#var2 ! ldi var1,r1 ! ldi var2,r2 ; macro&lt;BR /&gt;In source write this:&lt;BR /&gt;  Toto(13,14)&lt;BR /&gt;will create this:&lt;BR /&gt;  .EXPORT label#13#14,CODE&lt;BR /&gt;label#13#14&lt;BR /&gt;  ldi 13,r1&lt;BR /&gt;  ldi 14,r2&lt;BR /&gt;&lt;BR /&gt;in c code, add this to know address (and jum perhaps...): extern "C" void label#13#14();&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Dec 2000 09:22:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467054#M728195</guid>
      <dc:creator>Sacha Hnatiuk</dc:creator>
      <dc:date>2000-12-05T09:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Make macros for assembler language</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467055#M728196</link>
      <description>I said an error about extern directive:&lt;BR /&gt;it's impossible, i think, to export in a C source the label, because the "#" cause an error in compilation. But inside assembly code it's work.&lt;BR /&gt;But the declaration work fine if you use good declaration like: extern "C" void label_13_14();&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Dec 2000 10:10:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-macros-for-assembler-language/m-p/2467055#M728196</guid>
      <dc:creator>Sacha Hnatiuk</dc:creator>
      <dc:date>2000-12-05T10:10:50Z</dc:date>
    </item>
  </channel>
</rss>

