0

Someone can explain me how to develop in assembly on OpenVMS, I already develop in C on OpenVMS and I've just start with assembly in Windows and Linux. How can I compile, link and run an .asm program?

Mitro
  • 1,230
  • 8
  • 32
  • 61
  • Which platform? If VAX, read `help macro`. – SK-logic Dec 12 '12 at 16:03
  • VAX MACRO is a rather pleasant way to program, especially compared to "portable assembler" (aka C). Lovely instruction set for getting things done. Alpha instructions are quite RISC and a compiler is likely to optimize the code quite well. Don't know about Itanic. – HABO Dec 12 '12 at 16:46
  • You can compile MACRO on Integrity. But I've found that for performance, DECC is very hard to beat on AXP or Itanium. Don't know about VAX. – Matthew Lundberg Dec 16 '12 at 23:48

3 Answers3

8

Just use the HELP and RTFM (Read The Fine Manuals)

Suggested Google string = site:hp.com openvms macro

Below is a trivial example i just typed in, in one go. Create; Compile; link; run.

This was On Itanium. Alpha and Vax would be exactly the same for such trivial program

The hardest part was to paste the code example here... the { } code block was eating my new-lines, if the line did not start with 4+ spaces. Odd! 'Trying to help' POS!

First, create a file:

$CREATE test.mar

Then we put this text into that file:

     .psect  data    wrt,noexe
hello:
     .ascid  "Hello World"

     .psect  code    nowrt,exe

     .entry  start, 0
     movl    #5, R8
10$:
     pushaq  hello
     calls   #1, G^lib$put_output
     sobgtr  R8, 10$
     ret
     .end start

With that completed, hit control-z to return to DCL and compile and run:

$ MACRO test
$ LINK test
$ RUN test 
Hello World
Hello World
Hello World
Hello World
Hello World
$
David Hoelzer
  • 15,862
  • 4
  • 48
  • 67
Hein
  • 1,453
  • 8
  • 8
  • Doesn't need to be .MAR, but that what the compiler uses if you supply the file name without the extension. – Matthew Lundberg Dec 16 '12 at 23:49
  • 1
    @AlessioMTX Same idea, in that VMS also uses file extensions to identify contents, but you can't compile MACRO on Windows. I've found that MACRO is convenient for "glue" code to call a function in executive- or kernel-mode, but really not much else. – Matthew Lundberg Dec 17 '12 at 22:32
  • 1
    Keep in mind that assembly language is, by design, dependent on the instruction set architecture. Macro assembler for the VAX and related processors uses a completely different instruction set from .asm assembler on DOS or Windows machines. They are both assemblers, but the similarity ends there. – Walter Mitty Jul 20 '13 at 21:15
1

I love MACRO-32 and I adore even more its less well-known - but extremely elegant cousin - BLISS-32 but in my 45 years as a programmer I have only ever coded ONE commercial application in MACRO and I did that because I needed superfast speed AND I had no other high-level language alternative.

So MACRO is like a girlfriend who gives you a fast time (!!) but is not one you would want to settle down and be married to. For this, you need to code in either C or C++ or BASIC or even .. COBOL because these are languages which 'do the job' sufficiently well to go into production AND are maintainable long after the original coder has moved on.

-2

DBL is the current incarnation of the origin DiBOL, Digital Business Oriented Language, an alternative to COBOL. I recommend DBL over either COBOL or BASIC for applications. I have coded in MACRO through DiBOL/DBL.

Kate
  • 283
  • 2
  • 11