summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2015-12-11 15:09:23 +0100
committerLeo C2015-12-11 15:09:23 +0100
commit7813a2e4a8bc4b3453911e811f3e196936ea2a3b (patch)
tree9ee131cd34de66ce62c67012a34a774cac5b0d49
parent49a5f06233e92c28feaf0b42d2b0521b1ebf5bd9 (diff)
downloadkermit-80-master.zip
Bugfix in outmdm (output buffer flush)HEADmaster
-rw-r--r--cpxac.asm15
1 files changed, 8 insertions, 7 deletions
diff --git a/cpxac.asm b/cpxac.asm
index f8763c8..0b15d21 100644
--- a/cpxac.asm
+++ b/cpxac.asm
@@ -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