Questions tagged [machine-code]

Machine code is data that is directly fed into a microprocessor, being the only form that the processor is able to execute. It is the lowest possible level of abstraction, wherein all data is a raw binary stream. Machine code is barely readable by humans, which is why assembly is usually utilized instead.

Every processor or processor family has its own instruction set. This is a set of instructions the processor has been designed to execute. These instructions are binary codes and in general are not human readable, one would have to memorize the bit patterns. Assembly language is a human readable representation of the machine code where the assembly language mnemonics and following syntax attempt a one to one assembly language instruction to machine code instruction relationship. But assembly language has a fair amount of additional syntax that is not directly related to machine code or machine language.

https://en.wikipedia.org/wiki/Machine_code

The tag is used for questions related to machine code. Additional tags like and and others may also be used.

A tag specifying the architecture , , , , (and many others), is needed as the machine code for different architectures is not compatible, and the question will be difficult to answer without knowing the architecture.

766 questions
13
votes
3 answers

Why does jmpq of x86-64 only need 32-bit length address?

As I use objdump -D to disassemble a binary, the typical code of jmpq is like e9 7f fe ff ff, which is used for representing a negative offset. However, the address of x86-64 is 64(48)-bit (to my knowledge), so how can this 32-bit address 7f fe ff…
13
votes
8 answers

Can software be executed in bare metal machine?

I just wonder, can we execute a program on a machine without an operating system? Besides, I heard that the Linux kernel is written in C language and a kernel is run during booting, so I just wonder how a computer understand the language without…
caramel1995
  • 2,968
  • 10
  • 44
  • 57
13
votes
2 answers

Call an absolute pointer in x86 machine code

What's the "correct" way to call an absolute pointer in x86 machine code? Is there a good way to do it in a single instruction? What I want to do: I'm trying to build a kind of simplified mini-JIT (still) based on "subroutine threading". It's…
Alex Celeste
  • 12,824
  • 10
  • 46
  • 89
12
votes
5 answers

Why do compiled languages not perform equally if they eventually become machine code?

If C#, Java, or C++, for example, all compile to machine code, why are they not equally performant? My understanding is that such languages are an abstraction of machine code, which is what they all eventually compile to. Shouldn't the processor…
Mohamad
  • 34,731
  • 32
  • 140
  • 219
12
votes
7 answers

How does the CPU know its instruction set?

Basic computer operation question but I'm not sure how to ask it. When we say that a computer has an instruction set, how does the computer know what that set is? Is it stored in a ROM chip? Is it stored in the CPU somewhere? Where did the…
johnny
  • 19,272
  • 52
  • 157
  • 259
12
votes
4 answers

Are Bytecode and Assembly Language the same thing?

The question might seem odd, but I am still trying to grasp the concepts of virtual machines. I have read several answers, but I still don't get if Java bytecode (and MSIL as well) is the same as assembly language. As far as I understand both…
12
votes
1 answer

static code analysis for assembly language

Are there any open-source tools or libraries for static code analysis of simple custom assembly-like languages (for automatically generated programs) and what are they capable of (detecting unused code/registers, giving high-level expressions for…
Thomas
  • 1,001
  • 1
  • 10
  • 20
12
votes
4 answers

How does a compiler compile a compiler?

Coming from a high-level programming background, I am interested in learning about low-level programming. I want to know how a compiler is compiled? After looking at some articles in wiki, Numerical machine code is said to be lowest level language,…
wtsang02
  • 18,603
  • 10
  • 49
  • 67
11
votes
6 answers

Are compiled programs actually in true binary?

For example, when I compile a C application is the outputted file read as binary or does the OS then interpret the compilation? Is the "machine language" pure binary? EDIT: Yes, everything on a computer is pure binary. Im asking if the processer…
alecwhardy
  • 2,698
  • 6
  • 27
  • 33
11
votes
1 answer

Help with 68k assembly - jump tables?

I'm working on reverse engineering a large Amiga program in IDA, and I've made a ton of progress. However, there is some stuff I can't quite figure out. Namely, I have found several subroutines which use what I believe to be "jump tables" - but I…
AriX
  • 1,647
  • 2
  • 18
  • 24
11
votes
1 answer

Is tooling available to 'assemble' WebAssembly to x86-64 native code?

I am guessing that a Wasm binary is usually JIT-compiled to native code, but given a Wasm source, is there a tool to see the actual generated x86-64 machine code? Or asked in a different way, is there a tool that consumes Wasm and outputs native…
Erik
  • 4,268
  • 5
  • 33
  • 49
11
votes
6 answers

How to tell the length of an x86 instruction?

I was looking at the different instructions in assembly and I am confused on how the lengths of different operands and opcodes are decided upon. Is it something you ought to know from experience, or is there a way to find out which operand/operator…
user277465
11
votes
1 answer

What does the /4 mean in FF /4?

One site that I commonly refer to for x86 documentation has a few instruction codes with a slash and a number. For instance, jmp near absolute indirect gives FF /4, whereas jmp far absolute indirect gives FF /5. What do the /4 and /5 mean? To run a…
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
11
votes
2 answers

How is machine code stored in the EXE file?

My questions are as follows: How does the Portable Executable format (on Windows/Unix) relate to the x86/x64 instruction set in general? Does the PE format store the exact set of opcodes supported by the processor, or is it a more generic format…
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
10
votes
1 answer

Which x86 instruction has a 10-byte immediate?

The Intel® 64 and IA-32 Software Developer's Manual, Volume 2A, Section 3.1.1.1 mentions the notation ct to denote a 10-byte value following the opcode. I am however unable to find any instruction which is annotated with it. Am I missing something…
Trillian
  • 6,207
  • 1
  • 26
  • 36
1 2
3
51 52