Keep going! AWESOME compo and article!
Is your dzzstrlen something like this or is there a faster and smaller way? Given the case you have no dynamic text, counting the number of chars by hand will make dzzstrlen obsolete and will reduce executable size.
int i=0;
while(string[i] != '\n'))
{...
That is even worse, it should be a transparent as possible. Everything on the stack before my assumed base pointer won't be checked, that is too dangerous.
This is of course a solution but I try to avoid that, because that way I have to hope the GC's init function is called as the very first. This needs further testing, maybe I get a better solution. I also can't force the user not using any local variables in main(). The stack base pointer must be...
I declare in modules globals vars as static to control the scope. Does this has any negative penalties?
That's not true, the ARM doc above says that up to four function parameters go into registers, that's why they recommend using functions with up to four parameters.
you seem to like pain! :)
Hi!
I need a simple way to store the register content somewhere. Squidge gave me a single ARM ASM instruction but I have no fucking clue to use that. I think libc must provide something like that.
my question is: if I declare the jump buffer context inside foo it will be on the stack, wif I...
you guys leave me alone....
okay I found another way I haven't tested but seems to be WAAAAY simpler... This should also return the Stack Base Pointer. But I have a feeling this might not work on all versions of libc :(
extern void* __libc_stack_end;
main () { printf ("%p\n"...
What do you mean with 1KB granularity? does it means that malloc allocates at least 1KB? Or that between two subsequent virtual addr are alsways 1KB in physical mem?
I assumed that all pointers are 4byte (32bit) aligned. The following code mallocs severalnumbers of chars and the pointers it...
I don't need to know the physical location. So in other words, my approach seems to be correct then? I was just wondering if that addr was valid. Does that also meant that the minimum alignment of a pointer is 32bit?
I need the Stack Pointer and the Stack Base Pointer. To get the Stack Pointer I just dereferenciate the last local variable. This should work on all machines (as I want to run my code on GP2X and my PC as most GP2X devs do....) Is there a ARM specific (faster) way? R13 maybe?
To get the Stack...
The accuracy is way better when you use:
((x<<3) + (x<<1) + x) >> 4 == ((x*8) + (x*2) + x) / 16 == x / 1.454545455
This should be a good compromise between speed and accuracy as the max error is approx. (x * 0,04545)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.