#0A
ZXNet echo conference «code.zx»
From Paul Falcon → To Sergey Romanov 17 May 1997
* Message from gate SpbZxNet<=>FidoNet.
>Hello All!
>Maybe someone can give me a program to remove it
>are there 10 codes in the text?
>Input parameters:
>HL-address of the beginning of the text;
>BC-Text length in bytes;
>Output parameters:
>BC-new text length.
>Who's going to take charge? ;)
Why is it really so difficult?
you just need to build a small
procedure.
ldix,lenght; code length
ld hl,start_adress;this is the start
;total program text
no_end ld a,(hl)
cp #0a
jr nz,no_0a
push hl
ld e,l
ld d,h
dec de
ldc,lx
ld b,hx
ldir; transfer of the remaining
;code 1 byte down
pop hl
dec hl
no_0a inc hl
dec lx
jr nz,no_end
dec hx
jr nz,no_end
ld de,start_adress
and a
sbc hl,de
ld c,l
ld b,h;new length
ret
In short, I didn’t check it, but the point is I
I think it's clear.
-+- zyasm (macro-nosed)
+ Origin: you too.(812/03.00)
From Michael Kondratyev → To Paul Falcon 19 May 1997
Hello Paul!
Sat May 17 1997, Paul Falcon (812/03.00) concocted a letter to Sergey Romanov:
PF> you just need to build a small one
PF> procedure.
PF> ld ix,lenght; code length
PF> ld hl,start_adress;this is the start
PF> ld b,h;new length
PF>ret
PF> In short, I didn’t check it, but that makes sense
PF> I think it’s clear.
nonsense. Isn't it simpler this way:
ld hl, start_address
ld bc, length
push bc
ld d, h
ld e, l
ld a, 0ah
@@loop:
cp(hl)
ldi
jr nz, @@next
dec de
@@next:
jp pe, @@loop
cp a
sbc hl, de
ex de, hl
pop hl
sbc hl, de ; new size
With best wishes, Michael.