1: /*
   2:  * Copyright (c) 1987 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifdef LIBC_SCCS
   8:         <@(#)fgetc.s	1.1 (Berkeley) 2/4/87\0>
   9:         .even
  10: #endif LIBC_SCCS
  11: 
  12: #include "DEFS.h"
  13: #include "STDIO.h"
  14: 
  15: .globl  __filbuf
  16: 
  17: /*
  18:  * fgetc(iop)
  19:  *	FILE	*iop;
  20:  *
  21:  * Return next character from stream fp or EOF on end of file.
  22:  *
  23:  */
  24: ENTRY(fgetc)
  25:         mov     2(sp),r1                / grab iop
  26:         dec     _CNT(r1)                / any characters available?
  27:         blt     1f
  28:         clr     r0                      / do an unsigned
  29:         bisb    *_PTR(r1),r0            /   movb to a register
  30:         inc     _PTR(r1)                / bop the pointer on one place,
  31:         rts     pc
  32: 1:
  33:         jmp     __filbuf                / let _filbuf(iop) handle it
Last modified: 1988-10-07
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2125
Valid CSS Valid XHTML 1.0 Strict