home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / SWITCHIO.AZM / SWITCHIO.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  1.5 KB  |  53 lines

  1. ;----------------------------------------------------------------
  2. ;        This is a module in the ASMLIB library
  3. ; This module allows the operator to switch output for the screen 
  4. ; to any of the printer/onsole combinations.
  5. ;
  6. ;            Written         R.C.H.     16/8/83
  7. ;            Last Update    R.C.H.       31/12/83
  8. ;
  9. ; Make code non-self-modifying.              R.C.H.    30/9/83
  10. ; Added ? to destbyte                  R.C.H.    31/12/83
  11. ;----------------------------------------------------------------
  12. ;
  13.     name    'switchio'
  14. ;
  15.     public    echolst,listout,consout
  16.     extrn    ?destbyte
  17.     maclib    z80
  18. ;
  19. ;----------------------------------------------------------------
  20. ; Enable output to go to the list device as well as the screen
  21. ;----------------------------------------------------------------
  22. ;
  23. echolst:
  24.     mvi    a,2
  25.     jr    put$dest        ; enable list device
  26. ;
  27. ;----------------------------------------------------------------
  28. ;     Send all output meant for the screen to the printer.
  29. ;----------------------------------------------------------------
  30. ;
  31. listout:
  32.     mvi    a,1
  33.     jr    put$dest        ; enable list driver
  34. ;
  35. ;----------------------------------------------------------------
  36. ;     Re-select output to go to the list device.
  37. ;----------------------------------------------------------------
  38. ;
  39. consout:
  40.     xra    a
  41. ;
  42. ; FALL THROUGH to enable the console device driver
  43. ; This works by loading the device destination byte (DESTBYTE) with the
  44. ; value of the output device required.
  45. ;
  46. put$dest:
  47.     sta    ?destbyte
  48.     ret
  49. ;
  50.     end
  51.  
  52.  
  53.