home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / bbs / qbbs-utl.ark / TIMEUP.ASM < prev    next >
Assembly Source File  |  1986-09-14  |  2KB  |  74 lines

  1. ; TIMEUP for QBBS systems - Lawrence Davis - 05/19/86
  2. ; Version 1.0
  3. ;
  4. ; -------------------------------------------------------------------
  5. ; TIMEUP allows special access users (those tagged with 'S' flag) to
  6. ; gain additional time on the system.  Set the value at TIMEUP to the
  7. ; number of minutes that will added each time TIMEUP is run.  Be sure
  8. ; to set TUPASC the same.  Set the INCNUM equate to the number of
  9. ; increments that TIMEUP will allow.
  10. ; -------------------------------------------------------------------
  11. ;
  12. ; ** OPTION AREA **
  13. ;
  14. TIMEUP    EQU    15    ; Number of minutes to add
  15. TUPASC    EQU    '15'    ; Enter same number as TIMEUP between quotes
  16. INCNUM    EQU    2    ; Number of times to increment
  17. ;
  18. ; ** END OF OPTION AREA **
  19. ;
  20. SBYTE    EQU    10H    ; QBBS special status byte address
  21. CBYTE    EQU    11H    ; Counter address
  22. BDOS    EQU    5
  23. CR    EQU    13
  24. LF    EQU    10
  25. ;
  26. ORG    100H
  27. ;
  28. CSTAT:    LDA    SBYTE        ; Get special status byte
  29.     CPI    255        ; Is it set?
  30.     JZ    CTNUM        ; Yes, check counter
  31.     LXI    D,EXMSG        ; No, print exit msg
  32.     CALL    PRINT
  33.     JMP     EXIT        ; exit program
  34. ;
  35. CTNUM:    LDA    CBYTE        ; Get counter byte
  36.     CPI    INCNUM        ; Has it 'maxed out'?
  37.     JNZ    UCOUNT        ; No, go increment it
  38.           LXI    D,MAXMSG    ; Yes, print 'maxed out' msg
  39.     CALL     PRINT
  40.     JMP    EXIT
  41. ;
  42. UCOUNT:    ADI    1        ; Add one to counter
  43.     STA    CBYTE        ; Poke back to memory
  44.            MVI    C,81        ; Extended BYE/BDOS call to get maxtime
  45.     MVI    E,255
  46.     CALL    BDOS        ; Get maxtime allowed
  47.     ADI    TIMEUP        ; Add TIMEUP value
  48.         MVI    C,81    
  49.     MOV    E,A
  50.     CALL     BDOS        ; Poke new maxtime
  51.     LXI    D,TUPMSG    ; Tell user
  52.     CALL    PRINT
  53.     JMP     EXIT
  54. ;
  55. PRINT:    MVI    C,9
  56.     CALL    BDOS
  57.     RET
  58. MAXMSG:    
  59.     DB    CR,LF
  60.     DB    'Maximum time increment reached.'
  61.     DB    CR,LF,'$'
  62. TUPMSG:
  63.     DB    CR,LF
  64.     DB    'Time on system increased by '
  65.     DW    TUPASC
  66.     DB    ' minutes.'
  67.     DB    CR,LF,'$'
  68. EXMSG:
  69.     DB    CR,LF
  70.     DB    'Special Access Required.'
  71.     DB    CR,LF,'$'
  72. EXIT:
  73.     RET
  74.