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 / JSAGE / ZSUS / PROGPACK / SCZ01BET.LBR / SYSCCFG0.CZZ / SYSCCFG0.CCZ
Text File  |  1989-05-24  |  3KB  |  78 lines

  1.     .printx  * SYSCCFG0.CCZ: std cp/m header *
  2.     .z80     ; m80 needs this, slr ignores it
  3.  
  4. ;******************************************************************************
  5.  
  6.     .comment *
  7.  
  8.     copyright (c) Al Grabauskas, 1989
  9.  
  10.     system dependent header.
  11.  
  12.     this file contains code to be included at assembly time if a
  13.     a definition of "main()" was detected in SmallC/Z source.
  14.  
  15.     this file is used to connect your "main()" module to the
  16.     run-time support libraries of your choice.
  17.  
  18.     *
  19.  
  20. ;******************************************************************************
  21.  
  22. ;    startup code
  23.  
  24.     entry    Uloadpt
  25.     extrn    Uentry
  26.  
  27. Uloadpt:    jp    Uentry
  28.  
  29. ;    -----------------------------------------------------------------------
  30.  
  31. ;    these are entry and exit vectors. Uentry will walk Uinvec on program
  32. ;    startup, calling each routine in turn, and exit does the same on exit.
  33. ;    the Uinvec vectors must be "hard initilialized" here. the Uexvec
  34. ;    vectors may be modified at run time, by the Uinvec routines in 
  35. ;    particular. these vectors also serve to pull in the basic routines
  36. ;    in the link step.
  37.  
  38. ;    note:
  39.  
  40. ;    i chose to put this here, but if you find yourself having too many
  41. ;    variations of these, you may want to put them in a load module,
  42. ;    just putting a reference in here and letting the linker do the work.
  43.  
  44.     entry    Uinvec,Uexvec
  45.  
  46.     extrn    Usysinit        ; o/s dependent init routine
  47.     extrn    Umeminit        ; dynamic memory allocation sub-system
  48.  
  49. ;    main environment setup routine (calls main())
  50.     extrn    Umain
  51.  
  52. Uinvec:
  53.     dw    Umeminit        ; dynamic memory allocation init
  54.     dw    Usysinit        ; o/s dependent init routine
  55. ;;;;;;;    no i/o subsystem init required, but it would go here
  56.     dw    Umain            ; clib environment and main() execute
  57.                     ; (Umain always returns to system);
  58.  
  59.     entry    Uextrap            ; user exit trap vector
  60.     entry    Usetecd            ; o/s dependent set exit code vector
  61.     entry    Uiodint            ; i/o subsystem de-init vector
  62.     entry    Uretsys            ; return to system vector
  63.  
  64.     extrn    Unulrtn            ; null routine (just a ret)
  65.     extrn    Uexcd            ; o/s depepndent error code handler
  66.     extrn    Uioexit            ; i/o subsystem de-init
  67.     extrn    Uretcpm            ; return to o/s w/o warm boot
  68.  
  69. Uexvec:
  70. Uextrap:dw    Unulrtn            ; user code exit trap
  71. Usetecd:dw    Uexcd            ; o/s dependent error code handler
  72. Uiodint:dw    Uioexit            ; i/o subsystem de-init
  73. Uretsys:dw    Uretcpm            ; return to system w/o warm boot
  74.     dw    0            ; ensure a cold boot if the above 
  75.                     ;   is messed up for some reason 
  76.  
  77. ;******************************************************************************
  78.