Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
4answers
223 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 ...
0
votes
3answers
237 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
1answer
162 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
1answer
857 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:...
8
votes
6answers
17k 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 Language ...
1
vote
3answers
1k 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
1answer
984 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 ...
9
votes
5answers
9k 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)?
0
votes
2answers
835 views

comparison of computer processing language vs protocol

how can explain the diference between programming languge and protocol?, can protocol have extension? we know that machines communicate with protocol, but they can also do so with expressive ...
10
votes
1answer
242 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 ...
12
votes
3answers
9k views

Why do executables depend on the OS but not on the CPU?

If I write a C program and compile it to an .exe file, the .exe file contains raw machine instructions to the CPU. (I think). If so, how is it possible for me to run the compiled file on any computer ...
1
vote
1answer
716 views

How does an optimizing compiler react to a program with nested loops?

Say you have a bunch of nested loops. public void testMethod() { for(int i = 0; i<1203; i++){ //some computation for(int k=2; k<123; k++){ //...
1
vote
2answers
592 views

Is it possible to implement a native compiler for a 'managed language' such as Java?

In most cases, it is possible to create both a native compiler and an interpreter for a programming language. The compiler would simply convert the source code to machine code, and the interpreter ...
22
votes
6answers
20k views

Is machine language always binary? [duplicate]

I know absolutely nothing in low-level stuff, so this will be a very newbie question. Please excuse my ignorance. Is machine language - the series of numbers to that tell the physical computer ...
10
votes
5answers
3k views

Do compiler-writers actually need to 'understand' machine code? [closed]

Might be kind of an odd question. A guy writing a C++ compiler (or whatever non-VM language): Does he need to be able to read/write raw machine language? How does that work? EDIT: I am specifically ...
1
vote
1answer
978 views

Creating a very basic compiler using Java

I want to try and create my own very basic language, with it's very basic compiler. All using Java. For now, it will only need to enable to 'programmer' to print things to the screen. I had an idea ...
16
votes
4answers
9k views

Why can't native machine code be easily decompiled?

With bytecode-based virtual machine languages like Java, VB.NET, C#, ActionScript 3.0, etc., you hear sometimes about how easy it is to just go download some decompiler off the Internet, run the ...
0
votes
4answers
2k views

How does assembly relate to machine/binary code

How does assembly relate to machine/binary code. For example here is how to print to the screen in mikeOS(a small pure assembly OS), mikeOS it uses NASM to assemble. BITS 16 ORG 32768 %...
0
votes
1answer
980 views

Fetching instructions from memory

So, I am a noob in assembly language and machine instructions. When the discussion came up as to how funtion calls are implemented at the processor level, someone said that the CALL instruction ...
1
vote
1answer
516 views

What did machine code for 4-bit architecture look like?

I don't know how a 4-bit instruction could be enough to do something so I read about the Intel 4004 and it says that it used 8-bit instructions and then I can understand how opcode and numbers has ...
3
votes
3answers
446 views

Is it possible to use GNU GPL for application that has no source?

I mean, it is possible to create application without source code - for example using HEX editor or some debugger that can assembly instructions (actually every decent debugger can). Creating programs ...
5
votes
2answers
5k views

Do compilers have to be written for each model of CPU?

Do you need to take account of the different processors and their instructions when writing a compiler? Have instructions been standardised? Or what tools and techniques are available to assist with ...
13
votes
4answers
8k views

How is software for machines such as ATMs or TVs built?

As a beginner programmer I've only worked with programming computer based applications, but a question has been coming to my head very often since I started programming and I can't get it answered ...
24
votes
9answers
48k views

Resources on learning to program in machine code? [closed]

I'm a student, fresh into programming and loving it, from Java to C++ and down to C. I moved backwards to the barebones and thought to go further down to Assembly. But, to my surprise, a lot of ...
-1
votes
1answer
492 views

Is there any example or resource explaining/showing code from High-level to Low-level to deep down Machine code? [closed]

I have been searching for an example over the internet that shows any operation like saving a file or drawing anything in UI or any other sort that shows the implementation from High-leve language ...