| |
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.... |
| |
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 :) |
| |
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. |
| |
Gordian
Registered: May 2022 Posts: 87 |
Quoting GI-JoeGordian, 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 |
| |
GI-Joe
Registered: Sep 2015 Posts: 21 |
Quoting Gordian Quoting GI-JoeGordian, 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 |
| |
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). |
| |
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 |
| |
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). |
| |
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' |
| |
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 :) |
| |
Gordian
Registered: May 2022 Posts: 87 |
Quoting Zagon
-s 'loop123: inx bne loop123'
That is cool:) |
Previous - 1 | 2 - Next |