; TITLE "SCODEND - Syslib 4.0" NAME ('CODEND') ;================================================================ ; Author : Harold F. Bower ; Derived from SCODEND.Z80 Ver 1.2 by Richard Conn ; Date : 4 Jul 89 ; Version : 1.3 ; Module : SCODEND ; Abstract: This module containd the routine CODEND which returns ; the address of the first page of memory available for user ; use. It is set from the $MEMRY variable which is set by ; most linkers based on the last DSEG address linked in the ; program. This module is NOT ROMmable due to data in CSEG. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC CODEND ; From SYSLIB Get.. EXT $MEMRY .Z80 CSEG ;=============================================================== ; NAME - CODEND ; Entry: - None ; Exit : HL - Contains the address of the first available page ; of user memory ; Uses : HL ; Special Requirements: Linker that handles $MEMRY variable ;=============================================================== CODEND: PUSH AF ; Save Regs PUSH DE LD HL,($MEMRY) ; Get the Value of $MEMRY added by Linker LD DE,00FFH ; Add offset to check for partial page ADD HL,DE LD L,D ; Zero L to start on Page Boundary POP DE ; ..and restore regs POP AF RET END