home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / asm_kit / putcb.asm < prev    next >
Assembly Source File  |  1985-06-21  |  896b  |  26 lines

  1. ;ROUTINE TO PUT ONE BYTE INTO CIRCULAR BUFFER
  2. ;
  3. putcbuff      proc     far
  4. ;
  5. ;put the byte into the buffer
  6.               mov      cbuff[di],al    ;byte goes into buffer
  7. ;
  8. ;adjust pointer
  9.               inc      di              ;point to the next character
  10.               cmp      di,cbuffsize    ;wrap it around?
  11.               jne      putcbuff1       ;skip if no wrap
  12.               mov      di,0            ;wrap back to zero
  13. ;
  14. ;count it
  15. putcbuff1:
  16.               inc      gauge           ;count the character
  17.               cmp      gauge,nearfull  ;too many characters?
  18.               jne      putcbuff2       ;skip if not
  19.               call     comoff          ;request to stop flow
  20. putcbuff2:
  21. ;
  22. putcbuffret:
  23.               ret
  24. ;
  25. putcbcuff     endp
  26.