pTAL Conversion Guide

pTAL Built-In Routines
pTAL Conversion Guide527302-002
18-52
$UNLOCKPAGE
pTAL checks the following conditions during compilation:
If divisor evaluates to a constant value of zero, pTAL reports an error that divide
by zero is invalid:
$UDIVREM32(dividend, 2 / 2 - 1, quot, rem); ! Report error
If both dividend and divisor are constants, and you test $OVERFLOW
following the call to $UDIVREM32, pTAL reports a warning that overflow cannot
occur:
$UDIVREM32(32767, 256, quot, rem);
IF $OVERFLOW THEN ... ! Report warning
If pTAL reports an error because overflow occurs for constant dividend and constant
divisor , it does not report a warning if you test $OVERFLOW in the following IF
statement:
$UDIVREM32(65536 * 1024, 256, quot, rem); ! Report error
IF $OVERFLOW THEN ... ! No warning or error
$UNLOCKPAGE
$UNLOCKPAGE unlocks a page of extended memory.
Example 18-37. Call to $UDIVREM32 Routine
INT(32) dividend;
INT divisor;
INT(32) quotient;
INT remainder;
$UDIVREM32(dividend, divisor, quotient, remainder);
Note. The EpTAL compiler does not support this procedure.
pTAL privileged procedure Yes
Can be executed only by privileged procedures Yes
Sets condition code Yes
Sets $CARRY No
Sets $OVERFLOW No
$UNLOCKPAGE
( unlockcount , )
;
virtaddr
VST655.vsd