home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z3util / jltools.lbr / TESTCFG.AZM / TESTCFG.ASM
Encoding:
Assembly Source File  |  1993-06-07  |  1.4 KB  |  74 lines

  1. title    testcfg.asm 3/5/88
  2.  
  3. ; this is a dummy CFG module, to show the
  4. ; structure.  When run, it tells the console
  5. ; where it gets called by JetLDR.  The function number
  6. ; printout is just ascii, to keep it very simple.
  7. ; e.g. try:
  8. ;
  9. ;  A>JetLDR testcfg.zrl rcpsampl.zrl 
  10. ;
  11.  
  12. name    CFGtst        ;CFG required
  13.  
  14. com    /_CFG_/
  15.  
  16.     jp    start
  17.     db    'Z3CFG'
  18. ;
  19. start:    add    '0'        ; make parameter printable
  20.     ld    (altr),a
  21.     ld    a,c
  22.     add    '0'
  23.     ld    (cltr),a    ; ditto    
  24.     ld    hl,msg
  25.     call    sayit
  26.     ld    hl,envadr    ; we could reference the z3env
  27.                 ; directly, for example
  28.     xor    a        ; a = 0, PROCEED WITH NORMAL LOAD
  29.     ret
  30. ;
  31. pstraddr equ $+1
  32. sayit:    call    $-$        ; print nul-term. string
  33.     ret
  34. ;
  35. msg:    db    0dh,0ah
  36.     db    'cfg: a = pktype = '
  37. altr:    db    '    c = fn = '
  38. cltr:    db    '  ',0
  39.  
  40. com    /_ID_/
  41.     db    0dh,0ah
  42.     db    'testcfg 3/5/88',0
  43.  
  44. ; example of a named common reference
  45. ; (or, include Z3COMMON.LIB)
  46. ;
  47. com    /_ENV_/
  48. envadr    equ    $
  49.     
  50. com    /_INIT_/
  51. ;
  52. ; Example of initialization code for the CFG module
  53. ; and an inter-segment reference to the cfg base,
  54. ; which will use the print-string addr again.
  55. ;
  56. ; Note that this routine is called only once.
  57. ; The code is OVERLAYED after that with a dummy routine.
  58. ;
  59.  
  60.     ld    (pstraddr),hl    ; set up string-print address
  61.     ld    hl,initmsg
  62.     call    sayit
  63.     ret
  64.  
  65. initmsg:
  66.     db    0dh,0ah
  67.     db    'testinit: I''m here!',0
  68. ;    
  69.     end    ;testcfg
  70. art
  71.     db    'Z3CFG'
  72. ;
  73. start:    add    '0'        ; make p