Re:
> routines. I wrote a switch stub to call HPDATECONVERT. When I started
> calling the routine is when the fun started. The first iteration of my test
> program worked fine (see below). But when I added an ACCEPT statement to
> the program I got the following error:
> RUN NEWTESTX;LIB=G
> Enter Date (YYMMDD):
> 980101
>
> **** INTERNAL TRAP
> Data Memory Protection Trap
> [VSM] Invalid Address Alignment
The "status" parameter to HPDATECONVERT is (OMHO) incorrectly
defined as 4-byte aligned ... CM COBOL appears to have a 50/50
chance of putting your variable at an even DB address (and thus
a 4-byte aligned virtual address).
I'd report a bug in HPDATECONVERT...all intrinsics that take status
parameters should only require 2-byte alignment!
Ugly workaround:
declare a 4-byte status, a 2-byte slop, a 4-byte status, and using
the COBOL "loc" (???) construct, choose the one at run-time that has
an even DB address (assuming we're dealing with halfword addresses,
and not byte addresses).
SS