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
279
votes
10 answers

Assembly code vs Machine code vs Object code?

What is the difference between object code, machine code and assembly code? Can you give a visual example of their difference?
mmcdole
  • 91,488
  • 60
  • 186
  • 222
119
votes
4 answers

What is the difference between native code, machine code and assembly code?

I'm confused about machine code and native code in the context of .NET languages. What is the difference between them? Are they the same?
samaladeepak
  • 1,191
  • 2
  • 8
  • 3
97
votes
2 answers

What does "rep; nop;" mean in x86 assembly? Is it the same as the "pause" instruction?

What does rep; nop mean? Is it the same as pause instruction? Is it the same as rep nop (without the semi-colon)? What's the difference to the simple nop instruction? Does it behave differently on AMD and Intel processors? (bonus) Where is the…
Denilson Sá Maia
  • 47,466
  • 33
  • 109
  • 111
92
votes
8 answers

"Assembly" vs. "Assembler"

I've been taught that "assembly" is what you write in your files, to have your "assembler" convert it into binary code. But I see these two terms mixed and matched in various works. I've even heard that you write "assembler", after which an…
Henrik Paul
  • 66,919
  • 31
  • 85
  • 96
75
votes
2 answers

int operators != and == when comparing to zero

I've found that != and == are not the fastest ways for testing for zero or non-zero. bool nonZero1 = integer != 0; xor eax, eax test ecx, ecx setne al bool nonZero2 = integer < 0 || integer > 0; test ecx, ecx setne al bool zero1 = integer ==…
NFRCR
  • 5,304
  • 6
  • 32
  • 37
70
votes
10 answers

How to write and execute PURE machine code manually without containers like EXE or ELF?

I just need a hello world demo to see how machine code actually works. Though windows' EXE and linux' ELF is near machine code,but it's not PURE How can I write/execute PURE machine code?
compiler
  • 4,143
  • 9
  • 36
  • 40
67
votes
4 answers

Difference between native and managed code?

For example, when looking at the GlowCode profiler website it says: GlowCode 6.2 and x64 profile native, managed, and mixed C++, C#, .NET code What do they mean?
Joel
  • 15,166
  • 16
  • 39
  • 31
59
votes
6 answers

How to call machine code stored in char array?

I'm trying to call native machine-language code. Here's what I have so far (it gets a bus error): char prog[] = {'\xc3'}; // x86 ret instruction int main() { typedef double (*dfunc)(); dfunc d = (dfunc)(&prog[0]); (*d)(); return…
user5406764
  • 1,627
  • 2
  • 16
  • 23
53
votes
6 answers

How to write and executable Windows .exe manually (machine code with Hex editor)?

I'd like to know how is it possible to write something as simple as an Hello World program just by using an Hex Editor. I know that I could use an assembler and assembly language to this at a near machine level but I just want to experiment with…
petersaints
  • 1,899
  • 3
  • 18
  • 25
49
votes
17 answers

Is there a programming language "below" Assembly?

Is there a programming language "below" Assembly?
Tal
43
votes
2 answers

Is x86-64 machine language big endian?

0x0000000000400507 : 74 0c je 0x400515 0x0000000000400509 : bf 28 06 40 00 mov $0x400628,%edi .. 0x400507 : 0x28bf0c74 I think shows the machine code is big-endian. Is my conclusion right?
kern
  • 2,295
  • 4
  • 17
  • 15
36
votes
4 answers

How to Calculate Jump Target Address and Branch Target Address?

I am new to Assembly language. I was reading about MIPS architecture and I am stuck with Jump Target Address and Branch Target Address and how to calculate each of them.
user379888
35
votes
3 answers

How to read the Intel Opcode notation

I am reading some material which quotes Intel's vol.2 SDM x86 manual about opcodes and machine-code encoding of assembly instructions, but I cannot understand what things like cw, cd, /2, cp, or /3 mean following the opcode byte. E8 cw CALL rel16…
asher
  • 353
  • 1
  • 3
  • 4
33
votes
9 answers

What's the relationship between assembly language and machine language?

Are assembly language and machine language (for the same underlying system) really the same? Are there any differences between these two concepts?
32
votes
4 answers

Homoiconic and "unrestricted" self modifying code + Is lisp really self modifying?

I will be forward in admiting that my knowledge of Lisp is extremely minimal. However I am extremely interested in the language and plan to begin seriously learning it in the near future. My understanding of these issues is no doubt flawed, so if I…
TheIronKnuckle
  • 7,224
  • 4
  • 33
  • 56
1
2 3
51 52