Questions tagged [instructions]

Questions about instructions of real CPUs, VMs or compiler IRs.

Questions about instructions of real CPUs such as ARM and x86, virtual machines such as Java, or compiler internal representations such as LLVM.

574 questions
19
votes
4 answers

How exactly do executables work?

I know that executables contain instructions, but what exactly are these instructions? If I want to call the MessageBox API function for example, what does the instruction look like? Thanks.
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
18
votes
1 answer

difference between conditional instructions (cmov) and jump instructions

I'm confused where to use cmov instructions and where to use jump instructions in assembly? From performance point of view: What is the difference in both of them? Which one is better? If possible, please explain their difference with an…
jigglypuff
  • 309
  • 1
  • 2
  • 8
16
votes
3 answers

The difference between cmpl and cmp

I am trying to understand assembly to be able to solve a puzzle. However I encountered the following instructions: 0x0000000000401136 <+44>: cmpl $0x7,0x14(%rsp) 0x000000000040113b <+49>: ja 0x401230 What I think it's…
Sarah cartenz
  • 1,313
  • 2
  • 14
  • 37
15
votes
4 answers

Is there a list of deprecated x86 instructions?

I'm taking an x86 assembly language programming class and know that certain instructions shouldn't be used anymore -- because they're slow on modern processors; for example, the loop instruction. I haven't been able to find any list of instructions…
LucidDefender
  • 219
  • 2
  • 4
15
votes
1 answer

What is the advantage of having instructions in a uniform format?

Many processors have instructions which are of uniform format and width such as the ARM where all instructions are 32-bit long. other processors have instructions in multiple widths of say 2, 3, or 4 bytes long, such as 8086. What is the advantage…
15
votes
2 answers

Why does x86 nopl instruction take an operand?

Why does a nopl instruction in an x86 take an operand? Don't nops just do, well, nothing? nopl 0x0(%rax)
RouteMapper
  • 2,484
  • 1
  • 26
  • 45
14
votes
2 answers

Why doesn't there exists a subi opcode for MIPS?

I am very new to Assembly language. I was reading about MIPS architecture and came to know that you have addi opcode but there is no subi opcode. Why don't we have a subi opcode?
user379888
14
votes
2 answers

Does [ebp*2] reference DS or SS segment?

IDM says the memory op uses SS segment if EBP is used as base register. As a result, [ebp + esi] and [esi + ebp] references SS and DS segments, respectively. See NASM's doc: 3.3 Effective Address. In the above same section, NASM mentioned how to…
wildpie
  • 143
  • 4
14
votes
5 answers

Tracing/profiling instructions

I'd like to statistically profile my C code at the instruction level. I need to know how many additions, multiplications, divisions, etc I'm performing. This is not your usual run of the mill code profiling requirement. I'm an algorithm developer…
LeChuck2k
  • 303
  • 2
  • 12
13
votes
1 answer

How does the instruction decoder differentiate between EVEX prefix and BOUND opcode in 32-bit mode?

In 32-bit mode Intel solves the VEX prefix vs LDS/LES conflict by inverting the high bits of register extension, because the mod field of ModRM byte can't be 11b The VEX prefix's initial-byte values, C4h and C5h, are the same as the opcodes of the…
phuclv
  • 37,963
  • 15
  • 156
  • 475
13
votes
1 answer

How does mtune actually work?

There's this related question: GCC: how is march different from mtune? However, the existing answers don't go much further than the GCC manual itself. At most, we get: If you use -mtune, then the compiler will generate code that works on any of…
Marc.2377
  • 7,807
  • 7
  • 51
  • 95
13
votes
8 answers

How many asm-instructions per C-instruction?

I realize that this question is impossible to answer absolutely, but I'm only after ballpark figures: Given a reasonably sized C-program (thousands of lines of code), on average, how many ASM-instructions would be generated. In other words, what's a…
Henrik Paul
  • 66,919
  • 31
  • 85
  • 96
13
votes
1 answer

Difference between an instruction and a micro-op

What is the difference between a machine instruction and a micro-op? I found a following definition here: A small, basic instruction, used in series to make up a high-level machine instruction Here is what I found on Wikipedia In computer…
flashburn
  • 4,180
  • 7
  • 54
  • 109
12
votes
3 answers

Small Popup for Instructions, like foursquare ones

After seeing the last screenshots of new foursquare application and their balloon like cartoon instructions, I'd like to create some of these in my application. I found a similar question for iPhone Small popup for instructions... How? Here is…
Francisco Junior
  • 1,986
  • 18
  • 25
12
votes
3 answers

Does the ret instruction add 4 to esp register?

Does the ret instruction cause "esp" register to be increased by 4?
remainn
  • 1,125
  • 3
  • 9
  • 14
1
2
3
38 39