Questions tagged [machine-code]
According to Wikipedia, Machine code or machine language is a set of instructions executed directly by a computer's central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory. Every program directly executed by a CPU is made up of a series of such instructions.
                30 questions
            
            
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                310
            
            views
        
        
            
            
            
        Are shorter variants of machine instructions worth it?
                    I'm writing a JIT runtime, and I've started thinking about shorter variants of some instructions.
In x64 we can do at least two kinds of jumps: rel8 and rel32. The first one takes say 2 bytes (opcode +...
                
            
       
        
            
                -3
            
            votes
        
        
            
                3
            
            answers
        
        
            
                366
            
            views
        
        
            
            
        why do we need instructions set for processor or controller?
                    Why is it necessary to have an instruction set for processors and controllers? Can't we simply convert high-level language programs, like those written in C, directly into binaries without the need ...
                
            
       
        
            
                1
            
            vote
        
        
            
                3
            
            answers
        
        
            
                3k
            
            views
        
        
            
            
            
        How do binary numbers interact with the CPU and cause some action to take place? [duplicate]
                    EDIT: Perhaps what I am misunderstanding is that when it is said that the code we type gets turned into machine code of 0s and 1s. If these 0s and 1s are the abstracted representation of their ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                140
            
            views
        
        
            
        is the relocatable machine code essentially the text segment of the virtual address?
                    Sorry if this is a basic question, I'm studying for my operating systems class and compiler theory class at the same time and this is confusing me. From what I do understand, virtual memory is larger ...
                
            
       
        
            
                -4
            
            votes
        
        
            
                3
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
            
        How to Write Pure Machine Code for Linux?
                    I'm writing a compiler, and I want it to compile to a native executable (just Linux, for now). I don't want it to be Assembly, it needs to be PURE machine code. Can anyone point me in the right ...
                
            
       
        
            
                2
            
            votes
        
        
            
                4
            
            answers
        
        
            
                377
            
            views
        
        
            
            
            
        Meaning of Machine in Compiler Theory
                    Can anyone tell me what does "machine" means in Compiler Theory? Does it mean computer in general or operating system? Actually, the problem is I understand the definition of machine language as "the ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                456
            
            views
        
        
            
            
            
        Why do we use the symbols 0 and 1 for two-state logic?
                    We know a regular computer basically only knows two states and that we name these states 0 and 1 respectively. This seems arbitrary, we could name them "a" and "b", or even 3 and 4. Is there a reason ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                419
            
            views
        
        
            
        Intel Memory Addressing Form
                    I'm am trying to understand machine code memory addressing for x86, and I've encountered two opposing general forms for addressing (using the ModRM and SIB bytes).
Most unofficial resources I consult ...
                
            
       
        
            
                -2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                3k
            
            views
        
        
            
            
            
        What is 16 bit word's equivalent in decimal?
                    Question:
  For a 16 bit word with 6 bits for an opcode
  
  
  How many different instructions could I fit into the instruction set?
  What is the largest number that I could use as data?
  
Answer:
...
                
            
       
        
            
                14
            
            votes
        
        
            
                7
            
            answers
        
        
            
                40k
            
            views
        
        
            
            
            
        "Write an Assembler in C." Why writing a machine code translator for a low level language in a higher level language?
                    My Microprocessor class instructor gave us an assignment and said:
"Write an Assembler in C." - My beloved Professor
So it seemed a little bit illogical to me.
If I'm not wrong Assembly ...
                
            
       
        
            
                1
            
            vote
        
        
            
                3
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
        Operation excution in terms of clock cycles
                    Typically for a single instrcution, 6 machine cycles are needed:
FETCH instruction
DECODE instruction
EVALUATE ADDRESS
fetch OPERANDS
EXECUTE oepration
STORE result
My concern is regarding the fifth ...
                
            
       
        
            
                1
            
            vote
        
        
            
                4
            
            answers
        
        
            
                5k
            
            views
        
        
            
            
        What is involved in compiling or interpreting machine G-Code?
                    The G-Code and M-Code that we used to instruct CNC lathe, 3d-Printers and engraving machines, to my understanding, is not a programming language, but a scripting language like Python where scripts ...
                
            
       
        
            
                15
            
            votes
        
        
            
                5
            
            answers
        
        
            
                13k
            
            views
        
        
            
        Compilation to bytecode vs machine code
                    Does compilation that produces an interim bytecode (like with Java), rather than going "all the way" to machine code, generally involve less complexity (and thus likely take less time)?
                
            
       
        
            
                -1
            
            votes
        
        
            
                2
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
            
        Computer Language vs. Protocol Comparison
                    How to explain the difference between a programming language and a protocol?
Can a protocol have extensions?
We know that machines communicate with a protocol, but they can also communicate with ...
                
            
       
        
            
                10
            
            votes
        
        
            
                1
            
            answer
        
        
            
                334
            
            views
        
        
            
            
            
        Machine code JITs and the Execution Disable bit
                    How is runtime-generated machine-code (such as the output of a JIT), actually executed by the CPU if the CPU/OS has an Execution Disable bit?
As far as I know, many modern processors and Operating ...
                
            
       
         
         
         
         
        