Add library function for null pointer checking.

This is used by the new ORCA/C debugging option to check for illegal use of null pointers. It is similar to an existing routine in PasLib used by ORCA/Pascal's similar checks.
This commit is contained in:
Stephen Heumann 2023-02-12 18:57:56 -06:00
parent 3551644355
commit 74de206058
1 changed files with 18 additions and 0 deletions

18
cc.asm
View File

@ -433,6 +433,24 @@ ret tya store return value in result space
rtl return to original caller
end
****************************************************************
*
* ~CheckPtrC - check a pointer to insure it is not null
*
* Inputs:
* 1,S - return address
* 4,S - pointer
*
****************************************************************
*
~CheckPtrC start
lda 4,S
ora 5,S
bne lb1
error #1 subrange exceeded
lb1 rtl
end
****************************************************************
*
* ~CUMul2 - unsigned multiply