Could you also make this for labels?
program RAW_IMAGE 'test';
#set bits 32;
inline function SomeInlineFunction1() {
SomeInlineFunction2();
next:
}
inline function SomeInlineFunction2() {
next:
}
SomeInlineFunction1();
next:
A community discussion post from the original code:zIRON forum.
Could you also make this for labels?
program RAW_IMAGE 'test';
#set bits 32;
inline function SomeInlineFunction1() {
SomeInlineFunction2();
next:
}
inline function SomeInlineFunction2() {
next:
}
SomeInlineFunction1();
next:
Macros must allow placing already used label since it is an inline piece of code.
If you want to create unique labels, you must use the macro function $uniquelabel. Please check ziron.zir under emacro try() { ...
It has a good example of unique labels.
If you want to create unique labels, you must use the macro function $uniquelabel.
I actually want specific label but not only unique.
For better explanation i mean macro-local labels like in NASM.
I think that it way will make code more easy to understand and readable. Instead of write like:
$exceptlbl = $_uniquelabel;
$_e($exceptlbl):
OK, I will add this to my todo list. Thanks.
Actually $_uniquelabel not so unique :)
Because it is possible to write:
program RAW_IMAGE 'test';
#set bits 32;
const REP_COUNT = 1024*16;
___7777___0:
$repeat REP_COUNT:
$a = $_uniquelabel;
$_e($a):
$end
And after that we get error:
Reserved label ___7777___0
In our documentation nothing about that. It would be better if there will written about format such labels to prevent use them.
I've fixed issue with unique label and I have made it possible to declare global variables locally.
I have also added localized macro labels:
$mylabel:
nop
goto $mylabel
I have also added localized macro labels
Cannot compile:
program RAW_IMAGE 'test';
#set bits 32;
inline procedure Test_labels() {
eax = $l1;
$l1:
}
$repeat 64:
Test_labels();
$end
Unexpected symbol $
I have added new function $labelref() for next release which allows macros to have forward declaration labels.
e.g.
inline procedure Test_labels() {
$l1 = $labelref();
eax = $l1;
$l1:
}