2

I've been searching the web for an example "Hello World" program written for the intel ia64 assembler on OpenVMS/Itanium. Has anybody done this?

Thanks

  • How about http://net.pku.edu.cn/~course/cs101/2007/assign/book1/answer/hello.htm#Assembler-Itanium ? – Michael Mar 04 '14 at 20:37
  • 1
    It helps ease the learning curve on using the ias assembler. I'm trying to put all the pieces together by reading the docs and looking at the assembly listing of a C example but if someone has already done that then I can put the example on Rosettacode and help everybody out. – user3380711 Mar 07 '14 at 19:23

1 Answers1

3

For a start, using printf from the crtl, leaving out unwind information directives:

.vms_module_name "HELLO"
.vms_module_version "V1.0"

.section .rdata, "a", "progbits"
.align 8
.STRING:
stringz "Hello World!\n"

.global DECC$TXPRINTF
.type DECC$TXPRINTF, @function

.text
.global HELLO
.proc HELLO

HELLO:

PROLOGUE:
alloc loc2 = ar.pfs, 0, 4, 1, 0
mov loc3 = sp
mov loc1 = b0

CODE:
addl out0 = @ltoff(.STRING), gp
;;
ld8 out0 = [out0]
mov loc0 = gp
br.call.sptk.many b0 = DECC$TXPRINTF
;;

EPILOGUE:
mov gp = loc0
mov ar.pfs = loc2
mov b0 = loc1
mov sp = loc3
br.ret.sptk.many b0
.endp HELLO
user2116290
  • 1,062
  • 5
  • 6