Openvms / Itanium组装示例中的“Hello World”?

时间:2014-03-04 20:10:54

标签: assembly openvms itanium

我一直在网上搜索在OpenVMS / Itanium上为intel ia64汇编程序编写的“Hello World”程序示例。有人这样做过吗?

由于

1 个答案:

答案 0 :(得分:3)

首先,使用crtl中的printf,省略展开信息指令:

.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