home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / PROLOG.AZM / PROLOG.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  2.6 KB  |  92 lines

  1. ;----------------------------------------------------------------
  2. ;        This is a module in the ASMLIB library
  3. ;
  4. ; This is the root module for the ASMLIB library and provides storage
  5. ; that is used by other modules. The user must call this routine in
  6. ; order to gain access to most other modules in ASMLIB. This module
  7. ; also contains code to exit to the O.S. 
  8. ;
  9. ;            Written         R.C.H.     16/8/83
  10. ;            Last Update    R.C.H.       02/04/84
  11. ;
  12. ; Added data equates and initialized stack space        30/9/83
  13. ; Added ? to global data bytes                    31/12/83
  14. ;----------------------------------------------------------------
  15. ;
  16.     name    'prolog'
  17. ;
  18.     public    prolog,quit,version    ; entry points
  19. ; Storage for all....
  20.     public    ?blank,?lzbflg,?lzbchr,?result,?binnum
  21.     public    ?stack,?ccp$stack,?destbyte
  22.     public    datstart,datend
  23. ;
  24. libver    equ    0106h        ; Version 1 release 5
  25. bdos    equ    5
  26. ;
  27. ;----------------------------------------------------------------
  28. ; Set up stack and get operating system version.
  29. ;----------------------------------------------------------------
  30. ;
  31. prolog:
  32.     pop    b            ; Fetch return address
  33.     lxi    h,0            
  34.     dad    sp            ; GET CP/M stack address
  35.     shld    ?ccp$stack        ; save the address for later
  36. ; Load local internal stack for 64 levels
  37.     lxi    sp,?stack        ; simple hey
  38.     push    b            ; Save the return address to caller
  39.     ret                ; back to the user.
  40. ;
  41. ;----------------------------------------------------------------
  42. ;     Exit from this program back to the operating system.
  43. ;----------------------------------------------------------------
  44. ;
  45. quit:
  46.     lhld    ?ccp$stack
  47.     sphl
  48.     ret                ; direct return to CP/M
  49. ;
  50. ;----------------------------------------------------------------
  51. ; Get the internal version number of this library.
  52. ;----------------------------------------------------------------
  53. ;
  54. version:
  55.     lxi    h,libver
  56.     ret
  57. ;
  58. ;----------------------------------------------------------------
  59. ;             Data atorage areas.
  60. ;----------------------------------------------------------------
  61. ;
  62.     dseg
  63. ;
  64. datstart:                ; Start of data areas
  65.     db    'SSSSSSSSSSSSSSSS'    ; 16 bytes of stack
  66.     db    'SSSSSSSSSSSSSSSS'    ; 32 bytes of stack
  67.     db    'SSSSSSSSSSSSSSSS'    ; 48 bytes of stack
  68.     db    'SSSSSSSSSSSSSSSS'    ; 64 bytes of stack
  69.     db    'SSSSSSSSSSSSSSSS'    ; 80 bytes of stack
  70.     db    'SSSSSSSSSSSSSSSS'    ; 96 bytes of stack
  71.     db    'SSSSSSSSSSSSSSSS'    ; 112 bytes of stack
  72.     db    'SSSSSSSSSSSSSSSS'    ; 128 bytes of stack
  73. ?stack:
  74.     db    00
  75. ?blank:    db    00
  76. osver    db    00,00
  77. ?lzbflg    db    00
  78. ?lzbchr    db    00
  79. ?result    db    00,00,00,00,00,00,00
  80. ?binnum    db    00,00
  81. ?destbyte    
  82.     db    00            ; Selects dispatched output devices
  83. ?ccp$stack
  84.     db    00,00
  85. datend:
  86. ;
  87.     end
  88.  
  89.  
  90.  
  91.  
  92.