instruction-set Questions

3

How is it that an executable can work on both AMD and Intel systems? Aren't AMD's and Intel's instruction sets different? How does the executable work on both? How exactly do they compile the files...

1

Background It is well known that the exact product of two floating point numbers is not always a floating point number, but the error exact(a*b) - float(a*b) is. Some codes for exact multiplicatio...

9

Solved

I am studying Assembly programming in general, so I've decided to try and implement a "virtual microprocessor" in software, which has registers, flags and RAM to work with, implemented with variabl...

4

When disassembling an executable I encountered the cmove instruction. I've already searched on the Internet but I've only found that it's a conditional move, and if the source and destination are e...

2

Solved

I've been looking for a list of the opcodes used in ARM Cortex M3/M4/M4F, without luck. There are plenty of [online] references to the 32-bit format of ARM instructions. References to Thumb-2 instr...
Acidhead asked 28/12, 2014 at 13:15

4

I remember in an assembly class, we learned the m68k processor, and there were 3 kinds of shifts you could do. Linear shift, circular shift, and circular shift with extend. The last one, circular ...

2

Solved

GCC compiler provides a set of builtins to test some processor features, like availability of certain instruction sets. But, according to this thread we also may know certain cpu features may be no...
Cyte asked 8/2, 2018 at 4:31

7

Solved

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 CPUIn...
Yuk asked 25/5, 2011 at 8:49

2

Solved

I am trying to convert an assembly program I wrote into NULL-free shellcode. However, I am unsure how to go about this for certain instructions. Some of them (in Intel syntax) include: push 0x1000 ...
Leucoplast asked 28/7, 2011 at 3:57

2

Solved

Just interesting how it works in games and other software. More precisely, I'm asking for a solution in C++. Something like: if AMX available -> Use AMX version of the math library else if AVX-5...
Mongolian asked 1/9, 2022 at 8:10

2

I explicitly use the Intel SIMD extensions intrinsic in my C/C++ code. In order to compile the code I need to specify -mavx, or -mavx512, or something similar on the command line. I'm good with all...
Stempien asked 22/2, 2022 at 22:56

1

Solved

How many instructions on zen 3 CPUs are exclusive to AMD? I am aware of only 3: mwaitx, monitorx, and clzero Also, the 3DNow! and lwp instruction sets were once AMD exclusive but they have since be...
Witchhunt asked 19/7, 2022 at 0:55

2

Solved

CPUs intended to provide high-performance number crunching, end up with some kind of vector instruction set. There are basically two kinds: SIMD. This is conceptually straightforward, e.g. instead...
Cawnpore asked 29/5, 2022 at 9:35

0

As far as I know, there is no instruction in SSE/AVX for loading an immediate. One workaround is loading a value to a normal register and movd, but compilers seem to think this is more costly than ...
Mischance asked 6/5, 2022 at 17:6

1

I need to deal with bignum calculation (addition and subtraction, but I treat subtraction as equivalent to signed addition) on RISC-V and the situation is a bit complicated. What I gather from half...
Impiety asked 5/2, 2022 at 15:48

6

Solved

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 use...
Casandra asked 12/2, 2011 at 6:7

2

Solved

I'm trying to understand the behavior of pushing and popping the stack pointer register. In AT&T: pushl %esp and popl %esp Note that they store the computed value back into %esp. I'm consider...
Hungary asked 19/2, 2013 at 22:30

1

Solved

I have the following C/C++ code (compiler explorer link): void update_mul(int *x, int *amount) { *x *= *amount; } void update_add(int *x, int *amount) { *x += *amount; } Under both clang an...
Subak asked 11/8, 2021 at 15:49

3

Solved

I am not able to understand the difference between Instruction set and Instruction set architecture. I know what is an instruction set. Instruction set just defines the possible instructions we ca...

2

Solved

With Z2 dword ?, mov eax, Z2 works fine but movzx eax, Z2 gives "invalid instruction operands" error. I am a little confused here: even though Z2 is of same size as eax, why couldn't asse...
Derisible asked 11/6, 2021 at 8:14

0

I'm writing an assembler. I always thought that assembly had a 1:1 correspondence between a certain assembly instruction and corresponding instruction, so I thought it would be fairly easy to...
Pate asked 3/5, 2021 at 11:19

2

Solved

I'm trying to learn a bit about assembly. I decided to start by looking at the generated assembly files from simple source code. Of course, I get bombarded by instructions that I have no idea what ...
Folklore asked 27/4, 2021 at 9:50

1

Assume I'm using my Intel x64 based laptop with no dedicated GPU. I must have some GPU onboard otherwise my screen won't work, right? Are onboard GPUs typically embedded into the CPU? Does intel ...
Jelsma asked 7/5, 2020 at 19:2

1

They're one of the simplest "instructions" you could perform on a computer (they're the first ones I'd personally implement) Performing NOT(AND(x, y)) doubles execution time AND dependen...
Sulfonation asked 6/1, 2021 at 13:13

2

I was asked in an interview if PUSH and POP are RISC or CISC instructions. I said that they were RISC, but they told me that they were actually CISC instructions. I suggested that ARM (a common RIS...
Inextinguishable asked 8/12, 2016 at 2:55

© 2022 - 2024 — McMap. All rights reserved.