PIX >addr speedUP

ZXNet echo conference «code.zx»

From Witch Doctor To All 8 May 2006

Hello, All There is a procedure PIX_ADDR DE,HL (call pix_addr) - YXpix DE > $address HL, A - bit offset LD A,E ;B DE YX AND A ;B HL $addr RRA SCF RRA AND A RRA XOR E AND #F8 XOR E LD H,A ;H LD A,D RLCA RLCA RLCA XOR E AND #C7 XOR E RLCA RLCA LD L,A LD A,D AND 7 RET In short, everything is as usual. But now there are offers for acceleration and/or use of only 1 reg. those. in in this example - YXpix DE > $address HL but it is necessary that - YXpix DE > $addr DE Only preferably with specifications. examples and measurements.

From Witch Doctor To All 8 May 2006

Hello, key-jee Yeah. It’s clear, but it’s not a matter of ex de,hl, but rather a matter of working only with 1 reg. i.e. on input to de -> manipulation with the same de and the result in the same de. Table... hmm... how then will it all look as a whole and how much will it give an increase?

From Ivan Petukhov To All 8 May 2006

Hello, Witch Doctor You can create a plate for 2 sectors, where the addresses of all extreme points are stored, and then use this simple procedure: ┌─- code ─── ld a,l and 7 ld(end-1),a ; save offset xor l rrca rrca rrca ld l,h ld h,table or(hl) inc h ld h,(hl) ld l,a ld a,0 ; restore offset end; └──; code ─── I haven’t checked in practice that I just came up with the idea and wrote it, but it seems like it should work. in fact, the procedure can be optimized for 4 clock cycles and 1 byte, if the input parameters will not be of the form H = y, L = x (as is usually customary in spec), but vice versa, that is, H = x and L = y. Well, if you need to work with de, then ex de,hl at the beginning and at the end of the procedure.

From Ivan Petukhov To All 8 May 2006

Hello, Witch Doctor > Yep. Clear, but it’s not a matter of ex de, hl, but rather a matter of working with only 1 reg > i.e. at the input to de -> manipulation with the same de and the result in the same > de. I don't understand what the problem is. :smile; EX; DE,HL can be put as the first command in the procedure, and then before RET on then the output will not spoil (although it is used).. The speed increase is approximately 20 cycles per call.. The table generator is primitive, you can even use your procedure :smile; Yes; and elfh has a good option, only hl spoils it and the plate takes up kilobytes memory (4 sectors) And if you don’t even need to draw a point (but only coordinates find out), then the routine is faster by another 14 cycles, but you will also need a generator cheat tables.. :wink; Actually; It's a really good procedure.

From Wladimir Bulchukey To All 9 May 2006

Hello, key-jee http://zx.pk.ru/showthread.php?t=2823 Similar topic.

From Witch Doctor To All 11 May 2006

Hello, Wlodek Ehhhh... Ie. since the good old days of "dots in 73 cycles" nothing changed/accelerated?

From Doctor Max To All 2 June 2006

Hello, Witch Doctor Well, why, in the same good old days, I used this procedure: ┌─- CODE ─── LD H,#80 ;7 LD A,(HL) ;7 INC H ;4 LD B,(HL) ;7 INC H ;4 LD L,C ;4 OR (HL) ;7 LD C,A ;4 INC H ;4 LD A,(BC) ;7 OR (HL) ;7 LD (BC),A ;7 └── CODE ─── Total 69 cycles. If the table address is kept in register E, then the first line is replaced with: LD H,E and we get an acceleration of 3 cycles

From TomCaT To All 2 June 2006

Hello, key-jee key> EX DE,HL can be put as the first command in the procedure, and then again key> before RET at the output then hl will not be damaged (although it is used).. key> Speed increase is approximately 20 cycles per call.. Not really, after LD H, A ; H Goes LD A, D What will it be like to work with one register, even with D, even with H, if one do not change the pair. Here is the table!