diff options
-rw-r--r-- | cpxac.asm | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -707,7 +707,7 @@ outcon: outmdm:
push hl
ld hl,(outptr)
- ld (hl),e ;return buffered char
+ ld (hl),e ;save char in buffer
inc hl
ld (outptr),hl
ld a,(outcnt)
@@ -750,22 +750,23 @@ omf_2: ld a,2 ;start write transaction
out (VI2C_CTRL),a
- ld hl,outbuf+2
- ld (outptr),hl
+ ld hl,outbuf+2 ;buffer start
ld a,(outcnt)
- sub c
+ sub c ;buffer now empty?
ld (outcnt),a
jr z,omfex
- push de
- ld d,h
+ push de ;no, shift remaining chars down
+ ld d,h ;dest = buffer start
ld e,l
ld b,0
- add hl,bc
+ add hl,bc ;src = buffer start + num chars last transmitted
ld c,a
ldir
+ ex de,hl
pop de
omfex:
+ ld (outptr),hl
pop bc
pop hl
ret
|