kewl, I'll try to test it as soon as I find the time to.
I'v been asking because of the intention to provide non stack, non dynamic, non static, memory allocation for scripts, thus providing the memory areas precompiled with my c++ code woulnd't have serverd me well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
how do I translate
string: DB "Hello world!"
numbers: DB 10, 20, 30
table: DB 100 DUP( 0 )
into intrinistic?
I imagine it should be something like
vector<int> numbers;
vector.push_back( 10 );
vector.push_back( 20 );
vector.push_back( 30 );
x86.db( "text", "Hello world!" );
x86.db( "numbers", numbers.begin(), numbers.end() );
x86.db( "table", 100, dup( 0 ) );
There are two methods, depending on your goals.
The easiest method is to define static data in C++, and reference that in the assembly code. This is illustrated in testIntrinsics() in Test.cpp.
The other method is like this:
x86.label("numbers");
x86.db(10);
x86.db(20);
x86.db(30);
Defining 'text' and 'table' doesn't work. Thanks for reporting this bug! I'll also add the 'label' method to the documentation.
Ok, table can now be defined like this:
x86.label("table");
x86.db(byte [100]); // Uninitialised
The changes are in the CVS.
kewl, I'll try to test it as soon as I find the time to.
I'v been asking because of the intention to provide non stack, non dynamic, non static, memory allocation for scripts, thus providing the memory areas precompiled with my c++ code woulnd't have serverd me well.
It gave me a headache, but I think it's finally working! A string can be defined like:
x86.label("string");
x86.db("Hello World!");
You can reference the string with "string".
Thanks a lot for pointing out these missing features!