Added: 4 years ago
From: TheFallibleFiend
Views: 2,315
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • Brilliant !! So easy to understand when you explain and I think it will help me a lot to become a better programmer.

  • what about signed and unsigned numbers? They look the same in memory, how does the computer know how to handle them? Do they have separate instructions for them too?

  • @adikid89 Very good question.  It's the same opcode for both signed and unsigned, because both are handled with two's complement arithmetic. The difference is in how the return flags are handled. (It's been decades since I messed with it, so I apologize for not recalling the precise details.)

  • @TheFallibleFiend Any idea on where to find further information about this? What return flags are you talking about here? The sign flag and overflow flag? I know that overflow happens in two's complement... does that have anything to do with how the computer knows that at that address there is a negative number?

  • @adikid89 Yes, those are the flags. Probably wiki has something on it under "two's complement arithmetic." IIRC, the computer doesn't know a number at a location is negative at the level of assembler / machine code.

  • In "float a = 12.4" it's the compiler that is first aware of the types and translates to the appropriate load command. In the cases I'm familiar with, there are separate LOAD, STORE, ADD, MULITIPLY, etc. commands for integers and for floats (and different still for doubles!) and it's the compiler that translates to the correct op code. Does that answer the question?

  • Sorry 4 late response. I didnt have access to internet for a while(Trip).

    Anyway...yeah, your videos have helped me alot!!! Im in process of learning C and I'll think Ill move after to assembly or will do that in parallel with C.Long way to go but I have time...and you helped me on that path.

  • Thanks for the response. I'm glad it was helpful. C is a very good language to learn. Whether assembler is useful monetarily depends on what kind of job you have; however, regardless of whether you ever write any assembler on the job, it's generally useful for solidifying your knowledge of how the computer works. Good luck!

  • Thanks! I aiming on assembly just to learn how computer really works. It in my nature...I just cant accept that something is working without knowing how it really works. Its not very profitable to learn this way since I should rather spend my time learning some software solutions. I started with Unix and have realized that the best way to really understand computers and OS is to do programming on both levels-High and low level programming.

  • Outstanding question! I could do 3 to 5 videos just on floating point numbers. These videos are more like highlights. Anyway, older CPUs didn't inherently know how to do floating numbers. It was all done with integers to mimic floats. Later we added FPUs, floating point units, and threw the floating point data there. Modern CPUs can handle floating point and are aware of them. However ... next msg please...

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more