home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / asmutl / buffers.lbr / BPUT.MZC / BPUT.MAC
Encoding:
Text File  |  1987-01-15  |  640 b   |  21 lines

  1.     extrn    .advptr, .inxm
  2. ;
  3. ; put byte c to buffer hl^.  No range checks
  4. ; a,f
  5. .bput::    push h    ! push d ! push b
  6.     inx h    ! inx h;        adv to size store
  7.     mov c,m    ! inx h ! mov b,m;    get size
  8.     inx h    ! inx h ! inx h;    point to ctr field
  9.     call    .inxm ! inx h;        and decrement
  10.     inx h    ! inx h;        advance to write ptr
  11.     mov e,m ! inx h ! mov d,m;    get read ptr
  12.     push    d;            save, before advance
  13.     call    .advptr;        advance modulo bc
  14.     mov m,d    ! dcx h ! mov m,e;    and save
  15.     pop    d
  16.     inx h    ! inx h;        advance to buff base
  17.     pop    b
  18.     dad d    ! mov m,c;        index and put char. clr cy.
  19.     pop d    ! pop h
  20.     ret
  21. ù