Skip to main content

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.

Filter by
Sorted by
Tagged with
3 votes
1 answer
311 views

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 +...
freakish's user avatar
  • 3,085
-3 votes
3 answers
376 views

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 ...
Harshith Gowda's user avatar
1 vote
3 answers
3k views

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 ...
steez's user avatar
  • 31
1 vote
1 answer
140 views

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 ...
qwerty_99's user avatar
  • 173
-4 votes
3 answers
2k views

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 ...
InfiniteDonuts's user avatar
2 votes
4 answers
378 views

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 ...
Delsilon's user avatar
  • 143
1 vote
2 answers
459 views

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 ...
Mehedi Hasan Shifat's user avatar
1 vote
1 answer
424 views

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 ...
Joseph Johnston's user avatar
-2 votes
1 answer
3k views

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: ...
mertyildiran's user avatar
14 votes
7 answers
40k views

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 ...
mertyildiran's user avatar
1 vote
3 answers
2k views

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 ...
AhmedWas's user avatar
  • 147
1 vote
4 answers
5k views

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 ...
KMC's user avatar
  • 137
15 votes
5 answers
13k views

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)?
Julian A.'s user avatar
  • 253
-1 votes
2 answers
2k views

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 ...
user avatar
10 votes
1 answer
335 views

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 ...
Siler's user avatar
  • 421
25 votes
3 answers
18k views

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 ...
Aviv Cohn's user avatar
  • 21.6k
1 vote
1 answer
991 views

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++){ //...
Force444's user avatar
  • 643
1 vote
2 answers
710 views

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 ...
Aviv Cohn's user avatar
  • 21.6k
22 votes
6 answers
30k views

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 ...
Aviv Cohn's user avatar
  • 21.6k
9 votes
5 answers
5k views

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 ...
Aviv Cohn's user avatar
  • 21.6k
1 vote
1 answer
1k views

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 ...
Aviv Cohn's user avatar
  • 21.6k
19 votes
8 answers
13k views

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 ...
Panzercrisis's user avatar
  • 3,223
3 votes
4 answers
3k views

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 %...
user12979's user avatar
  • 375
0 votes
1 answer
1k views

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 ...
ans_venkat's user avatar
1 vote
1 answer
671 views

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 ...
Niklas Rosencrantz's user avatar
3 votes
3 answers
574 views

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 ...
johnfound's user avatar
  • 318
10 votes
2 answers
12k views

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 ...
br3w5's user avatar
  • 769
14 votes
4 answers
9k views

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 ...
Bugster's user avatar
  • 4,043
26 votes
9 answers
65k views

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 ...
AceofSpades's user avatar
0 votes
1 answer
516 views

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 ...
Pankaj Upadhyay's user avatar