extrn .getusr, .setusr, .broom, .ldem, .dos extrn .advance, b.cnt ; @dma equ 26 @wtseq equ 21 ; ; Write buffer hl^ until less than 128 bytes stored. ; Carry for write error. ; Reset pointers for any extra portion not written. ; Assumes no access via rdptr, i.e. output only buffer ; This code assumes buffer size to be a multiple of 128 bytes, ; so that single writes never need to "wrap around" the buffer. ; a,f .bdump:: call .getusr push psw mov a,m ani 01fh call .setusr push b ! push d ! push h bdump1: inx h ! inx h mov c,m ! inx h ! mov b,m; get size inx h ! call .ldem; get fcb, point to cnt mov a,m ! ani 080h; check cnt inx h ! ora m jz bdumpx; < 128 stored mov a,d ! ora e ! stc jz bdumpx; error, no fcb push d; save fcb dcx h mov a,m ! sui 128 ! mov m,a inx h mov a,m ! sbi 0 ! mov m,a; cnt := cnt - 128 inx h call .advance ! inx h; rptr, check wrap inx h ! inx h ! dad d; form access pointer xchg mvi a,@dma call .dos; set xfr address pop d mvi a,@wtseq call .dos; write it pop h ! push h stc; in case of write error jz bdump1; repeat until empty or error bdumpx: pop h ! pop d ! pop b xthl; get entry user to h push psw; save any error flag mov a,h call .setusr; restore entry user pop psw pop h ret