Search found 235 matches

by C.Born
Sun Apr 28, 2024 12:18 am
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

about interlaced eliasgamma is the Zeta-Xi-Code what you refer to? https://github.com/einar-saukas/Zeta-Xi-Code Number N Number N+1 Bits Classic Elias Gamma Code Interlaced Elias Gamma Code 0 1 1 1 1 1-2 2-3 3 01x 0x1 3-6 4-7 5 001xx 0x0x1 7-14 8-15 7 0001xxx 0x0x0x1 15-30 16-31 9 00001xxxx 0x0x0x0x...
by C.Born
Sat Apr 27, 2024 10:47 pm
Forum: Programming
Topic: Simple path finding algorithm in assembler
Replies: 35
Views: 1147

Re: Simple path finding algorithm in assembler

is a game like "Roads of Rome" solvable with your algoritm?
those type off games are rather easy and after every clearing new paths are possible.
by C.Born
Sat Apr 27, 2024 10:35 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

i added 1 byte to wipe the old contence of (hl),much better! and changed the label from "notyet" ntyt to "next b" nexb, checkce rlc e rlc c jr nc,nexb ; c/nc from C ld (hl),a ; bits = %00000001 inc hl ; new destiny byte xor a ; ld (hl),a ; wipe old data first nexb djnz bitz
by C.Born
Sat Apr 27, 2024 8:11 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

down to 82 bytes for the single eliasgamma ; pasmo -d --bin EliasGamma.asm EliasGamma.bin EliasGamma.symbol ; HL= destiny, DE=source ; needs, Golomb, Bits elias: ld a,(golomb) ld c,a ; c=0 or 1 ld a,(de) ; elias source add a,c jr z,done ; on elias = 0 or golomb=255 (elias254+1) ld b,8 ld c,1 ; gamma...
by C.Born
Sat Apr 27, 2024 4:34 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

the pupuse is an pure Z80 eliasgamma and i have to WRITE the final result, aswell , .... one ld (hl),a to few, now repaired and working, pheew ! :roll: ; an elias-gamma format Z80 routine ; DE holds SOURCE, hl holds DESTINY ; LATER to be INCLUDEd as ASM or BIN ; Eliasgammaloop-0076 ; pasmo -d --tapb...
by C.Born
Sat Apr 27, 2024 3:32 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

in C you dont have to concider that DEC B does NOT influence the carry
by C.Born
Sat Apr 27, 2024 12:44 am
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

