![]() |
![]() HP OpenVMS Systemsask the wizard |
![]() |
The Question is: I'm in the process of converting some MACRO-32 code from VAX to ALPHA. The MACRO is a subroutine that gets called from FORTRAN programs. The subroutine takes 9 parameters. The original code made use of references to the AP. This was causing me some grief in this case, although in other routines with fewer parameters, I had no issues. I've decided to alter the code to conform to the ALPHA calling standards. I replaced references to (AP) for the argument count to R25. The first six parameters, I replaced with the appropriate registers (R16 thru R21). According to table 3-14 in the "OpenVMS Calling Standard" manual, the remaining 3 parameters should be referenced as 0(SP), 8(SP) and 16(SP), respectively. When I did this, the compiler complained with an error of UPLEVSTK. I'm not sure how why or how to get around this. Can you provide an example of MACRO subroutine that takes more than 6 parameters that I can refer to? Thanks in advance for any help you can provide. Tim DiBendetto 610-407-6181 The Answer is : First, determine if you even need the Macro32 code. In many cases, the Macro32 code is no longer required and can be replaced as alternative solution(s) are now available. Then make only the recommended motifications to the Macro32 code, there is no need to modify the register operations to match the Macro64 assembler registers as you are working with the Macro32 compiler and not the Macro64 assembler. The Macro32 compiler will correctly process argument lists with more than six arguments -- the code generated by the Macro32 compiler will correctly and transparently use the six Alpha hardware registers and the stack designated for this purpose by the Alpha calling standard. A simple example of Macro32 argument passing follows: .psect code,nowrt,exe,quad $ssdef .entry main,^m<r2> pushl #^x10101 pushl #^x20202 pushl #^x30303 pushl #^x40404 pushl #^x50505 pushl #^x60606 pushl #^x70707 calls #^x7,sub cmpl r0,#^x10101 beql 10$ movl #ss$_badparam,r0 ret 10$: movl #ss$_normal,r0 ret .entry sub,^m<r2> movl 7*4(ap),r0 ret .end main
|