HP OpenVMS Systemsask the wizard |
The Question is:
While using AMAC V3.0-23-311D:
The MACRO-32 migration compiler does not set the
Z-flag correctly when match is made using the
MATCHC instrcution. On a match, the Z-flag should be set. On no-match, the
Z-flag should be
cleared. In fact, the Z-flag is cleared in both
cases.
Try this little code. Assemble and link non-optimized with debugger and set
break point after each MATCHC instruction. At each breack, check the PSL.
Notice the Z-flag does not change. What's up Wiz?
.TITLE TEST
.PSECT TEST,EXE
.CALL_ENTRY LABEL=TEST
MATCHC #1,OPTION1,#LIST_SIZE,LIST
MATCHC #1,OPTION2,#LIST_SIZE,LIST
$EXIT_S
RET
.PSECT DATA,NOEXE
OPTION1: .ASCII /A/
OPTION2: .ASCII /D/
LIST: .ASCII /CAT/
LIST_SIZE = 3
.END TEST
The Answer is :
OpenVMS Alpha V7.2-1 using "AMAC V4.1-11-3381U" -- with the attached
(modified) example works as expected. The particular version string
you report appears to be associated with the Macro32 compiler integrated
into the OpenVMS Alpha V7.1 release, and not the version included with
OpenVMS Alpha V7.2-1.
The OpenVMS Wizard is not particularly certain which command or Macro32
instruction is being used to display the contents of the (simulated)
Z bit in your example -- the Alpha PSL does not include condition code
flag bits, the Macro32 compiler simulates these condition code flag bits,
including emulation for the BEQL, BNEQ, and MOVPSL operators among others.
.TITLE TEST
.PSECT TEST,EXE
.CALL_ENTRY LABEL=TEST
PUSHAQ AMSG
CALLS #1,G^LIB$PUT_OUTPUT
MATCHC #1,OPTIONA,#LIST_SIZE,LIST
BNEQ 15$
PUSHAQ OKMSG
CALLS #1,G^LIB$PUT_OUTPUT
BRB 20$
15$: PUSHAQ NOMSG
CALLS #1,G^LIB$PUT_OUTPUT
20$: PUSHAQ DMSG
CALLS #1,G^LIB$PUT_OUTPUT
MATCHC #1,OPTIOND,#LIST_SIZE,LIST
BNEQ 25$
PUSHAQ OKMSG
CALLS #1,G^LIB$PUT_OUTPUT
BNEQ 30$
25$: PUSHAQ NOMSG
CALLS #1,G^LIB$PUT_OUTPUT
30$: $EXIT_S
RET
.PSECT DATA,NOEXE
OPTIONA: .ASCII /A/
OPTIOND: .ASCII /D/
LIST: .ASCII /CAT/
LIST_SIZE = 3
AMSG: .ASCID /Looking for A in CAT/
DMSG: .ASCID /Looking for D in CAT/
OKMSG: .ASCID /Match found/
NOMSG: .ASCID /No match found/
.END TEST
|