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 / KPTRCLK.LBR / KPTRCLK.ASM next >
Assembly Source File  |  2000-06-30  |  1KB  |  48 lines

  1. ; ADVCLK.ASM  -  Display the clock on Kaypro's 25th Line
  2.  
  3. ; John T. Brown  2/21/87
  4.  
  5. ;----------------------------------------------------------------
  6.  
  7. ; equates
  8.  
  9. bdos    equ    5        ;CP/M's BDOS entry point
  10. esc    equ    1bh        ;ESCape for Kaypro video sequences
  11.  
  12.     org    100h        ;CP/M's program area
  13.  
  14. start:    lxi    h,0        ;save CP/M's stack by adding it
  15.     dad    sp        ;to the stack pointer and
  16.     shld    cpmstk        ;storing it in a safe place
  17.     lxi    sp,stack+20    ;to generate a new stack for use
  18.                 ;by this program
  19.  
  20.     lxi    d,msg        ;point at message
  21.     mvi    c,9        ;print string function
  22.     call    bdos        ;do it
  23.  
  24.     lhld    cpmstk        ;get the old stack back
  25.     sphl            ;switch into stack pointer
  26.     ret            ;and return to CP/M
  27.  
  28. ; The clock message:
  29.  
  30. msg:    db      esc,'B7'        ;enable 25th line
  31.         db      esc,'B8'        ;turn on the clock
  32.  
  33.     db    esc,'B6'    ;save cursor position
  34.     db    esc,'=8W '    ;position cursor to 25,60
  35.  
  36.     db    esc,'B1'    ;dim video on
  37.     db    ' Current time is:'    ;first label
  38.     db    esc,'C1'    ;dim video off
  39.         db    esc,'C6'        ;restore cursor position
  40.     db    '$'        ;end of msg
  41.  
  42. cpmstk    dw    0        ;old stack saved here
  43.  
  44.     ds    20        ;stack grows down
  45. stack    equ    $        ; ds must be BEFORE label stack
  46.  
  47.     end
  48.