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 / DUALPORT.LBR / DUALPORT.AZM / DUALPORT.ASM
Assembly Source File  |  2000-06-30  |  4KB  |  113 lines

  1. ;**************************************************************************
  2. ;                                                                         *
  3. ; Program       - DUALPORT          Console output modification for       *
  4. ; Author        - E. L. Bergh       demos where multiple displays         *
  5. ; Date Written  - 02/11/84          are needed.                           *
  6. ;                                                                         *
  7. ;               ***  Written for the Kaypro II  ***                       *
  8. ;                                                                         *
  9. ;-------------------------------------------------------------------------*
  10. ;                                                                         *
  11. ;                     Copyright (c) 1984,  E. L. Bergh II                 *
  12. ;                                                                         *
  13. ; All rights reserved, permissions to use, modify, and copy are granted   *
  14. ; but permission is not granted to sell this program.                     *
  15. ;            No warranties are expressed or implied.                      *
  16. ;                                                                         *
  17. ;-------------------------------------------------------------------------*
  18. ;                                                                         *
  19. ;       This program modifies the BIOS console output vector              *
  20. ;       to pass control thru a "small" program that is                    *
  21. ;       installed in the RESTART vector area of memory.  The              *
  22. ;       program remains active until a system-reset is done.              *
  23. ;                                      *
  24. ;                    A>DUALPORT<cr>                                       *
  25. ;                                      *
  26. ;**************************************************************************
  27. ;
  28. boot    equ    0        ;system re-boot vector
  29. iobyte    equ    3        ;system i/o byte
  30. bdos    equ    5        ;system function call vector
  31. conot    equ    9        ;displacement to the CONOT vector
  32. small    equ    8        ;where the program will run
  33. baudp    equ    0        ;baud rate port
  34. ;
  35.     org    100h        ;set program origin
  36. ;
  37.     call    begin        ;go begin the program
  38.     db    13,10,'DUALPORT Vers 1.00  Dual Display Installation'
  39.     db    13,10,'---------------------------------------------'
  40.     db    13,10,10,'$'
  41. ;
  42. ;********************************************************************
  43. ;                                    *
  44. ;       This is the un-installed copy of the "small" program        *
  45. ;       that will be left behind in memory.                         *
  46. ;                                                                   *
  47. ;********************************************************************
  48. ;
  49. smallp    equ    $        ;beginning of the small program
  50.     push    b        ;save the data byte
  51.     lda    iobyte
  52.     ani    11111100b    ;select the TTY: device
  53.     sta    iobyte
  54. call1    call    0        ;display on the serial device first
  55.     lda    iobyte
  56.     ori    00000001b    ;select the CRT: device
  57.     sta    iobyte
  58.     pop    b
  59. call2    call    0        ;display on the screen second
  60.     mov    a,c        ;just like a normal call-return
  61.     ret
  62. slen    equ    $-smallp    ;figure the module length
  63. ;
  64. begin    equ    $        ;begin the program
  65.     pop    d        ;get the signon msg address
  66.     mvi    c,9        ;write buffer command
  67.     call    bdos        ;display the signon
  68. ;
  69.     lhld    boot+1        ;get the address of the BOOT vector
  70.     lxi    d,conot+1    ;get the displacement to the CONOT
  71.     dad    d
  72. ;
  73.     mov    e,m
  74.     inx    h
  75.     mov    d,m        ;get the CONOT address
  76. ;
  77.     dcx    h        ;fix pointer to the start
  78.     push    h        ;save the address
  79. ;
  80.     xchg            ;get the CONOT address in (hl)
  81.     shld    call1+1
  82.     shld    call2+1        ;patch the call statements
  83. ;
  84.     lxi    d,smallp    ;address of the small program
  85.     lxi    h,small        ;where to install the small program
  86.     mvi    b,slen        ;length of the small program
  87. ;
  88. move    equ    $        ;move loop
  89.     ldax    d        
  90.     mov    m,a        ;copy a byte
  91.     inx    d
  92.     inx    h        ;increment pointers
  93.     dcr    b        ;decr counters
  94.     jnz    move        ;loop
  95.  
  96.     pop    h        ;restore BIOS-CONOT address
  97.     lxi    d,small        ;where to pass control
  98.     mov    m,e
  99.     inx    h
  100.     mov    m,d        ;patch the BIOS-CONOT vector
  101. ;
  102.     mvi    a,14        ;9600 baud rate value
  103.     out    baudp        ;set the baudrate
  104. ;
  105.     lda    iobyte
  106.     ani    11111101b
  107.     ori    00000001b    ;insure CRT: to start with
  108.     sta    iobyte
  109. ;
  110.     ret            ;all done ...
  111. ;
  112.     end
  113.