[Vb81] Test release.
Re: [Vb81] Test release.
New test release 29-05-22 : ( from Greg's specs, assembler window resizable...)
Fast install, only the binary (VB81 had to be installed first with DLLs)
[Main project updated]
Have fun.
Fast install, only the binary (VB81 had to be installed first with DLLs)
[Main project updated]
Have fun.
Last edited by XavSnap on Sat Jun 04, 2022 5:47 am, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
New test release 1-06-22 : ( from Greg's specs #2, assembler window resizable...Again! ... the" ASM2" one.)
Fast install, only the binary (VB81 had to be installed first with DLLs)
Fast install, only the binary (VB81 had to be installed first with DLLs)
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
New test release 04-06-22 :
Detailed bug report from Greg's specifications.
Many suggestions ...
Cleaned the menus, add a full screen, add tips on undocumented icons...
Many thanks Greg.
Fast install, only the binary (VB81 had to be installed first with DLLs):
[Enclosed "VBTASM" window, my CRC database, a new ASM2 splash screen...)
Have fun...
Detailed bug report from Greg's specifications.
Many suggestions ...
Cleaned the menus, add a full screen, add tips on undocumented icons...
Many thanks Greg.
Fast install, only the binary (VB81 had to be installed first with DLLs):
[Enclosed "VBTASM" window, my CRC database, a new ASM2 splash screen...)
Have fun...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
New test release 03-07-22 :
Minor update, some tips and labels clean up.
The ROM $0000-2000 and $2000-4000 can be set to "Read Only" or "Read & Write". Previous option locked the $0000-$4000 block.
Thanks again Greg for useful reports.
Fast install, only the binary (VB81 had to be installed first with DLLs): Have fun.
Minor update, some tips and labels clean up.
The ROM $0000-2000 and $2000-4000 can be set to "Read Only" or "Read & Write". Previous option locked the $0000-$4000 block.
Thanks again Greg for useful reports.
Fast install, only the binary (VB81 had to be installed first with DLLs): Have fun.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
New test release 09-07-22 :
Minor update, some tips and labels clean up, again (Basic tool & Memory Tool winows).
MC relative jump "JR -5" changed to suite to old disassembled listings
PC was token from the second Opcode, it's now set to the PC+2 ( 18;05 = JR +5 -> PC +1+5 )
Thanks again Greg for useful report #7.
Fast install, only the binary exe file.(VB81 had to be installed first with DLLs): [EDIT:]
In the tiny assembler, we had to press Return to set the USER address (HEXA [$xxxx] or DEC), if the [Assemble] button was clicked without validation, the value was ignored.
[assemble] press this key for you now !
Minor update, some tips and labels clean up, again (Basic tool & Memory Tool winows).
MC relative jump "JR -5" changed to suite to old disassembled listings
PC was token from the second Opcode, it's now set to the PC+2 ( 18;05 = JR +5 -> PC +1+5 )
Thanks again Greg for useful report #7.
Fast install, only the binary exe file.(VB81 had to be installed first with DLLs): [EDIT:]
In the tiny assembler, we had to press Return to set the USER address (HEXA [$xxxx] or DEC), if the [Assemble] button was clicked without validation, the value was ignored.
[assemble] press this key for you now !
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
New test release 25-07-22 :
update, some tips and labels clean up.
Thanks again Greg for useful reports.
"External Processors" window tool added:
Send a binary memory in the "\External" directory named "in.bin" and retrieve the "out.bin" file.
Setup the "external.ini" and create a BATCH file.
In case of external assembler:
You will retrieve the REM in text format. Reload it in the VB81 file explorer windows...
Copy the executable file and the "External" folder.
PS: TASM can't be run on W10/11. (W16 format)
Have fun.
Fast install, only the binary (VB81 had to be installed first with DLLs):

Thanks again Greg for useful reports.
"External Processors" window tool added:
Send a binary memory in the "\External" directory named "in.bin" and retrieve the "out.bin" file.
Setup the "external.ini" and create a BATCH file.
In case of external assembler:
Code: Select all
:: DOS BATCH file
ASM.exe mycode.asm out.bin>text.log 2>&1
Copy the executable file and the "External" folder.
PS: TASM can't be run on W10/11. (W16 format)
Have fun.
Fast install, only the binary (VB81 had to be installed first with DLLs):
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
Hi,
The "Zx7" decompressor for ZX81:
The demo:
Have Fun.
The "Zx7" decompressor for ZX81:
Code: Select all
EXTERR .equ $005B ; Basic Break function ! Ignore line instructions.
CURSEUR .equ $8F5 ; Point to PRINT AT DEST.(BC=X,Y)
CHAINE .equ $B6B ; PRINT A CHAINE (BC=LEN;DE=TEXT LOC)
D_FILE .equ $400C ; D_FILE.
CLASS_6 .equ $0D92
STK_TO_BC .equ $0BF5
LINE_ADDR .equ $09D8
ERROR_3 .equ $005B
RAM_SPARE2 .equ $407B
SEED .equ $4032
.Org $4082
LD HL,(D_FILE)
INC HL
LD (RAM_SPARE2),HL
jr START
LD HL,(SEED)
INC HL
LD (RAM_SPARE2),HL
START:
RST 20H
CALL CLASS_6 ; [CLASSE-6]
CALL STK_TO_BC ; [STK-TO-BC]
LD L,B
LD H,C
CALL LINE_ADDR ; [LINE-ADDR]
LD BC,$0005
ADD HL,BC
CALL dzx7_standard
JP nz,ERROR_3
; -----------------------------------------------------------------------------
; Parameters:
; HL: source address (compressed data)
; DE: destination address (decompressing)
; -----------------------------------------------------------------------------
dzx7_standard:
ld DE,(RAM_SPARE2)
ld a, $80
dzx7s_copy_byte_loop:
ldi ; copy literal byte
dzx7s_main_loop:
call dzx7s_next_bit
jr nc, dzx7s_copy_byte_loop ; next bit indicates either literal or sequence
; determine number of bits used for length (Elias gamma coding)
push de
ld bc, 0
ld d, b
dzx7s_len_size_loop:
inc d
call dzx7s_next_bit
jr nc, dzx7s_len_size_loop
; determine length
dzx7s_len_value_loop:
call nc, dzx7s_next_bit
rl c
rl b
jr c, dzx7s_exit ; check end marker
dec d
jr nz, dzx7s_len_value_loop
inc bc ; adjust length
; determine offset
ld e, (hl) ; load offset flag (1 bit) + offset value (7 bits)
inc hl
.db $cb, $33 ; opcode for undocumented instruction "SLL E" aka "SLS E"
jr nc, dzx7s_offset_end ; if offset flag is set, load 4 extra bits
ld d, $10 ; bit marker to load 4 bits
dzx7s_rld_next_bit:
call dzx7s_next_bit
rl d ; insert next bit into D
jr nc, dzx7s_rld_next_bit ; repeat 4 times, until bit marker is out
inc d ; add 128 to DE
srl d ; retrieve fourth bit from D
dzx7s_offset_end:
rr e ; insert fourth bit into E
; copy previous sequence
ex (sp), hl ; store source, restore destination
push hl ; store destination
sbc hl, de ; HL = destination - offset - 1
pop de ; DE = destination
ldir
dzx7s_exit:
pop hl ; restore source address (compressed data)
jr nc, dzx7s_main_loop
dzx7s_next_bit:
add a, a ; check next bit
ret nz ; no more bits left?
ld a, (hl) ; load another group of 8 bits
inc hl
rla
ret
.end
Code: Select all
0 REM [HEX:\
2A,0C,40,23,22,7B,40,18,07,2A,32,40,23,22,7B,40,\
E7,CD,92,0D,CD,F5,0B,68,61,CD,D8,09,01,05,00,09,\
CD,A8,40,C2,5B,00,ED,5B,7B,40,3E,80,ED,A0,CD,EB,\
40,30,F9,D5,01,00,00,50,14,CD,EB,40,30,FA,D4,EB,\
40,CB,11,CB,10,38,1F,15,20,F4,03,5E,23,CB,33,30,\
0C,16,10,CD,EB,40,CB,12,30,F9,14,CB,3A,CB,1B,E3,\
E5,ED,52,D1,ED,B0,E1,30,C5,87,C0,7E,23,17,C9 ]
1 REM [HEX:\
00,B3,00,10,11,03,9C,00,87,81,11,89,83,04,29,0E,\
76,E7,08,1E,00,89,80,89,89,8A,89,82,04,8E,20,4E,\
34,1F,80,35,8A,88,1F,88,4F,04,46,1A,41,83,D3,17,\
88,E9,00,23,04,64,20,29,48,17,1F,81,B5,17,8A,4A,\
00,07,80,B3,19,76,85,29,9D,70,85,6B,17,80,04,52,\
91,02,89,5E,43,20,9A,72,82,07,1B,C2,9F,32,20,D2,\
07,84,DC,41,29,F8,1F,20,03,03,84,2B,07,84,20,07,\
D6,0A,80,83,0A,80,33,78,05,40,BF,4A,9A,17,78,78,\
6C,34,09,09,81,B5,41,00,71,2D,20,15,1F,19,41,A4,\
78,4C,D0,57,5A,7C,AA,20,02,1A,86,9D,58,7C,F3,00,\
80,05,20,92,21,E2,30,39,15,40,FE,00,38,41,5A,71,\
15,9F,42,2A,8B,41,89,20,B8,72,EA,00,12,5A,01,20,\
87,9C,7F,03,40,26,00,07,B0,C5,EC,1F,C5,15,02,21,\
08,F6,24,17,87,3D,17,B1,08,00,95,52,98,12,90,2C,\
1F,8A,01,BC,20,93,A5,20,63,00,FD,1D,20,8C,CC,85,\
CD,E3,12,98,23,20,85,DE,04,8A,5C,20,B4,15,41,98,\
C2,ED,F1,09,6B,91,8A,90,13,20,E3,35,C6,36,20,C3,\
1D,6A,94,00,90,90,C1,41,07,89,84,8A,6C,00,91,78,\
90,89,BA,42,EA,12,03,0B,53,8E,79,84,20,76,86,04,\
7B,1E,00,06,C3,27,B1,63,1A,F2,6A,02,20,60,9B,26,\
3F,3D,39,2A,26,32,32,85,80,B8,59,D4,93,1A,B1,91,\
98,4C,06,62,85,32,04,0B,A8,B8,14,00,04 ]
2 REM [HEX:\
00,94,00,10,11,98,08,00,87,09,81,89,83,04,F4,0C,\
00,76,F3,08,80,1E,89,80,89,89,8A,89,82,47,04,27,\
20,34,1F,1A,80,8A,88,1F,88,A7,04,46,8D,41,69,83,\
17,88,F4,00,23,04,B2,20,24,29,17,1F,5A,81,17,8A,\
A5,00,07,59,80,19,76,85,CE,29,70,85,B5,17,80,A9,\
04,91,02,89,2F,43,20,42,72,82,00,1B,40,9F,8C,20,\
B4,07,84,B6,41,29,1B,9B,1F,20,35,03,03,02,84,6E,\
20,04,07,09,C1,83,80,4B,33,05,BF,09,42,9A,EF,78,\
6C,34,16,09,09,81,41,00,EE,2D,20,7A,1F,19,A0,A4,\
BC,4C,D0,2B,5A,7C,D5,20,02,1A,43,9D,2C,7C,79,00,\
80,05,C9,20,21,71,30,24,42,89,03,EE,00,80,41,70,\
DE,45,8A,EA,42,64,09,00,A8,06,A4,20,89,4C,42,D6,\
0E,00,01,B5,20,87,38,7F,03,40,4D,00,07,61,C5,D8,\
1F,C5,2A,02,21,11,24,EC,17,87,7B,17,08,60,00,90,\
98,A4,12,90,59,1F,8A,01,78,20,88,4A,20,00,C6,FD,\
3B,20,CC,19,0B,CD,12,C2,AC,46,20,85,DE,08,8A,B9,\
20,69,15,41,98,8D,A6,E2,09,6B,91,8A,90,27,20,35,\
C6,C6,6C,20,C3,3B,6A,00,28,90,90,C1,82,07,89,84,\
8A,D9,00,91,78,90,89,74,42,EA,24,03,0B,A6,8E,84,\
F2,20,76,86,04,F6,1E,00,06,C3,4E,B1,63,34,F2,D4,\
02,20,9B,C0,26,3F,3D,39,2A,26,32,65,85,80,71,59,\
A8,93,B1,34,91,98,4C,06,C2,C3,04,65,0B,A8,70,14,\
00,08 ]
3 REM [HEX:\
00,90,00,10,11,4E,00,00,87,09,81,89,83,04,F4,0C,\
00,76,88,05,34,90,1E,89,80,89,89,08,8A,89,82,04,\
D8,20,91,1F,80,8A,88,AA,1F,88,04,79,46,92,20,17,\
B4,06,83,17,88,FA,00,23,04,59,20,56,29,1B,04,81,\
B5,17,8A,4A,00,07,80,B3,19,76,85,29,E5,70,1F,5A,\
85,17,80,D4,04,91,02,89,97,43,20,A4,72,82,C1,9F,\
19,20,69,07,84,6E,41,29,7C,1F,20,03,84,14,07,07,\
84,20,03,3B,80,84,02,83,05,80,2A,33,05,1F,EF,3A,\
20,2C,5E,03,6C,34,02,2D,01,81,41,00,DC,2D,20,F5,\
1F,19,41,A4,78,4C,D0,57,5A,7C,AA,20,02,1A,86,9D,\
58,7C,F3,00,80,05,20,92,21,E2,30,70,42,87,9D,00,\
80,CE,41,DE,08,8A,B2,42,05,2D,4E,00,6B,2A,20,E2,\
72,16,00,82,87,16,00,01,BA,20,DF,0E,53,41,BC,89,\
64,99,0E,07,61,C5,D8,1F,C5,2A,02,12,32,24,5B,6A,\
20,CA,BF,FC,08,00,90,14,98,12,90,8B,1F,2F,8A,01,\
20,88,09,58,20,00,FD,C7,63,20,CC,21,CD,7C,12,71,\
87,20,85,8A,7B,17,20,2D,15,31,41,98,A6,BC,09,6B,\
91,8A,44,90,F8,20,35,C6,CD,20,87,C3,6A,65,00,90,\
90,10,C1,07,89,84,5B,8A,00,91,78,2E,90,89,42,84,\
EA,03,0B,94,CE,DE,84,20,76,86,5E,04,1E,00,06,C9,\
C3,B1,C6,63,A2,93,02,98,20,9B,26,3F,3D,39,0C,2A,\
26,32,85,80,AE,59,35,B4,06,B1,91,98,4C,06,4A,89,\
00,04,65,0B,A8,70,14,00,08 ]
100 FOR A=1 TO 3
110 PRINT USR 16514,A
112 LET T=SIN PI+SIN PI+SIN PI
114 NEXT A
116 FOR A=3 TO 1 STEP -1
118 PRINT USR 16514,A
120 LET T=SIN PI+SIN PI+SIN PI
125 NEXT A
130 GOTO 100
140 REM UNCOMPRESS A LINE TO MEMORY
150 REM RAND +TARGET MEMORY
160 RAND 24500
170 PRINT USR 16523,VAL "3"
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
Hi,
The "PuCrunch" decompressor for ZX81:
(someting's wrong on the ZX81 display)
[Edit] Find the bug, this code is desing to run with a unneeded header (BC+6 at start)
i had to remove this jump... it put compressed array without this header is the REM !
Have Fun.
The "PuCrunch" decompressor for ZX81:
(someting's wrong on the ZX81 display)
[Edit] Find the bug, this code is desing to run with a unneeded header (BC+6 at start)
i had to remove this jump... it put compressed array without this header is the REM !
Code: Select all
; Version CPC par T&J/GPA * 07/2007 !
; Petites optimisations diverses, sans toucher le corps de la routine.
; Voir la routine non modifiee pour essayer de comprendre son fonctionnement !
; Liste des modifications :
; - Remplacement de boucles de copies par des LDIR / LDI
; - Integration dans le code des variables MaxGamma et consors, gain en
; place et en temps machine !
; Utilisation du registre IX pour pointer sur TablePu (faible gain en place
; et en temps machine
; Remplacement de quelques JP par des JR
;* PUCRUNCH unpacker for GB
;* Modeled after Pasi Ojala's C64 code.
;*
;* Written in RGBDS
;*
;* V1.0 - Ported to GB by Jeff Frohwein, started 22-Jul-99
;* V1.1 - Various optimizations, 23-Jul-99
;* V1.2 - Even more optimizations, 23-Jul-99
;* V1.3 - Fixed a bug in the code. 256 byte copy didn't work. 24-Feb-00
;*
; Version CPC par T&J/GPA * 07/2007
; ZX81 version by XavSnap * 07/2022
EXTERR .equ $005B ; Basic Break function ! Ignore line instructions.
CURSEUR .equ $8F5 ; Point to PRINT AT DEST.(BC=X,Y)
CHAINE .equ $B6B ; PRINT A CHAINE (BC=LEN;DE=TEXT LOC)
D_FILE .equ $400C ; D_FILE.
CLASS_6 .equ $0D92
STK_TO_BC .equ $0BF5
LINE_ADDR .equ $09D8
ERROR_3 .equ $005B
RAM_SPARE2 .equ $407B
SEED .equ $4032
FAST .equ $0F23
SLOW .equ $0F2B
PRBUFF .equ $403D
.org $4082
LD HL,(D_FILE)
INC HL
LD (RAM_SPARE2),HL
jr START
LD HL,(SEED)
LD (RAM_SPARE2),HL
START:
CALL FAST
RST 20H
CALL CLASS_6 ; [CLASSE-6]
CALL STK_TO_BC ; [STK-TO-BC]
LD L,B
LD H,C
CALL LINE_ADDR ; [LINE-ADDR]
LD BC,$0005
ADD HL,BC
LD DE,(RAM_SPARE2)
CALL Unpack
CALL SLOW
; Exit to BASIC
JP EXTERR
; ****** Unpack pucrunch data ******
; Entry HL = Source packed data
; DE = Destination for unpacked data
Unpack:
LD (OutPtr+1),DE
; Read the file header & setup variables
LD BC,6 ; < to remove if you don't add the header in the REM
ADD HL,BC ;< '''''''''''
LD A,(HL)
INC HL
LD (escPu +1),A
INC HL
INC HL
LD A,(HL)
INC HL
LD (main +1),A ; EscBits
LD B,A
LD A,8
SUB B
LD (noesc +1),A ; Esc8Bits
LD A,(HL)
INC HL
LD (MaxGamma +1),A
DEC A
LD B,A
LD A,8
SUB B
LD (Max8Gamma +1),A
LD A,(HL)
INC HL
LD (Max1Gamma +1),A
ADD A,A
DEC A
LD (Max2Gamma +1),A
LD A,(HL)
INC HL
LD (ExtraBits +1),A
INC HL
INC HL
LD A,(HL)
INC HL
LD C,A
LD DE,tablePu-1
PUSH DE
POP IX
INC DE ; DE = TablePu, IX=TablePu-1 (useful for chrcode optimization)
; Copy the RLE table (maximum of 31 bytes) to RAM
LD B,&0
LDIR
LD D,&80
JR main
tablePu:
.FILL 31,$0
newesc:
LD B,A
LD A,(escPu +1)
LD (regy +1),A
LD A,(main +1)
LD E,A
LD A,B
INC E
CALL getchk
LD (escPu +1),A
LD A,(regy +1)
; Fall through and get the rest of the bits.
noesc:
LD E,$00
INC E
CALL getchk
; Write out the escaped/normal byte
OutPtr:
LD BC,$0000
LD (BC),A
INC BC
LD (OutPtr+1),BC
; Fall through and check the escape bits again
main:
LD A,$00 ; changed LD A,(EscBits)
LD E,A
XOR A ; A = 0
LD (regy +1),A
INC E
CALL getchk ; X=2 -> X=0
LD B,A
escPu:
LD A,$00
CP B
LD A,B
JR NZ,noesc ; Not the escape code -> get the rest of the byte
; Fall through to packed code
CALL getval ; X=0 -> X=0
LD (lzpos +1),A ; xstore - save the length for a later time
SRL A ; cmp #1 ; LEN == 2 ? (A is never 0)
JR NZ,lz77 ; LEN != 2 -> LZ77
CALL get1bit ; X=0 -> X=0
SRL A ; bit -> C, A = 0
JR NC,lz77_2 ; A=0 -> LZPOS+1 LZ77, len=2
; e..e01
CALL get1bit ; X=0 -> X=0
SRL A ; bit -> C, A = 0
JR NC,newesc ; e..e010 New Escape
; e..e011 Short/Long RLE
regy:
LD A,$00 ; Y is 1 bigger than MSB loops
INC A
LD (regy +1),a
CALL getval ; Y is 1, get len, X=0 -> X=0
LD (lzpos +1),A ; xstore - Save length LSB
Max1Gamma:
LD B,$00
CP B ; ** PARAMETER 63-64 -> C set, 64-64 -> C clear..
JR C,chrcode ; short RLE, get bytecode
; Otherwise it's long RLE
longrle:
LD B,A
Max8Gamma:
LD A,$00
LD E,A ; ** PARAMETER 111111xxxxxx
LD A,B
CALL getbits ; get 3/2/1 more bits to get a full byte, X=2 -> X=0
LD (lzpos +1),A ; xstore - Save length LSB
CALL getval ; length MSB, X=0 -> X=0
LD (regy +1),A ; Y is 1 bigger than MSB loops
chrcode:
CALL getval ; Byte Code, X=0 -> X=0
LD E,A
LD (cpc1+2),A
CP 32 ; 31-32 -> C set, 32-32 -> C clear..
cpc1:
LD A,(IX + $00)
JR C,less32 ; 1..31
; Not ranks 1..31, -> 111110xxxxx (32..64), get byte..
LD A,E ; get back the value (5 valid bits)
LD E,3
CALL getbits ; get 3 more bits to get a full byte, X=3 -> X=0
less32:
PUSH HL
PUSH AF
LD A,(lzpos +1)
LD E,A ; xstore - get length LSB
LD B,E
INC B ; adjust for cpx#$ff;bne -> bne
LD A,(regy +1)
LD C,A
LD HL,(OutPtr +1)
POP AF
dorle:
LD (HL),A
INC HL
DEC B
JR NZ,dorle ; xstore 0..255 -> 1..256
DEC C
JR NZ,dorle ; Y was 1 bigger than wanted originally
LD (OutPtr +1),HL
POP HL
JP main
lz77:
CALL getval ; X=0 -> X=0
LD B,A
Max2Gamma:
LD A,$00
CP B ; end of file ?
RET Z ; yes, exit
ExtraBits: LD A,$00 ; ** PARAMETER (more bits to get)
LD E,A
LD A,B
DEC A ; subtract 1 (1..126 -> 0..125)
INC E
CALL getchk ;f ; clears Carry, X=0 -> X=0
lz77_2: LD (lzpos +2),A ; offset MSB
LD E,8
CALL getbits ; clears Carry, X=8 -> X=0
; Note Already eored in the compressor..
LD B,A
LD A,(lzpos +1)
LD E,A ; xstore - LZLEN (read before it's overwritten)
LD A,(OutPtr +1)
ADD A,B ; -offset -1 + curpos (C is clear)
LD (lzpos +1),A
LD A,(lzpos +2)
LD B,A
LD A,(OutPtr+2)
CCF
SBC A,B
LD (lzpos +2),A ; copy X+1 number of chars from LZPOS to OUTPOS
INC E ; adjust for cpx#$ff;bne -> bne
; Write decompressed bytes out to RAM
LD B,E
PUSH DE
PUSH HL
lzpos: LD HL,$0000
LD DE,(OutPtr +1)
; Modification GPA pour utilisation de LDI
; du coup, on libere le registre A
LD A,B
OR A ; Is it zero?
JR Z,zero ; yes
INC A
SRL A
JR NC,olzloop
; optimisable en LDI INC BC
lzloop: LDI ; Note Must be copied forward
olzloop: LDI ; Note Must be copied forward
DEC A
JR NZ,lzloop ; X loops, (256,1..255)
LD (OutPtr+1),DE
POP HL
POP DE
JP main
zero: LD A,128
JR lzloop
; getval Gets a 'static huffman coded' value
; ** Scratches X, returns the value in A **
getval: LD A,1 ; X must be 0 when called!
LD E,A
loop0: SLA D
JR NZ,loop1
LD D,(HL)
INC HL
RL D ; Shift in C=1 (last bit marker)
; bitstr initial value = $80 == empty
loop1: JR NC,getchk ; got 0-bit
INC E
LD B,A ; save a
MaxGamma: LD A,$00
CP E
LD A,B ; restore a
JR NZ,loop0
JR getchk
; getbits Gets X bits from the stream
; ** Scratches X, returns the value in A **
get1bit: INC E
getbits: SLA D
JR NZ,loop3
LD D,(HL)
INC HL
RL D ; Shift in C=1 (last bit marker)
; bitstr initial value = $80 == empty
loop3: RLA
getchk: DEC E
JR NZ,getbits
OR A ; clear carry flag
RET
.end
Code: Select all
# VB81 XuR [PuCrunch.bas]
0 REM [HEX:\
2A,0C,40,23,22,7B,40,18,06,2A,32,40,22,7B,40,CD,\
23,0F,E7,CD,92,0D,CD,F5,0B,68,61,CD,D8,09,01,05,\
00,09,ED,5B,7B,40,CD,B1,40,CD,2B,0F,C3,5B,00,ED,\
53,38,41,01,06,00,09,7E,23,32,4D,41,23,23,7E,23,\
32,41,41,47,3E,08,90,32,32,41,7E,23,32,28,42,3D,\
47,3E,08,90,32,7D,41,7E,23,32,77,41,87,3D,32,C4,\
41,7E,23,32,C8,41,23,23,7E,23,4F,11,FB,40,D5,DD,\
E1,13,06,00,ED,B0,16,00,18,44,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,47,3A,4D,41,32,6B,41,\
3A,41,41,5F,78,1C,CD,39,42,32,4D,41,3A,6B,41,1E,\
00,1C,CD,39,42,01,00,00,02,03,ED,43,38,41,3E,00,\
5F,AF,32,6B,41,1C,CD,39,42,47,3E,00,B8,78,20,DF,\
CD,18,42,32,F5,41,CB,3F,20,63,CD,2F,42,CB,3F,30,\
6D,CD,2F,42,CB,3F,30,B1,3E,00,3C,32,6B,41,CD,18,\
42,32,F5,41,06,00,B8,38,11,47,3E,00,5F,78,CD,30,\
42,32,F5,41,CD,18,42,32,6B,41,CD,18,42,5F,32,97,\
41,FE,20,DD,7E,00,38,06,7B,1E,03,CD,30,42,E5,F5,\
3A,F5,41,5F,43,04,3A,6B,41,4F,2A,38,41,F1,77,23,\
05,20,FB,0D,20,F8,22,38,41,E1,C3,40,41,CD,18,42,\
47,3E,00,B8,C8,3E,00,5F,78,3D,1C,CD,39,42,32,F6,\
41,1E,08,CD,30,42,47,3A,F5,41,5F,3A,38,41,80,32,\
F5,41,3A,F6,41,47,3A,39,41,3F,98,32,F6,41,1C,43,\
D5,E5,21,00,00,ED,5B,38,41,78,B7,28,15,3C,CB,3F,\
30,02,ED,A0,ED,A0,3D,20,F9,ED,53,38,41,E1,D1,C3,\
40,41,3E,80,18,EC,3E,01,5F,CB,22,20,04,56,23,CB,\
12,30,14,1C,47,3E,00,BB,78,20,EE,18,0A,1C,CB,22,\
20,04,56,23,CB,12,17,1D,20,F4,B7,C9,F4,B7,C9 ]
1 REM [HEX:\
22,04,70,75,77,04,03,58,02,02,08,80,00,FF,FF,07,\
80,00,03,83,88,81,85,DA,6F,79,DA,6E,E0,03,7D,B2,\
ED,F0,6F,E7,0C,24,0E,D8,80,05,FC,ED,FC,E0,DD,03,\
81,02,7C,57,BB,93,E4,DF,87,80,82,CD,CC,E2,83,85,\
04,F8,38,20,41,E0,BE,4D,F8,5D,90,B0,70,30,B0,50,\
7F,04,E6,DB,06,80,00,F8,B7,C0,B2,0B,37,C1,80,33,\
7E,1B,DA,30,16,0A,12,03,EC,9D,00,87,00,85,00,02,\
86,F0,36,00,06,81,D9,F3,3E,01,02,80,C2,ED,80,30,\
18,78,3E,37,78,78,87,86,E1,37,E8,3A,05,E3,F8,0B,\
72,C3,80,E7,6F,16,60,BB,80,0F,93,7F,29,01,77,CA,\
65,8E,28,EE,01,7E,29,D0,0E,20,C0,7E,4D,EC,5F,DC,\
64,D8,27,B1,D6,7D,E3,74,17,C9,C1,93,3B,00,C1,E1,\
61,20,61,00,3C,37,F3,BF,84,E0,7F,83,7B,32,20,60,\
C1,E1,33,EB,0D,F0,97,AD,FE,C9,AD,D6,04,C1,F5,C3,\
9C,99,A1,B8,04,E1,B3,1E,01,7A,9D,CF,8D,E9,05,87,\
70,40,FB,88,4E,BF,20,B8,AF,D9,E0,F9,95,FE,97,FB,\
36,C4,3E,7D,02,80,F1,23,C1,EC,36,74,02,F9,6F,EF,\
60,6E,36,80,F8,F2,C9,BF,0C,DE,2C,F1,DF,C3,7E,13,\
7B,40,81,F1,F9,84,5B,6B,D9,B3,D9,F3,3B,E2,37,A6,\
75,C3,41,6F,60,7D,D0,07,86,F8,3E,FC,6F,29,80,4E,\
B7,C0,BF,4B,83,27,3A,DF,E1,A2,07,F3,38,3D,37,F8,\
5A,82,DF,46,D4,17,CA,A4,1F,A7,CF,29,C8,20,60,3F,\
4C,4D,AF,24,37,25,06,ED,DA,73,FF,F0 ]
2 REM [HEX:\
E8,03,70,75,78,04,03,58,02,02,08,80,00,FF,FF,0A,\
80,03,00,83,02,82,84,86,89,8A,80,05,81,80,00,83,\
84,8A,88,DF,46,F3,60,B3,9E,01,DA,00,07,64,14,0C,\
2C,07,D1,BE,0F,E5,BF,0B,98,9C,6F,80,6C,05,06,85,\
88,8A,EB,A0,06,13,8F,B0,3E,3B,C0,01,3A,DF,CE,0E,\
B7,C1,38,F0,80,CB,EE,B7,F3,A0,02,13,36,C0,00,B3,\
DC,08,17,AD,FD,D6,6F,C1,67,14,14,36,5F,6F,08,3E,\
BA,61,F8,6B,87,82,F4,DF,85,CD,F0,6E,30,73,3F,6E,\
5B,A0,3F,08,6D,99,3E,05,D7,B6,47,81,C0,F1,7C,07,\
9D,D0,B0,DE,97,DB,B8,81,F6,B5,85,CD,F8,7E,27,71,\
3B,8D,F8,4D,F2,78,6F,66,46,5D,42,83,C3,65,EB,B6,\
EA,13,22,72,D3,7E,04,17,85,BB,B6,F2,03,84,03,86,\
84,DE,78,EE,CE,2B,E0,80,BC,2A,B1,F0,17,66,D2,0F,\
7D,1B,9A,CA,0E,94,38,DD,CB,EC,B7,86,F6,BB,DF,10,\
1F,A2,C8,18,2E,6F,83,F9,61,03,E3,CC,18,17,B7,0E,\
D8,04,CD,D8,2E,B7,78,BE,F4,C0,E3,E6,20,17,79,72,\
21,60,58,24,2F,80,98,10,2B,B6,F4,EB,08,1F,3A,C1,\
F8,97,F0,D8,05,85,F0,72,CB,DF,6D,FC,4B,E2,6B,C4,\
B6,01,E3,D7,C4,E3,DD,02,7A,6F,83,F1,BD,C9,C1,05,\
0F,8D,F8,EB,0B,0C,09,07,8D,C0,3E,A7,A7,96,F8,2E,\
F4,E3,26,1C,17,6E,1C,73,C3,00,FA,73,BB,7C,0F,B9,\
87,05,D9,57,C4,D0,08,28,30,28,08,07,92,26,2D,E2,\
BE,DB,E3,5B,28,FD,49,48,3E,88,B6,CF,A3,E6,68,BB,\
78,9E,1B,48,2F,53,64,1F,72,78,BD,7C,34,75,ED,E5,\
BF,D6,64,10,1E,F0,01,F2,F1,04,81,F2,D8,F8,B7,F9,\
4F,60,E1,3D,DF,70,08,10,7E,B5,FE,AD,F0,2F,01,6C,\
DC,86,F1,73,81,37,C2,F3,FF,F0 ]
3 REM [HEX:\
07,04,70,75,79,04,03,58,02,02,08,80,00,FF,FF,09,\
80,88,89,8A,03,09,00,81,84,DA,41,6F,7B,DA,C1,C1,\
6E,A0,E2,7D,BB,A1,E0,20,9D,B7,24,27,96,EE,70,EF,\
82,08,13,C3,87,6B,B4,76,DE,20,3F,1E,3C,70,83,ED,\
C4,1F,7A,75,98,0E,0D,B4,F2,DF,80,01,EB,82,26,5F,\
72,67,E4,4F,C1,BD,09,13,F0,6F,F5,83,D7,94,BE,EC,\
F6,BC,83,02,8A,F6,DF,82,07,CE,A0,7F,0B,FE,B7,37,\
C1,13,BB,1D,B8,DA,85,82,05,88,DB,80,3E,F1,9C,3D,\
81,DE,C0,F0,3E,1B,F0,A0,BB,B0,0B,3C,40,7C,0D,40,\
E1,01,A1,37,B6,E4,CC,97,60,2D,C7,44,10,31,5D,12,\
C3,ED,80,88,5D,ED,C5,1C,00,2B,B0,07,85,3F,47,10,\
99,FB,03,D7,CF,C1,BE,00,05,B6,40,1D,BA,C9,C8,9E,\
1F,E0,33,7E,1F,AF,90,3F,AC,D1,E3,7F,38,62,3C,4E,\
88,5C,CE,05,EB,44,07,E0,7C,C8,4F,0D,F8,5E,CD,68,\
6D,B0,02,0D,86,00,9B,68,18,23,E2,5B,85,E3,7C,13,\
AD,F8,1E,8F,F3,E0,13,C2,2B,E4,DF,CA,E8,77,68,1C,\
96,84,CB,EF,21,DF,30,F7,E2,DF,CE,98,18,87,68,9C,\
C1,02,CF,6E,9C,42,73,FB,EC,DF,82,F1,0C,B7,31,9B,\
FD,6F,62,0E,D7,A5,3F,92,77,CC,74,EC,9C,01,84,EA,\
F3,8F,8F,9B,7F,8E,78,9F,11,4E,0F,A5,EC,2D,83,F4,\
7D,F8,37,C1,61,E0,7C,C3,28,9E,49,AF,11,76,0B,77,\
50,3F,19,AF,F0,BE,11,38,63,E5,59,C6,0C,2E,F9,37,\
67,AB,9F,E1,BE,0E,0B,D4,FF,E3,6F,83,C3,EC,03,84,\
C8,C8,5E,15,82,01,F7,C0,0B,05,ED,BE,07,E2,F9,72,\
37,81,41,40,61,8F,D5,7D,CF,FF,C0 ]
100 FOR A=1 TO 3
110 PRINT USR 16514,A
112 LET T=SIN PI+SIN PI+SIN PI
114 NEXT A
130 GOTO 100
140 REM UNCOMPRESS A LINE TO MEMORY
150 REM RAND +TARGET MEMORY
160 RAND 24500
170 PRINT USR 16523,VAL "3"
9900 SAVE "PUCRUNCH"
9999 RUN
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
Main web site updated release 13-08-22.
http://zx81.vb81.free.fr
Thanks Greg for suggestions.
Files to copy and install in the "vb81_XuR\External" folder (Not enclosed in the main VB81 zipped file): Have fun.
http://zx81.vb81.free.fr
Thanks Greg for suggestions.
Files to copy and install in the "vb81_XuR\External" folder (Not enclosed in the main VB81 zipped file): Have fun.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: [Vb81] Test release.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)