home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / gst03.lbr / VBAR.ZZ0 / VBAR.Z80
Encoding:
Text File  |  1993-06-07  |  3.4 KB  |  154 lines

  1. ;********************************************************************
  2. ;
  3. ;    VBAR: A ZCPR 3.3+ compatible routine, using the version 4
  4. ;        libraries, to place draw a vertical bar on the screen
  5. ;        for use in alias scripts.
  6. ;
  7. ; Version 3.0D (July 7, 1990) - Updated and re-linked based upon 
  8. ;  VLIB4D and version 4 libraries.  Assembled with SLR's Z80ASM and 
  9. ;  linked with DRI's LINK.  Thanks go to Dave Ramsey for producing
  10. ;  an excellent set of command-level graphics tools.   Bob Dean
  11. ;
  12. ; Author: Dave Ramsey            Date: May 25, 1989
  13. ;  Versions 1.0 and 2.0.    
  14. ;
  15. ;********************************************************************
  16. ;
  17. ; VLIB/Z3LIB/SYSLIB references:
  18. ;
  19.     ext    gz3init,tinit,dinit,drvbar,vpstr
  20.     ext    eval10,argv
  21. ;
  22. ; Constants defined:
  23. ;
  24. VERSION    equ     3
  25. MONTH    equ     7
  26. DAY    equ     5
  27. YEAR    equ    90
  28. ;
  29. DOS    equ    5
  30. BUFFER    equ    080h
  31. CR    equ    13
  32. LF    equ    10
  33. ARGCNT    equ    5
  34. start:
  35.     jp    main
  36.     db    'Z3ENV'
  37.     db    1
  38. z3eadr:    ds    2
  39. main:
  40.     ld    hl,(z3eadr)
  41.     call    gz3init
  42.     and    a,0fh
  43.     jr    nz,stack
  44.     ld    hl,oldtcpmsg
  45.     call    vpstr
  46.     ret
  47. ;
  48. ; setup stack...
  49. ;
  50. stack:
  51.     ld    hl,0
  52.     add    hl,sp
  53.     ld    (oldsp),hl
  54.     ld    hl,(DOS+1)
  55.     ld    l,0
  56.     ld    a,h
  57.     add    a,-8
  58.     ld    h,a
  59.     ld    sp,hl
  60. ;
  61. ; Get command line parms, there should be 5, and store results
  62. ;
  63.     ld    a,0ffh        ; null terminate argument strings
  64.     ld    hl,BUFFER+1
  65.     ld    de,tokentbl
  66.     call    argv
  67.     ld    a,(numtok)
  68.     cp    a,ARGCNT    ; did the user get it right?
  69.     jp    nz,gethelp    ; nope, tell him how to call us.
  70. ;
  71. ; Else, store parm results directly inline for the drbox call and execute
  72. ;
  73.     ld    hl,(parm1)
  74.     call    eval10
  75.     ld    (type),a
  76.     ld    hl,(parm2)
  77.     call    eval10
  78.     ld    (row),a        ; save row number
  79.     ld    hl,(parm3)
  80.     call    eval10
  81.     ld    (col),a        ; save column number
  82.     ld    hl,(parm4)
  83.     call    eval10
  84.     ld    (length),a    ; save height
  85.     ld    hl,(parm5)
  86.     call    eval10
  87.     ld    (direct),a    ; save width
  88. ;
  89. ; else... init terminal as per V4 lib conventions
  90. ;
  91.     call    tinit
  92. ;
  93. ; Call DRBOX routine to draw the box.
  94. ;
  95. linebox:
  96.     call    drvbar
  97. type:    db    0
  98. row:    db    0
  99. col:    db    0
  100. length: db    0
  101. direct:    db    0
  102.  
  103. ;
  104. ; deinit terminal and restore stack
  105. ;
  106. fini:
  107.     call    dinit
  108. ;
  109. fini2:
  110.     ld    hl,(oldsp)
  111.     ld    sp,hl
  112.     ret
  113. ;
  114. ;
  115. gethelp:
  116.     ld    hl,helpmsg
  117.     call    vpstr
  118.     jp    fini2
  119.  
  120. ;
  121. oldsp:    ds    2
  122. ;
  123. tokentbl:
  124. maxtok: db    ARGCNT    ; I don't want to see more than 5 arguments,
  125. numtok: db    0    ; but how many were there really?
  126. parm1:    ds    2    ; address arg 1 - bar type
  127. parm2:    ds    2    ; address arg 2 - row
  128. parm3:    ds    2    ; address arg 3 - col
  129. parm4:    ds    2    ; address arg 4 - length
  130. parm5:    ds    2    ; address arg 5 - direction
  131. ;
  132. ;
  133. helpmsg:
  134.     db    'VBAR, Version ',VERSION/10+'0','.',VERSION MOD 10+'0',CR,LF
  135.     db    'VBAR - Draws a vertical bar on the screen.',CR,LF
  136.     db    'Syntax:',CR,LF
  137.     db    '     VBAR <type> <row> <col> <length> <direction>',CR,LF
  138.     db    'Where:',CR,LF
  139.     db    '     <type> is an integer 1 for solid single wide, ',CR,LF
  140.     db    '            an integer 2 for solid double wide, ',CR,LF
  141.     db    '            an integer 3 for hashed single wide, or',CR,LF
  142.     db    '            an integer 4 for hashed double wide;',CR,LF
  143.     db    '     <row>  is the start row of the box on the screen;',CR,LF
  144.     db    '     <col>  is the start column on the screen;',CR,LF
  145.     db    '     <length> is the length of the bar; and',CR,LF
  146.     db    '     <direction> is 0 for top to bottom or',CR,LF
  147.     db    '            a 1 for bottom-to-top.',CR,LF,0
  148. ;
  149. oldtcpmsg:
  150.     db    'Extended TCAP not present.',CR,LF,0
  151. ;
  152.     end
  153.