Search:

Type: Posts; User: rempas

Page 1 of 3 1 2 3

Search: Search took 0.00 seconds; generated 6 minute(s) ago.

  1. That's nice! Tho I'm thinking that I'll probably...

    That's nice! Tho I'm thinking that I'll probably won't use it. It seems nice in theory but in action it doesn't worth it neither for learning nor
    implementing an actual assembler as there are a lot...
  2. Hahahaha! Yeah, I mean more practical way to...

    Hahahaha! Yeah, I mean more practical way to learn how the instructions translate to binary like a specification, official documentation or something.
    I mean, I just want to experiment and see. I...
  3. Hm, so the idea is that, I'll write a code...

    Hm, so the idea is that, I'll write a code snippet and see how it translates to binary for each instruction using these tools to read a binary file and see it in hex. That's cool. I would prefer...
  4. Hello! I'm sorry, I think it was more clear but...

    Hello! I'm sorry, I think it was more clear but it seems it wasn't.

    When saying create an elf executable (or library), I don't mean using a compiler. I mean actually creating them by myself by...
  5. Where can I learn how to create ELF executables?

    Is there a place where I can learn how to create an ELF executable (and the ELF format in general) in action? Please don't tell me things like "go read the source code of an assembler to see how they...
  6. Replies
    1
    Views
    141

    Can I use templates to add code in place?

    Is there a way to use templates to place code in place. What I want to do is mimic the behavior of "#define" but using C++ templates. So I want to do something like the following:



    #define...
  7. I don't know why but I run the code and I thought...

    I don't know why but I run the code and I thought It didn't gave me the right result for some reason but now that I run it, I get 1.

    And all that while I DO NOT do drugs. Imagine if I was doing....
  8. I did in my original code.

    I did in my original code.
  9. That's great however, just like I said, 0.n will...

    That's great however, just like I said, 0.n will not work. The value needs to be at least 1.0
  10. Yeah but why call another function and make it...

    Yeah but why call another function and make it run slower? Isn't my example working?
  11. If the value is negative or less that 1.0 (so for...

    If the value is negative or less that 1.0 (so for example: 0.388), it will not work. So you do something like that:



    bool negated = false; // To be used later to know if the value was...
  12. Thanks! It seems to work. I did something like...

    Thanks! It seems to work. I did something like the following:

    ```
    float val = 1384.838;
    int digits_before_dot = (unsigned int)log10(val);
    ```

    It will return 3 so I always have to add (1) to...
  13. How to find how many places from left the dot appears in a flot/double?

    Let's say that I have the following float/double: 137.837

    How can I find how many places from left the dot appears? So in this example I want to take either three or four (depending on how you...
  14. Thanks! They will come in handy! Tho I actually...

    Thanks! They will come in handy! Tho I actually implemented some more system calls in it seems that I was right and everything puts the returned value in "RAX" (in my system). So we are fine. Thanks...
  15. First of all, good job at using markdown style...

    First of all, good job at using markdown style syntax. It actually makes life much easier when trying to quote different parts of the post. Anyways, let's see

    > The same way you figure out which...
  16. Replies
    3
    Views
    397

    Hi! Ok so C is NOT an OOP language. C only...

    Hi! Ok so C is NOT an OOP language. C only supports the basic structure (called "struct"). This means only members for your struct and that's pretty much it. Below I will show you some examples and I...
  17. How would I know which registers are used for the returned value of a register?

    Again I want to use inline assembly with GCC. In my previous question I asked about clobbers, now I want to ask about the returned values from system calls.

    So let's consider the "write" system...
  18. Replies
    3
    Views
    288

    Yes, you should get an error if you use...

    Yes, you should get an error if you use "-fsanitize=address -O2 -Wall" with GCC. However, keep in mind that the compiler cannot check for values that contain non constant/literal values. This is why...
  19. Wow! If I was rating your reply, I would give you...

    Wow! If I was rating your reply, I would give you 10/10!!! Short explanations but fully detailed!

    So from what you are saying, I see this problem occurring only on loops (and of course in inline...
  20. [Inline assembly] What are exactly clobbers and why they are used?

    Hello and happy holidays to everyone! I'm new to GCC inline assembly (and have some vary basic knowledge in general) and I wanted to ask if someone can explain to me what exactly are "clobbers". I...
  21. Thanks a lot! In this case I think it makes more...

    Thanks a lot! In this case I think it makes more sense to use the first one then and it is also ready so that's awesome!!!
  22. Thanks! I will use the first way in that case as...

    Thanks! I will use the first way in that case as it is both easier (both on code and on the eyes). Also, I posted this message in the D language forums and "writef" is from the standard library of...
  23. Right way to show numbers in binary/hex/octal in your opinion?

    So I have this function that converts a number to a string and it can return it in any base you want. However, for negative numbers, the result may not be what you expected for bases other than...
  24. Yeah exactly, this is what I'm talking about. ...

    Yeah exactly, this is what I'm talking about.



    Then what's the point of having modules if the system is so stupid? I mean... I know that you probably can't answer this question as you were not...
  25. How am I gonna create modules if they depend on each other?

    Rant (sorry I'm angry not because of the modules thing): Ok so first of all someone please tell me why the ........ they can't make a simple module system that works like any other ........ing...
Results 1 to 25 of 55
Page 1 of 3 1 2 3