Coffeehouse Post

Single Post Permalink

View Thread: Machine code
  • User profile image

    , TLapworth93 wrote

    damn, it all looks pretty complicated. im studying to someday go into PLC programming. industrial automation as i am being taught by a company that makes these machines. im learning C sharp but was just wondering about the machine code (or assembly language). i think i might give it a try in the near future. thanks Smiley

    most of the time you will read and write the assembly language code for a given cpu not the binary machine code, think of assembler as the "source Code" for the machine.

    when you have to fix a bug in the code you will often use a tool that may be called a debugger or a monitor that can read a block of memory and display the assembly code that it in that block so that you can understand it more rapidly.  in time you will start to see how the two are related

    most of them will show hex values on the left and then the assembly on the right so that you can learn them both.

    but often you may also have a C compiler that has been optimized to generate code for a given cpu that let's you spend say 95 to 99% of the time working in C code.

    C can often be translated by a good compiler to very clean tight machine code.

    what you should do first is get really good at converting between number systems, decimal, octal, hexadecimal and binary as that skill will help you learn to read the memory dumps that have the machine code sections.