When a compiler compiles my code in text form, it converts the text code to a low level code, in the case of the GCC in codeblocks, assembly.
-
Can I run this compiled program directly on my machine, without needing the windows operating system?
-
Is the .exe a compiled file with the built in assembly instructions to my program?
-
How does windows runs assembly programs if it is already a giant assembly program?
-
If a assembly language program is in bytecode, why when I record a PIC with a PIC burner, I write hexacode to it?
-
The x64 architeture is a new architeture with new instructions but that still have the x86 instructions with it? True or false?
-
How do I read the low level code generated by my compiler?
Thanks
While I agree with templatetypedef’s comment that this should be split into smaller questions, I will endeavour to give some pointers on each of your questions here.
Technically, yes, but this would involve modifying the normal boot procedure. This relates to your third question. Windows itself is a form of application loader, it is an application designed to launch other applications (and do other useful things). At the moment, when your computer boots, its first instruction is likely a
JUMPinstruction telling the computer to ‘jump to’ the memory location of your OS and start its initialisation. From then on, the OS is relatively self-contained.A
.exefile is just one type of executable file. Others includeELFandMach-Oand a whole range of others. A.exefile is just like any other file except for its ‘header’ which tells the machine that the following data is in the form of machine-executable instructions (1s and 0s). Don’t confuse assembly languages with machine instructions. An assembly instruction likemov %eax, %ebxis NOT read by the machine. First it is passed through anassmeblerand translated into 1s and 0s.As above.
Bytecodeis a word with many meanings. Hexadecimal is just another (shorter) way of representing binary. Everything reduces down to binary at the end of the day.True. Intel does its best to maintain full backwards-compatibility. This does not necessarily hold true for operating systems.
By low level I assume you mean the assembly code, not the 1s and 0s. The most common way is to use the
-Sflag with a compiler likegcc. This will output a.sassembly file instead of a.oobject or.exe(etc)executable.If you want to know more about assembly, this is the God Reference for Intel processors (
IA-32(‘x86’) andx86-64). Be warned, it is extremely heavy going. You’re probably better of looking for Windows or OS X assembly tutorials on Google. NASM is a free multi-platform assembler if you want to get started, it has a slightly different syntax to others though. Before you undertake any of this though I recommend learning the basics of computer systems – how a processor works, etc. Perhaps learn a simpler assembly language first like DLX or MIPS.