Search:

Type: Posts; User: limp

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,108

    Fast generation of a binary tree

    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...
  2. Referencing outside the bounds of an array does not generate an error

    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...
  3. Replies
    3
    Views
    1,028

    Hi and thanks for you reply It's not...

    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...
  4. Replies
    3
    Views
    1,028

    Question about array pointer

    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:
  5. Replies
    26
    Views
    23,448

    Hi guys, I tried pretty much what _Mike...

    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);
  6. Replies
    26
    Views
    23,448

    Hi, So you mean having something like...

    Hi,



    So you mean having something like that?



    test.c
  7. Replies
    26
    Views
    23,448

    Hi, The fact that it is external doesn't...

    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...
  8. Replies
    26
    Views
    23,448

    Thanks for the advice. I did that and I got: ...

    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
  9. Replies
    26
    Views
    23,448

    Hi guys, Compiling the following C snippet...

    Hi guys,

    Compiling the following C snippet with gcc -S....


    unsigned char test_variable=0;

    int main()
    {
    test_variable=0xFF;
  10. Replies
    26
    Views
    23,448

    Hi, You're right on that, I was just...

    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;
  11. Replies
    26
    Views
    23,448

    Accessing C global variable from assembly file

    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...
  12. Numerical digits as part of C function names and preprocessor macros

    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....
  13. Replies
    3
    Views
    2,207

    Why sizeof a macro has always an extra byte?

    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 "...
  14. Replies
    7
    Views
    1,097

    Thank you all for your replies (specially cas for...

    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.
  15. Replies
    7
    Views
    1,097

    Thanks for your reply. I don't want to...

    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.
  16. Replies
    7
    Views
    1,097

    Store pointee to an int variable

    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 =...
  17. What a silly mistake! That (of course) solved the...

    What a silly mistake! That (of course) solved the problem.

    Thanks for that mate!
  18. Pointer points to different address after array initialisation

    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...
  19. Replies
    2
    Views
    1,485

    Subtracting a macro from a pointer

    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...
  20. Replies
    2
    Views
    4,854

    Error: structure XX has no member named YY

    Hi all,

    I have the following scenario:



    typedef struct {
    u8 member_a;
    u32 member_d;
    u32 member_c;
  21. How to not lose precision when dividing and assigning to integer?

    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
  22. Thanks for the help!

    Thanks for the help!
  23. Problem when trying to return union type variable from function

    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;
    ...
  24. Thread: weird typeded

    by limp
    Replies
    12
    Views
    1,151

    You're right guys, I was in a bit of rush! ...

    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...
  25. Thread: weird typeded

    by limp
    Replies
    12
    Views
    1,151

    weird typedef

    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)...
Results 1 to 25 of 26
Page 1 of 2 1 2