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 / KAYPRO / KPRULE25.LBR / CLS.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  1KB  |  51 lines

  1. * kp-cls.asm
  2.  
  3. * clear screen/25th line/restore cursor - for video-able kaypros
  4. * also toggles all video attributes OFF (defaults)
  5.  
  6. * v1.0  24-Oct-84
  7. * v1.1  05-Jul-85  Added stack save/restore code
  8.  
  9. * Steve Sanders
  10. * Tampa Bay Kaypro Users Group
  11. * DataCOM NETWORK System #1 (813) 937-3608  300/1200/2400 bps
  12.  
  13. bdos    equ    5
  14. printf    equ    9
  15. esc    equ    1bh
  16.  
  17.     org    100h
  18.  
  19. begin:    
  20.     lxi    h,0        ;save old stack
  21.     dad    sp
  22.     shld    cpmstk        ;store it in a safe place
  23.     lxi    sp,stack+5    ;generate new stack
  24.  
  25.     mvi    c,printf    ;print string command
  26.     lxi    d,clear        ;point to message
  27.     call    bdos        ;and do it
  28.  
  29.     lhld    cpmstk        ;get old stack
  30.     sphl            ;switch into stack pointer
  31.     ret            ;and exit 'cleanly' to CP/M
  32.  
  33. ; following console msg will reset all attributes to default
  34.  
  35. clear:
  36.     db    esc,'B4'    ;ESCape, cursor ON (if OFF)
  37.     db    esc,'C0'    ;inverse video OFF
  38.     db    esc,'C1'    ;half intensity OFF
  39.     db    esc,'C2'    ;blinking OFF
  40.     db    esc,'C3'    ;underlining OFF
  41.     db    esc,'C7'    ;disable status line before 1ah
  42.     db    1ah        ;and clear whole screen/home cursor
  43.     db    '$'        ;thats all folks
  44.  
  45. cpmstk    dw    0        ;old stack saved here
  46.  
  47.     ds    5
  48. stack    equ    $
  49.  
  50.     end
  51.