Print: 51 characters per line
ZXNet echo conference «code.zx»
From 500:812/07.05 → To Dmitry Lomov 10 May 1998
Hello, Dmitry!
[...]
This is the same procedure for printing a line on
51 characters.... Due to the fact that I received
elk copied from XAS into a notebook, and
from a notebook in ZXASM, it could have crept in
error.
And here is the procedure for outputting the line:
PRINT51 LD A,H; HL-SCRN ADDRESS
LD (PXS0+1),A
LD (PXS1+1),A
LD (PXS2+1),A
EX DE,HL
EXX
LD B,7; Cycle
LD HL,STRING; String
PXSB LD E,(HL)
INC L
LD A,(HL)
INC L
LD D,#60; by #6000 font
EXX
LD C,A
EXX
LD A,(HL)
INC L
EX DE,HL
EXX
LD L,A
LD B,#60
!ASSM7
LD A,(BC)
RRCA
RRCA
RRCA
LD H,B
LD H,(HL)
INC B
RRA
RR H
RRA
RR H
EXX
OR(HL)
INC H
EXX
LD(DE),A
INC E
LD A,H
LD(DE),A; 1&2&3 character
DEC E
INC D
!CONT
EXX
DEC B
RET Z; refund if arrived
EX DE,HL
LD A,(HL)
INC L
EXX
PXS0 LD D,0
LD L,A
EX DE,HL
EXX
LD A,(HL)
INC L
LD E,(HL)
INC L
LD D,#60EX DE,HL
EXX
LD C,A
LD B,#60
!ASSM 7
LD D,B
LD A,(DE)
RRC (HL)
RLA
RL (HL)
INC L
LD D,A
LD A,(BC)
INC B
RRCA
RRCA
RRCA
SRL A
EXX
LD C,(HL)
RR C
EX AF,AF
INC H
LD A,C
RRCA
RRCA
EXX
INC L
LD (HL),A
DEC L
EX AF,AF
OR D
LD (HL),A
DEC L
INC H
!CONT
LD D,B
LD A,(DE)
RRC (HL)
RLA
RL (HL)
INC L
LD D,A
LD A,(BC)
RRCA
RRCA
RRCA
SRL A
EXX
LD C,(HL)
RR C
EX AF,AF
LD A,C
RRCA
RRCA
EXX
INC L
LD (HL),A
DEC L
EX AF,AF
OR D
LD (HL),A; 4&5&6 символ
INC L
PXS1 LD H,0
EXX
EX DE,HL
LD A,(HL)
INC L
EXX
LD E,A
EXX
LD A,(HL)
INC L
EXX
LD C,A
LD B,#60
EX DE,HL
!ASSM 7
LD H,B
LD H,(HL)
LD A,(DE)
RL HR.L.A.
RL H
R.L.A.
LD(DE),A
INC E
LD A,(BC)
INC B
RRCA
RRCA
RRCA
OR H
LD(DE),A
INC D
DEC E
!CONT
LD H,B
LD H,(HL)
LD A,(DE)
RL H
R.L.A.
RL H
R.L.A.
LD(DE),A
INC E
LD A,(BC)
RRCA
RRCA
RRCA
ORH
LD(DE),A; 7&8 symbol
INC E
PXS2 LD D,0
EXX
JP PXSB
Routine... at first glance it may seem
nonsense, especially when you optimize it.
This procedure is slightly shortened, i.e. in
in my program it is slightly modified.
If the reader is more overwhelmed,
then I think he will figure it out
a simple procedure.
See you soon, PHOENIX.
-+- ZXASM 3.0
From 500:812/07.05 → To Dmitry Lomov 13 May 1998
Hello, Dmitry!
YK>> This is the procedure for printing a line on
YK>> 51 characters.... Due to the fact that I received -
DL> []
YK>> And here is the procedure for outputting the line:
DL> [skip huge procedure]
DL> seems to work. :)
DL> only one "but" -
DL> at the first part (which prints the first three characters in two
DL> column bytes) repetitions - 7 pieces, and a simplified "tail"
DL> like other pieces, no. therefore, it seems, the first three characters
DL> will occupy seven pixels vertically, not eight
DL> (IMHO, of course; I didn’t dig in detail.)
as I wrote, there could be a mistake.
DL> I calculated (approximately) the operating speed - 78 clock cycles/screen byte,
DL> or 392 clock cycles per character. printing the entire line - 20,000 cycles.
DL> does this match your data?
Well, about 3... lines in the interruption.
Here's a slightly different procedure, it's a little
quickly:
PRINT51 LD A,H; HL - SCRN ADDRESS
LD (PXS0+1),A
LD (PXS1+1),A
CALL PXSA
EX DE,HL
LD A,H
SUB 7LD H,A
!ASSM 7
RLC (HL)
INC H
!CONT
RLC (HL)
RET
PXSA EX DE,HL
EXX
LD LY,7; счетчик
LD HL,STRING
PXSB LD E,(HL)
INC L
LD A,(HL)
INC L
LD D,#60; По #6000 фонт
EXX
LD C,A
EXX
LD A,(HL)
INC L
EX DE,HL
EXX
LD L,A
LD B,#60
!ASSM 7
LD A,(BC)
RRCA
RRCA
RRCA
LD H,B
LD H,(HL)
INC B
RRA
RR H
RRA
RR H
EXX
OR (HL)
INC H
EXX
LD (DE),A
INC E
LD A,H
RRCA
LD (DE),A
DEC E
INC D
!CONT
LD A,(BC)
RRCA
RRCA
RRCA
LD H,B
LD H,(HL)
RRA
RR H
RRA
RR H
EXX
OR (HL)
EXX
LD (DE),A
INC E
LD A,H
RRCA
LD (DE),A;1&2&3
DEC LY
RET Z
PXS0 LD D,0
EXX
EX DE,HL
LD A,(HL)
INC L
EXX
EX DE,HL LD E,A
EXX
LD A,(HL)
INC L
LD B,(HL)
INC L
LD E,(HL)
INC L
PUSH HL
LD H,(HL)
LD D,#60
EX DE,HL;
LD E,L
EXX
LD C,A
LD B,#60
!ASSM 7
LD D,B
LD A,(DE)
RLA
RL (HL)
LD D,A
LD A,(BC)
INC B
RRCA
RRCA
RRCA
RRA
EXX
LD L,B
LD C,(HL)
RR C
EXX
OR D
LD D,L
INC L
LD (HL),A
EXX
LD A,C
RRCA
RRCA
LD L,E
LD C,(HL)
RL C
RLA
RL C
RLA
EXX
INC L
LD (HL),A
EXX
LD L,D
LD A,(HL)
INC H
RRCA
RRCA
RRCA
OR C
EXX
INC L
LD (HL),A
LD L,D
INC H
!CONT
LD D,B
LD A,(DE)
RLA
RL (HL)
LD D,A
LD A,(BC)
RRCA
RRCA
RRCA
RRA
EXX
LD L,B
LD C,(HL)
RR C
EXX
OR D
INC L
LD(HL),A
EXX
LD A,C
RRCA
RRCA
LD L,E
LD C,(HL)
RL C
R.L.A.
RL C
R.L.A.
EXX
INC L
LD(HL),A
EXX
LD L,D
LD A,(HL)
INC H
RRCA
RRCA
RRCA
OR C
EXX
INC L
LD(HL),A; 4&5&6&7&8
INC L
PXS1 LD H,0
EX DE,HL
EXX
POP HL
INC L
JP PXSB
DL> so, this is slow :(
DL> my procedure prints
DL> at 55 clock cycles/screen byte (though it doesn't print to
DL> screen, and into the buffer. The buffer is released to the screen at a speed of 11
DL> clock cycles/bytes. if I did it directly to the screen, it would be 57 clock cycles/byte.
DL> and if it is also optimized for the screen, maybe even faster. now
DL> it is optimized for a buffer). my procedure traditionally eats one
DL> jar for font :)
I can't allow this. If loading
The written text takes 255 seconds. (4 banks),
another bank for tables. DL> if you really need it, I can send it. understanding it is even more difficult :)
So why didn’t you send it? Send it to the echo.
Whoever needs it will figure it out. And I will
interesting.
DL> just one question - is that how you write it in the text?
DL> this is wrong. too much memory is wasted.
DL> it was necessary to write a procedure that would create this program
DL> in memory. and the size of this procedure would probably be 150 bytes.
When a program has a limited amount of memory,
rovan, this doesn't make sense.
Of course, assuming that the size of the current
hundred = 255 sectors.
My program has 4 fonts of 32,42,51,64 characters.
And together they take up half the bank.
There is an option: unpack every time
fonts, install new procedures
print.. I don’t know who this would suit
option...
Yes, it’s possible. This is how it is done in my bottle.
All the best, PHOENIX.
-+- ZXASM 3.0
From Yaroslav Kozlov → To Dmitry Lomov 24 May 1998
Hello, Dmitry!
YK>> if you want, I can do scrolling
YK>> (not POP HL:LD (XX),HL). I'm at my place
DL> LD DE,....:PUSH DE
So you can’t scroll 255 sectors...
There is a way, in my opinion 211 clock cycles/16 bytes.
It's a little slower POP HL: LD (xx),HL,
but it is more manageable in a cycle.
in reg. HL - read on stack, 'HL write
on the stack, and the rest of the registers are a buffer.
And it’s not hard to guess. It's in the game
Wec le mans...
YK>> In your source codes the devil himself will break his leg!
YK>> I was looking for this procedure, I wanted to compare it with
YK>> yours. And I didn’t find it. In EV 1.00 font by other
DL> printing is decompressed by the SETUP program, and launched via PRLINE.
I'll look again, although I looked through my eyes
nitor.
All the best, PHOENIX.
-+- ZXASM 3.0