home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ZSYS / SIMTEL20 / SYSLIB / SLIB1.LBR / SCODEND.Z80 < prev    next >
Text File  |  2000-06-30  |  896b  |  37 lines

  1. ;
  2. ; SYSLIB Module Name:  SCODEN
  3. ; Author:  Richard Conn
  4. ; SYSLIB Version Number:  3.6
  5. ; Module Version Number:  1.2
  6.  
  7.     public    codend,$memry
  8.  
  9. ;
  10. ;  This module returns the address of the last element of code in
  11. ;  in the user's object program.  This address should correspond to
  12. ;  the first available block for scratch buffer area.
  13. ;
  14. ;  Thanks to Ron Fowler for pointing out the availability of the
  15. ;  $MEMRY variable.  This value is filled in by LINK-80 when the
  16. ;  external references are resolved.
  17. ;
  18. ;  Input Parameters:  None
  19. ;  Output Parameters:  HL = Address of next page
  20. ;
  21. CODEND:
  22.     PUSH    AF
  23.     LD    HL,($MEMRY)        ; GET ADDRESS OF NEXT BYTE
  24.     LD    A,L        ; DON'T WASTE SPACE IF AT 256-BYTE
  25.     OR    A        ;   BLOCK BOUNDARY
  26.     JP    Z,CODE1
  27.     INC    H        ; NEXT BLOCK
  28.     LD    L,0
  29. CODE1:
  30.     POP    AF
  31.     RET
  32.  
  33. $MEMRY:
  34.     DS    2        ; FILLED IN BY L80
  35.  
  36.     END
  37.