Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Vax to Alphaserver Macro Conversion

 
SOLVED
Go to solution
Remona Munson
Occasional Contributor

Vax to Alphaserver Macro Conversion

I have a Vax macro that needs to be converted so it will work on an alphaserver. I don't know assembler. It's really short. Will someone please help me.
1 REPLY
Hein van den Heuvel
Honored Contributor
Solution

Re: Vax to Alphaserver Macro Conversion

No 'port' needed.
Just general and recommended cleanups.
It works for me, in exactly 1 test.
It might just work for you...

$create tmp.mar
.psect data wrt,noexe

INFAB: $FAB NAM=NAMBLK
INRAB: $RAB FAB=INFAB
NAMBLK: $NAM

.psect code nowrt,exe

.entry GETFID,^M<>
MOVL 4(AP),R0
MOVB (R0),W^INFAB+FAB$B_FNS
MOVL 4(R0),INFAB + FAB$L_FNA
$OPEN FAB=W^INFAB
BLBC R0,EXIT
MOVL 8(AP),R0
MOVAL NAMBLK,R1
MOVW NAM$W_FID_NUM(R1),(R0)+
MOVW NAM$W_FID_SEQ(R1),(R0)+
MOVW NAM$W_FID_RVN(R1),(R0)
$CLOSE FAB=W^INFAB
EXIT: RET
.END

$create test.bas
map (x) word a,b,c
call getfid ("login.com",a)
print a,b,c
end
$macro tmp
$basic test
$link test,tmp
$run test
$ run test
-5439 4890 256
$ write sys$output f$file("login.com","FID")
(125633,4890,0)
$ fid1 = -5439
$ fid2 = 125633
$ shwo symb fid*
FID1 = -5439 Hex = FFFFEAC1 Octal = 37777765301
FID2 = 125633 Hex = 0001EAC1 Octal = 00000365301

So the -5439 is really %xEAC1
And the 256 is really the lower bit for %x0001

Cheers,
Hein van den Heuvel