Search found 229 matches
- Sat Apr 27, 2024 12:44 am
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Tue Apr 23, 2024 9:29 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Tue Apr 23, 2024 8:25 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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-...
- Tue Apr 23, 2024 5:51 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Mon Apr 22, 2024 11:50 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Mon Apr 22, 2024 9:09 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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, ...
- Mon Apr 22, 2024 9:05 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Mon Apr 22, 2024 2:30 am
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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 ...
- Sun Apr 21, 2024 6:15 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Sun Apr 21, 2024 4:37 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Sat Apr 20, 2024 9:51 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Fri Apr 19, 2024 2:24 am
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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
?
its like a
but you insist on a
tja
?
- Fri Apr 19, 2024 1:57 am
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Thu Apr 18, 2024 11:05 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Thu Apr 18, 2024 4:27 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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+...
- Thu Apr 18, 2024 3:36 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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&...
- Thu Apr 18, 2024 2:39 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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)...
- Thu Apr 18, 2024 1:48 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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 ...
- Thu Apr 18, 2024 12:10 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
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...
- Tue Apr 16, 2024 10:44 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
Re: starting with elias-gamma
so, you only have to set (hl),0 inc hl (hl),elias and virtualy you are done if you count that 2^b bit i did not test this one but i want to know if its use-able for an zx0 ON Z80 machine its stupid, i warn you and in the C the elias is "optimised " directly after use. its feels like b64, s...
- Sun Apr 14, 2024 11:32 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
Re: starting with elias-gamma
So, there is NO elias-gamma NULL , took me some time to realise that one ... :D :P :shock: :mrgreen: :roll: :evil: :?: :!: now its 98,7 % or some but it should write the encoding correct in mem, which is actualy just a shift with 8 bytes inside 16 bytes, so why dont i do that? since i wanted to see ...
- Tue Apr 09, 2024 1:52 am
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
Re: starting with elias-gamma
NO IT aint working, yet but its at least working a bit, i had one stupid error , forgot exx hl BUT my basic part has severall QUOTE signs and inside and Token will be written in txt, with bas2tap,zmakebas AND txt2emu, so i quited that for now but i have to make it visual in memory so i will try diff...
- Sun Apr 07, 2024 5:46 pm
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
Re: starting with elias-gamma
well i made a crash by overwriting BASIC, but how and why ??? ; use ; eliasg021 ; pasmo -d --tap --name eliasg021 eliasg021.asm eliasg021.tap eliasg021.symbol ; cat elias.tap eliasg021.tap > eliasgamma021.tap ; bas2tap -selias -a10 eliasMCloader.bas elias.tap ; 10 DEF FN b$(d)=VAL$ ((CHR$ 193+"...
- Sun Apr 07, 2024 3:42 am
- Forum: Programming
- Topic: starting with elias-gamma
- Replies: 30
- Views: 804
starting with elias-gamma
https://en.wikipedia.org/wiki/Elias_gamma_coding 10 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)): DEF FN b(a$)=VAL (CHR$ 196+a$) 20 FOR f=0 TO 255 25 LET a$=FN b$(f) 30 PRINT TAB 3-LEN STR$ f;f;" ";a$;TAB 1...
- Thu Apr 04, 2024 2:11 pm
- Forum: Programming
- Topic: Bank switching issue
- Replies: 32
- Views: 1127
Re: Bank switching issue
Hi wanted to mention "Logic RAM Banks" although you probably solved to problem there are TWO ways off counting the memory banks while they are the same chip https://github.com/ZXSpectrumVault/rom-disassemblies/blob/master/Spectrum%20128K/Spectrum128_ROM0.asm it mentions the difference in a...