home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part3 / vax / chiovax.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  488 b   |  50 lines

  1. #define EOL 10
  2. getchar() {
  3. #asm
  4.     movl    $0,r0
  5.     pushl    $1
  6.     pushal    buff
  7.     pushl    $0
  8.     calls    $3,Xread
  9.     cvtbl    buff,r0
  10.     .data
  11. buff:    .space 1
  12.     .text
  13. #endasm
  14. }
  15.  
  16. #asm
  17.     .set    read,3
  18. Xread:
  19.     .word    0x0000
  20.     chmk    $read
  21.     bcc     noerror2
  22.     jmp     cerror
  23. noerror2:
  24.     ret
  25. cerror:    bpt
  26. #endasm
  27.  
  28. putchar (c) char c; {
  29.     c;
  30. #asm
  31.     cvtlb    r0,buff
  32.     pushl    $1
  33.     pushal    buff
  34.     pushl    $1
  35.     calls    $3,Xwrite
  36.     cvtbl    buff,r0
  37. #endasm
  38. }
  39.  
  40. #asm
  41.     .set    write,4
  42. Xwrite:
  43.     .word    0x0000
  44.     chmk    $write
  45.     bcc     noerror
  46.     jmp     cerror
  47. noerror:
  48.     ret
  49. #endasm
  50.