Tag: assembly

53 votes
4 answers
1.3K views
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

avatar
Deedee
0 1 0 9
asked 07 September, 2021
51 votes
4 answers
1K views
How can one see content of stack with GDB?

I am new to GDB, so I have some questions: How can I look at content of the stack? Example: to see content of

avatar
Benton
0 1 0 9
asked 07 September, 2021
65 votes
4 answers
1.7K views
Why does Windows64 use a different calling convention from all other OSes on x86-64?

AMD has an ABI specification that describes the calling convention to use on x86-64. All OSes follow it, excep

avatar
Rufus
0 1 0 9
asked 07 September, 2021
55 votes
5 answers
2.9K views
What is the function of the push / pop instructions used on registers in x86 assembly?

When reading about assembler I often come across people writing that they push a certain register of the proce

avatar
Kisha
0 1 0 9
asked 07 September, 2021
61 votes
8 answers
2.3K views
`testl` eax against eax?

I am trying to understand some assembly. The assembly as follows, I am interested in the testl line: 000319d

avatar
Winford
0 1 0 9
asked 07 September, 2021
50 votes
4 answers
823 views
What are CFI directives in Gnu Assembler (GAS) used for?

There seem to be a .CFI directive after every line and also there are wide varities of these ex.,.cfi_startpro

avatar
Royal
0 1 0 9
asked 07 September, 2021
57 votes
15 answers
1.1K views
Quickly find whether a value is present in a C array?

I have an embedded application with a time-critical ISR that needs to iterate through an array of size 256 (pr

avatar
Sydney
0 1 0 9
asked 07 September, 2021
61 votes
10 answers
677 views
How to view the assembly behind the code using Visual C++?

I was reading another question pertaining the efficiency of two lines of code, and the OP said that he looked

avatar
Cortez
0 1 0 9
asked 07 September, 2021
60 votes
3 answers
2.7K views
Possible GCC bug when returning struct from a function

I believe I found a bug in GCC while implementing O'Neill's PCG PRNG. (Initial code on Godbolt'

avatar
Vi
0 1 0 9
asked 07 September, 2021
62 votes
5 answers
1.3K views
Purpose of ESI & EDI registers?

What is the actual purpose and use of the EDI & ESI registers in assembler? I know they are used for stri

avatar
Margo
0 1 0 9
asked 07 September, 2021
51 votes
8 answers
2.3K views
What is the purpose of XORing a register with itself?

xor eax, eax will always set eax to zero, right? So, why does MSVC++ sometimes put it in my executable

avatar
Omar
0 1 0 9
asked 07 September, 2021
62 votes
3 answers
1.7K views
What is the meaning of "non temporal" memory accesses in x86

This is a somewhat low-level question. In x86 assembly there are two SSE instructions: MOVDQA xmmi, m128

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
56 votes
3 answers
2.2K views
What does `dword ptr` mean?

Could someone explain what this means? (Intel Syntax, x86, Windows) and dword ptr [ebp-4], 0

avatar
Kisha
0 1 0 9
asked 07 September, 2021
59 votes
14 answers
2K views
How can I see the assembly code for a C++ program?

How can I see the assembly code for a C++ program? What are the popular tools to do this?

avatar
Vi
0 1 0 9
asked 07 September, 2021
53 votes
1 answers
1K views
What is the best way to set a register to zero in x86 assembly: xor, mov or and?

All the following instructions do the same thing: set %eax to zero. Which way is optimal (requiring fewest mac

avatar
User demo
0 1 0 9
asked 07 September, 2021
49 votes
7 answers
2K views
How does this milw0rm heap spraying exploit work?

I usually do not have difficulty to read JavaScript code but for this one I can’t figure out the logic. The

avatar
Robyn
0 1 0 9
asked 07 September, 2021
63 votes
4 answers
971 views
Why do x86-64 instructions on 32-bit registers zero the upper part of the full 64-bit register?

In the x86-64 Tour of Intel Manuals, I read Perhaps the most surprising fact is that an instruction such a

avatar
Frederick
0 1 0 9
asked 07 September, 2021
52 votes
1 answers
554 views
Why do ARM chips have an instruction with Javascript in the name (FJCVTZS)?

FJCVTZS is "Floating-point Javascript Convert to Signed fixed-point, rounding toward Zero". It is supported i

avatar
Majorie
0 1 0 9
asked 07 September, 2021
63 votes
12 answers
3K views
What is the difference between MOV and LEA?

I would like to know what the difference between these instructions is: MOV AX, [TABLE-ADDR] and LEA AX,

avatar
Juliane
0 1 0 9
asked 07 September, 2021
65 votes
3 answers
3K views
How do you use gcc to generate assembly code in Intel syntax?

The gcc -S option will generate assembly code in AT&T syntax, is there a way to generate files in Intel sy

avatar
Brianne
0 1 0 9
asked 07 September, 2021