Browse Source

ed: fix 'd' going crazy when deleting last lines of buf

pull/10/head
Virgil Dupras 5 years ago
parent
commit
0237ff105f
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      apps/ed/buf.asm

+ 7
- 0
apps/ed/buf.asm View File

@@ -111,6 +111,13 @@ bufDelLines:
pop de ; <-- lvl 2
pop hl ; <-- lvl 1
; Line count updated!
; One other thing... is BC zero? Because if it is, then we shouldn't
; call ldir (otherwise we're on for a veeeery long loop), BC=0 means
; that only last lines were deleted. nothing to do.
ld a, b
or c
ret z ; BC==0, return

; let's have invert HL and DE to match LDIR's signature
ex de, hl
; At this point we have higher index in HL, lower index in DE and number


Loading…
Cancel
Save