Hi all,
I am trying to generate a binary tree in C which considers all the possible combination for a number of array elements and a number of different options for each array element.
For...
Type: Posts; User: limp
Hi all,
I am trying to generate a binary tree in C which considers all the possible combination for a number of array elements and a number of different options for each array element.
For...
Hi all,
When I accidentaly tried to reference outside the bounds of an array in C, I surprisingly discovered that not only the compiler (GCC) didn't generate an error, but the reference indeed...
Hi and thanks for you reply
It's not really random, I know which memory region to use but in general you're right.
I don't really get where I am trying to do that...
Hi all,
I am a bit confused on how to use array pointers.
What I want to do is to fill a predefined region starting from a known memory location.
I thought of doing something like that:
Hi guys,
I tried pretty much what _Mike suggested but without calling the assembly function form the C code.
That is, I tried that:
main.c
void my_test_assembly_funct(void);
Hi,
So you mean having something like that?
test.c
Hi,
The fact that it is external doesn't mean that it is not declared. In fact, "extern" keyword is used only into previously declared variables. If you use "extern" in the definition that it...
Thanks for the advice. I did that and I got:
.file "test.c"
.def ___main; .scl 2; .type 32; .endef
.text
.globl _main
.def _main; .scl 2; .type 32; .endef
Hi guys,
Compiling the following C snippet with gcc -S....
unsigned char test_variable=0;
int main()
{
test_variable=0xFF;
Hi,
You're right on that, I was just testing one at a time and accidentally posted them both.
I tried to use only
uint8_t test_variable=0;
Hi all,
I am trying to access a C variable from an assembly file but I am getting an "undefined reference" error in the assembly file's line in which I am trying to access the variable. I am using...
Hi all,
Is there any problem of having numerical digits as part of C function names and preprocessor macros?
Could this practice lead me into incompatibilities among different compilers (i.e....
Hi all,
I noticed that Linux always subtracts 1 byte when using sizeof in macros, despite the length of the macro.
For instance:
#define ACPI_SIG_RSDP "RSD PTR "...
Thank you all for your replies (specially cas for the detail explanation given!). What tabstop suggested in the first place worked like a charm. Thanks again.
Thanks for your reply. I don't want to dereference Pointer_A, I just want to subtract an OFFSET from the address Pointer_A points to and store the result into a variable (Variable_A).
Thanks.
Hi all,
I am trying to assign a pointee into an integer and subtract a constant from that. Is this possible?
I have the following code:
#define OFFSET 0xC0000000
uint32_t *Pointer_A =...
What a silly mistake! That (of course) solved the problem.
Thanks for that mate!
Hi all,
I have a weird problem when dealing with pointers and arrays. In particular, I have the following code:
#define OFFSET 0xC0000000
#define VRT_ADD 0xC1628340
#define PHYS_ADD...
Hi all,
I am trying to subtract the value of a macro from a pointer but after this operation, I still get the same pointer address.
In particular, why the following code
struct...
Hi all,
I have the following scenario:
typedef struct {
u8 member_a;
u32 member_d;
u32 member_c;
Hi all,
I want to find a way of being able not to lose precision when I am doing a division and then putting the result to an integer. How can I do that?
Regards
Thanks for the help!
Hi all,
I have a problem when trying to return a union type variable from function. The union is defined in a header file called "Dummy.h" like that:
typedef union
{
uint32_t A;
...
You're right guys, I was in a bit of rush!
I am using GCC 4.2.4
That's why the DECLARE_ARGS(val, low, high) is called. It probably creates these variables and make them all equal to...
Hi all,
Can anyone please explain to me what the following macro definitions are doing?
#define DECLARE_ARGS(val, low, high) unsigned long long val
#define EAX_EDX_VAL(val, low, high) (val)...