I wrote this code in C some time ago: void write_classic_elias_gamma(int value) { int i = 1; while ((i <<= 1) <= value) write_bit(0); while (i >>= 1) write_bit(value & i); } Same algorithm, more user friendly listing: void write_classic_elias_gamma(int value) { int i = 2; while (i <= value) { w...
by C.Born
Tue Apr 23, 2024 9:29 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

and back to the board since now i do miss some, but what? source2 defb 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ; eliasgamma string with 1 to 15 should be 84 bits from which 32 set ; 1 010 011 00100 00101 00110 00111 0001000 0001001 0001010 0001011 0001100 0001101 0001110 0001111 this string is NOT happe...
by C.Born
Tue Apr 23, 2024 8:25 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

and 1 bit better, again it stil laks some thing ; an elias-gamma format Z80 routine ; DE holds SOURCE, hl holds DESTINY ; LATER to be INCLUDEd as ASM ; #INCLUDE Elias-0062.asm ; pasmo -d --bin Elias-0062.asm Elias-0062.bin Elias-0062.symbol ; pasmo -d --tapbas --name Elias-0062 Elias-0062.asm Elias-...
by C.Born
Tue Apr 23, 2024 5:51 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

it seems to work and trying on the first 2K of the ROM gives a bit shorter result then 2k, BUT elias-gamma=0 and/or Golomb=255 are avoided, so, those are omitted and Not part of the result. is it now "ready" for a zx0 step?? with settings its 148 bytes, and as bin probably around 125 bytes...
by C.Born
Mon Apr 22, 2024 11:50 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

back to that single main question about direction inside memory so i write a single elias value in memory on a fresh cleared location, its the value 1 that delivers a single bit without leading 0 is this single bit stored on bit 0 %00000001 or bit 7 %10000000 its very much "navel staren" b...
by C.Born
Mon Apr 22, 2024 9:09 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

So, I use the C register holding the current target bit, so 1, 2, 4, 8, 16, 32, 64, 128. With A holding the current byte that’s going to get added to. Then the sequence goes like this; Jr nc, jump over if the bit is a 0 Bit= 1: Or c Bit=0: Xor c This way, regardless of when the target bit in A is, ...
by C.Born
Mon Apr 22, 2024 9:05 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

You can't LD IXL, L since the option for index registers overrides use of HL in the instruction. i found that, its excluding H and L becouse those codes are used already 0x6b is ld l,e which uses l already 0xDD6b does the same apperently, but different http://z80.info/z80sean.txt DD60 LD IXH,B* DD6...
by C.Born
Mon Apr 22, 2024 2:30 am
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

Hi in 3d chess you use IXl and IXh I was wondering if i should use IX as destiny instead off de, for long shifts thats 2 extra registers. i looked a bit in your source for bits and found test_7: ld e,l ;adjust IX to match HL ld ixl,e ; COULD tha be written as test_7: ld ixl,l ;adjust IX to match HL ...
by C.Born
Sun Apr 21, 2024 6:15 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

You could change the bit according to a register holding the current bit. A method I used in Chess 2k19. The source is in the archive. If I recall, it sets the bit, then resets it if required by xor-ing the register again. Obviously only possible using A thank you, i have a look into the wonders of...
by C.Born
Sun Apr 21, 2024 4:37 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

hmm al least this one does not crash, but neither has a result. i should look at the shiftt of a double register instead, but that has its own troubles ; shift 8bit as 1-15bit within 24bit max ; elias ; a ; 63 =6bits = 111111 > 00000111111 = 11bits in DE ; last positin x= b ; xxxxxx00 00000000 00000...
by C.Born
Sat Apr 20, 2024 9:51 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

10 BORDER 4: CLS : POKE 16384,1 views as 00000001 this sets a bit the visual problem, in my mind i have to turn that picture in to a POKE 16384,128, but only visualy. its logical to start with bit 0 as first bit, now i need a smart way to pin every bit on the correct number, on n=1 then the next fre...
by C.Born
Fri Apr 19, 2024 2:24 am
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

sorry, realy love you people, but some times i dont get it

its like a

but you insist on a


tja
?
by C.Born
Fri Apr 19, 2024 1:57 am
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

you miss the point of "origin" by passing by on zx via that pc the origin of '0' there was a roman salesman having all products all the time depending on the ship loads arriving plenty off oil, seeds and wood and stone, but often lacking fruits one day that arab guy came allong again and s...
by C.Born
Thu Apr 18, 2024 11:05 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

even so, it will probably take a VERY long time to run. I don't think that's a good idea... waiting 5-6 times for a tapeloading error on a full 48k program like WSHAS thats 30-45 minutes life time, waiting for a 5 ball tictac movie takes 24h rendering, for about 2 seconds zx cpu time. ONCE zx0 is m...
by C.Born
Thu Apr 18, 2024 4:27 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

ok just for fun, some visuals 3 DEF FN b$(d)=VAL$ ((CHR$ 193+"d" AND d<=1)+(("FN b$(INT (d/2))+"+CHR$ 193+STR$ ((d/2)<>INT (d/2))) AND d>1)) 5 DEF FN e$(a)="000000000000000"( TO LEN FN b$(a)-1)+FN b$(a) 7 DEF FN b(a$)=VAL (CHR$ 196+a$) 10 DEF FN a(a)=PEEK a+256*PEEK (a+...
by C.Born
Thu Apr 18, 2024 3:36 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

unwrapping while saving the elias-gamma-bitstring in basic only, but now i know what i should want it looks as clumbsy as it is ... 3 DEF FN b$(d)=VAL$ ((CHR$ 193+"d" AND d<=1)+(("FN b$(INT (d/2))+"+CHR$ 193+STR$ ((d/2)<>INT (d/2))) AND d>1)) 5 DEF FN e$(a)="000000000000000&...
by C.Born
Thu Apr 18, 2024 2:39 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

including "unwrapping" give some 16bit values and CLOSE with 0 or bigger then 65535 then it SHOULD give back the correct nummbers just a test like others :roll: 3 DEF FN b$(d)=VAL$ ((CHR$ 193+"d" AND d<=1)+(("FN b$(INT (d/2))+"+CHR$ 193+STR$ ((d/2)<>INT (d/2))) AND d>1)...
by C.Born
Thu Apr 18, 2024 1:48 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

a 16bit basic example 3 DEF FN b$(d)=VAL$ ((CHR$ 193+"d" AND d<=1)+(("FN b$(INT (d/2))+"+CHR$ 193+STR$ ((d/2)<>INT (d/2))) AND d>1)) 5 DEF FN e$(a)="000000000000000"( TO LEN FN b$(a)-1)+FN b$(a) 7 DEF FN b(a$)=VAL (CHR$ 196+a$) 10 DEF FN a(a)=PEEK a+256*PEEK (a+1): DEF ...
by C.Born
Thu Apr 18, 2024 12:10 pm
Forum: Programming
Topic: starting with elias-gamma
Replies: 36
Views: 898

Re: starting with elias-gamma

thinking out loud: elias-gamma (or elias-gamma-string) is a bitstring of ANY length and ANY amount off numbers since its unkown what length next number will have its max number is SET by a series of zero's that realy have to be counted that is the gamma point '1' from and including there you take TH...