Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > exomizer: assembler fragments with loops
2024-12-28 02:44
GI-Joe

Registered: Sep 2015
Posts: 21
exomizer: assembler fragments with loops

Howdee!

Is it possible to use
exomizer sfx 0x0a00 -s '....'
with assembler fragments that have a small loop ?
If so, what is the syntax for i.e. 'bpl *-4' here?
I always got syntax errors in all kinds of attempts :(

It would also be good to know in general with which syntax these fragments run ? Syntax from a c64(vice?)-monitor or from acme or from which assembler ?
Or would it be possible to inject these code fragments as bytecode?
That would already be a solution that could be worked with.

thanxx
 
... 5 posts hidden. Click here to view all posts....
 
2024-12-28 15:48
GI-Joe

Registered: Sep 2015
Posts: 21
Quote: I think, GI-Joe asks how to put branch with relative addressing (which is part of a loop) into custom assembler fragment executed at start of crunching.

that's what i mean :)
2024-12-28 16:13
GI-Joe

Registered: Sep 2015
Posts: 21
Quote: Oh, I'm sorry!

I've tested with -x flag which gives value -292. But before branch instruction exists "lda #$f sta $d020 sta $d021".

-x option with branch at start gives -284 value,
-s option gives -2063 value with branch at start,
-f gives -439.

So it must be chosen on the basis of tests.


@Digger, according to the manual custom fragment is executed "when decruncher starts", so shouldn't slow it down.


Gordian, you didn't get any "syntax errors" and crashes while chrunching ?
I use Exomizer v3.1.2 on Arch Linux here.

It's weird and probably these are random values that change with every new version of exomizer.
This is not "good news" for my buildchain.
Who knows where such values come from, but may be some things were not defined and/or documented in the exomizer-code/docs for the assembly fragments section.

Gordian, thanks for the tips. I'll test it l8ter.
2024-12-28 16:27
Gordian

Registered: May 2022
Posts: 87
Quoting GI-Joe
Gordian, you didn't get any "syntax errors" and crashes while chrunching ?
I use Exomizer v3.1.2 on Arch Linux here.

I made tests using some old version.
Now I use version 3.1.2 on Windows, but I get the same "magic" values.

For example:
exomizer sfx basic -t64 -s "bne 0" -o z.prg zoom.prg

Gives result:
value -2063 out of range for op $D0 @0581c080
2024-12-28 18:05
GI-Joe

Registered: Sep 2015
Posts: 21
Quoting Gordian
Quoting GI-Joe
Gordian, you didn't get any "syntax errors" and crashes while chrunching ?

For example:
exomizer sfx basic -t64 -s "bne 0" -o z.prg zoom.prg

Gives result:
value -2063 out of range for op $D0 @0581c080

ok and then exomizer exits with an error, right ?

i've testet:
exomizer sfx 0x2800 -s 'inx bne 2000' -o chrunched_file.prg main_binary_2800.prg

...produced in the crunched file @ $080d:
.C:080d E8 INX
.C:080e D0 C0 BNE $07D0

So i think i have to give on branching the absolute address like in any monitor program.
ok, i have to try & error my branches in that cases but this is a workaround with a stable condition and better then nothing :)

thanxx
2024-12-28 18:20
Gordian

Registered: May 2022
Posts: 87
Quoting GI-Joe

ok and then exomizer exits with an error, right ?

Yes. Only the error message "value out of range"

Quoting GI-Joe

i've testet:
exomizer sfx 0x2800 -s 'inx bne 2000' -o chrunched_file.prg main_binary_2800.prg

will produce in the crunched file @ $080d:
.C:080d E8 INX
.C:080e D0 C0 BNE $07D0


You get proper code.
Because of INX your "magic" value starts at -2064 (-2063-1).
-(-2064)-64=2000
-64 is the $C0 (signed 8-bit value).
2024-12-28 23:54
GI-Joe

Registered: Sep 2015
Posts: 21
Quoting Gordian

You get proper code.
Because of INX your "magic" value starts at -2064 (-2063-1).
-(-2064)-64=2000
-64 is the $C0 (signed 8-bit value).


yes, or in easy:
Quoting GI-Joe

.C:080e D0 C0 BNE $07D0

$07D0 = 2000 decimal :)

however, in this simple test-example this line works fine:
exomizer sfx 0x2800 -s 'inx bne 2061' -o chrunched_file.prg main_binary_2800.prg
2024-12-29 11:03
Gordian

Registered: May 2022
Posts: 87
Quoting GI-Joe

however, in this simple test-example this line works fine:
exomizer sfx 0x2800 -s 'inx bne 2061' -o chrunched_file.prg main_binary_2800.prg

Why not? You got offset -3 (2061-2064).
2024-12-29 22:35
Zagon

Registered: Apr 2002
Posts: 16
You don't have to calculate the branch target address manually. You can use labels in the assembler fragment like this:
-s 'loop123: inx bne loop123'
2024-12-30 03:01
GI-Joe

Registered: Sep 2015
Posts: 21
Quote: You don't have to calculate the branch target address manually. You can use labels in the assembler fragment like this:
-s 'loop123: inx bne loop123'


ahh, ok, that's what i'm searching for ..
thanxx a lot & cheers :)
2024-12-30 08:01
Gordian

Registered: May 2022
Posts: 87
Quoting Zagon

-s 'loop123: inx bne loop123'

That is cool:)
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Matt/The Coop
Mr. Mouse/XeNTaX/G*P
swasti
curtcool
CA$H/TRiAD
kbs/Pht/Lxt
Bieno/Commodore Plus
Sillicon/Unreal
The Syndrom/TIA/Pret..
Knut Clausen/SHAPE/F..
Guests online: 113
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.6)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Sprite Bukkake 2  (9.6)
9 Uncensored  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Layers  (9.7)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 Morph  (9.5)
7 Dawnfall V1.1  (9.5)
8 Libertongo  (9.5)
9 Katzen-Video.mp4  (9.5)
10 Onscreen 5k  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Fairlight  (9.3)
5 Triad  (9.3)
Top Diskmag Editors
1 Magic  (10)
2 Jazzcat  (9.5)
3 hedning  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.046 sec.