home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part3 / 8080 / inout.c < prev    next >
Encoding:
Text File  |  1986-11-30  |  257 b   |  27 lines

  1. inp(pno) char pno; {
  2.     pno;
  3. #asm
  4.     mov    a,l
  5.     sta    ininst+1
  6. ininst    in    0    ; self modifying code...
  7.     mov    l,a
  8.     xra    a
  9.     mov    h,a
  10.     ret
  11. #endasm
  12. }
  13.  
  14. outp(pno, val) char pno, val; {
  15.     pno;
  16. #asm
  17.     mov    a,l
  18.     sta    outinst+1
  19. #endasm
  20.     val;
  21. #asm
  22.     mov    a,l
  23. outinst    out    0
  24.     ret
  25. #endasm
  26. }
  27.