Questions tagged [instruction-set]

Use for questions related to Instruction Set Architectures, ISA. For questions related to the inner workings of a CPU, use [cpu-architecture] instead.

An instruction set is a specification for a set of machine-readable instructions, or CPU instructions. An instruction set exists for all processing units including Graphics Processing Cores, Networking Card Processors as well at the CPU. The phrase "Instruction Set" usually implies the CPU type.

Each digital logic process which a processor can perform has an binary instruction code which caused the CPU to execute that exact instruction. An assembly language translates mnemonics into instruction codes. Instruction codes are likely to differ between different processor architectures. For example, the x86_64 instruction set for Intel CPU's includes additional 64 bit instructions (among others) for manipulating data 64 bits wide inside the CPU's core, which is an extension to the x86 32 bit capabilities of previous Intel CPU generations.

736 questions
181
votes
12 answers

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, [TABLE-ADDR]
naveen
  • 53,448
  • 46
  • 161
  • 251
74
votes
7 answers

How to check if a CPU supports the SSE3 instruction set?

Is the following code valid to check if a CPU supports the SSE3 instruction set? Using the IsProcessorFeaturePresent() function apparently does not work on Windows XP. bool CheckSSE3() { int CPUInfo[4] = {-1}; //-- Get number of valid info…
Stiefel
  • 2,677
  • 3
  • 31
  • 42
68
votes
1 answer

What is the ARM Thumb Instruction set?

under "The Thumb instruction set" in section 1-34 of "ARM11TechnicalRefManual" it said that: "The Thumb instruction set is a subset of the most commonly used 32-bit ARM instructions.Thumb instructions are 16 bits long,and have a corresponding…
Soroush
  • 989
  • 2
  • 10
  • 16
62
votes
9 answers

How to control which core a process runs on?

I can understand how one can write a program that uses multiple processes or threads: fork() a new process and use IPC, or create multiple threads and use those sorts of communication mechanisms. I also understand context switching. That is, with…
poundifdef
  • 18,726
  • 23
  • 95
  • 134
61
votes
6 answers

Determine target ISA extensions of binary file in Linux (library or executable)

We have an issue related to a Java application running under a (rather old) FC3 on an Advantech POS board with a Via C3 processor. The java application has several compiled shared libs that are accessed via JNI. Via C3 processor is supposed to be…
61
votes
6 answers

Do graphic cards have instruction sets of their own?

Do graphic cards have instruction sets of their own? I assume they do, but I have been wondering if they are proprietary or if there is some sort of open standard. Is every GPU instruction preceded by a CPU instruction or is it seamless? That is,…
Matt
  • 25,943
  • 66
  • 198
  • 303
43
votes
3 answers

What's the point of LEA EAX, [EAX]?

LEA EAX, [EAX] I encountered this instruction in a binary compiled with the Microsoft C compiler. It clearly can't change the value of EAX. Then why is it there?
G S
  • 35,511
  • 22
  • 84
  • 118
35
votes
5 answers

Differences between ARM architectures from a C programmer's perspective?

I'm fairly new to programming for ARM. I've noticed there are several architectures like ARMv4, ARMv5, ARMv6, etc. What is the difference between these? Do they have different instruction sets or behaviors? Most importantly, if I compile some C…
Jay Conrod
  • 28,943
  • 19
  • 98
  • 110
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?
31
votes
7 answers

Are instruction set and assembly language the same thing?

I was wondering if instruction set and assembly language are the same thing? If not, how do they differ and what are their relations? Thanks and regards!
Tim
  • 1
  • 141
  • 372
  • 590
31
votes
6 answers

What's the purpose of the rotate instructions (ROL, RCL on x86)?

I always wondered what's the purpose of the rotate instructions some CPUs have (ROL, RCL on x86, for example). What kind of software makes use of these instructions? I first thought they may be used for encryption/computing hash codes, but these…
Gratian Lup
  • 1,485
  • 3
  • 19
  • 29
27
votes
9 answers

How does program execute? Where does the Operating Systems come into play?

A program is compiled from some language to ASM --> Machine Code (directly executable). When people say that this is platform dependent, the mean that the binaries formed will run (correctly) only on the CPUs with same Instruction Set Architecture…
27
votes
4 answers

In C++, is it better to cap a value using std::min or an if branch?

A very common pattern in programming is to cap a value at a maximum after some kind of update. What I'd like to know, is if there's a difference between the following two pieces of code, and if one should be preferred: value += increment; value =…
voltrevo
  • 9,870
  • 3
  • 28
  • 33
25
votes
3 answers

What do x86_64, i386, ia64 and other such jargons stand for?

I frequently encounter these terms and am confused about them. Are they specific to the Processor, or the Operating System, or both? I have Ubuntu 12.04 running on Intel i7 machine. So which one of them would apply for my case?
hardcoder
  • 415
  • 1
  • 5
  • 13
25
votes
5 answers

Difference between add and addu

I am confused about the difference between add and addu. The MIPS instruction reference says: add (with overflow) add unsigned (no overflow) My understanding is to use add with signed operands and addu with unsigned operands. But let's consider…
collimarco
  • 34,231
  • 36
  • 108
  • 142
1
2 3
49 50