home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / EXTRA-ST / CPM-80-E / CPM-0.2 / CPM-0 / cpm-0.2 / z80-sources / mylib / bdosio.mac < prev    next >
Encoding:
Text File  |  1994-06-06  |  896 b   |  42 lines

  1. ;************************************************************************
  2. ;*        BDOS Character-I/O Subroutines                *
  3. ;************************************************************************
  4.  
  5.         entry _bdosin, _bdosout, _bdossts
  6.  
  7.         .z80            ;
  8. saveobc        macro            ;
  9.           push de        ;
  10.           push hl        ;
  11.           push ix        ;
  12.           push iy        ;
  13.         endm            ;
  14.  
  15. restore        macro            ;
  16.           pop iy        ;
  17.           pop ix        ;
  18.           pop hl        ;
  19.           pop de        ;
  20.           pop bc        ;
  21.         endm            ;
  22.  
  23. _bdosin:    push bc            ;
  24.         ld c,1            ; Console input
  25.         jr bdoscall        ;
  26.  
  27. _bdossts:    push bc            ;
  28.         ld c,11            ; Console status
  29.         jr bdoscall        ;
  30.  
  31. _bdosout:    push bc            ;
  32.         ld c,2            ; Console output
  33.  
  34. bdoscall:    saveobc            ; die restlichen Register retten
  35.         ld e,a            ; falls Console out
  36.         call 5            ;
  37.         or a            ; falls Console status
  38.         restore            ;
  39.         ret            ;
  40.  
  41.         end            ;
  42.