instruction-set

x86 CMP Instruction Difference

和自甴很熟 提交于 2019-11-30 22:44:13
问题 Question What is the (non-trivial) difference between the following two x86 instructions? 39 /r CMP r/m32,r32 Compare r32 with r/m32 3B /r CMP r32,r/m32 Compare r/m32 with r32 Background I'm building a Java assembler, which will be used by my compiler's intermediate language to produce Windows-32 executables. Currently I have following code: final ModelBase mb = new ModelBase(); // create new memory model mb.addCode(new Compare(Register.ECX, Register.EAX)); // add code mb.addCode(new Compare

itte in arm assembly

三世轮回 提交于 2019-11-30 06:36:42
问题 What does the following line do in arm assembly: 000031e6 2916 cmp r1, #22 000031e8 bf1a itte ne I get the first line (comparing r1 to 22) but what about the second line (I've never seen the itte command before and googling returned nothing) 回答1: It is the ARM's IF-THEN-ELSE instruction, which was introduced in the Thumb-2 instruction set. (Based on your specific example above, it would have been helpful if you had shown the next 3 instructions that followed the ITTE instruction, you'll

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

纵饮孤独 提交于 2019-11-29 20:33:32
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 i686 compatible. Some time ago after installing Ubuntu 6.10 on a MiniItx board with the same processor, I found out that the previous statement is not 100% true. The Ubuntu kernel hanged on startup due to the lack of some specific and optional instructions of the i686 set in the C3 processor. These instructions missing in C3 implementation of i686 set

Instruction Lengths

半世苍凉 提交于 2019-11-29 14:09:13
I was looking at the different instructions in assembly and I am confused on how the lengths of different operands and opcodes are decided upon. Is it something you ought to know from experience, or is there a way to find out which operand/operator combination takes up how many bytes? For eg: push %ebp ; takes up one byte mov %esp, %ebp ; takes up two bytes So the question is: Upon seeing a given instruction, how can I deduce how many bytes its opcode will require? Mehrdad Afshari There's no hard and fast rule for x86 without a database as the instruction encoding is pretty complex (and the

How is fma() implemented

痴心易碎 提交于 2019-11-29 07:32:34
According to the documentation , there is a fma() function in math.h . That is very nice, and I know how FMA works and what to use it for. However, I am not so certain how this is implemented in practice? I'm mostly interested in the x86 and x86_64 architectures. Is there a floating-point (non-vector) instruction for FMA, perhaps as defined by IEEE-754 2008? Is FMA3 or FMA4 instruction used? Is there an intrinsic to make sure that a real FMA is used, when the precision is relied upon? The actual implementation varies from platform to platform, but speaking very broadly: If you tell your

itte in arm assembly

放肆的年华 提交于 2019-11-28 21:23:37
What does the following line do in arm assembly: 000031e6 2916 cmp r1, #22 000031e8 bf1a itte ne I get the first line (comparing r1 to 22) but what about the second line (I've never seen the itte command before and googling returned nothing) It is the ARM's IF-THEN-ELSE instruction, which was introduced in the Thumb-2 instruction set. (Based on your specific example above, it would have been helpful if you had shown the next 3 instructions that followed the ITTE instruction, you'll understand why when you're done reading this answer.) This instruction is used for handling small sequences of

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

拈花ヽ惹草 提交于 2019-11-28 16:35:54
问题 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 i686 compatible. Some time ago after installing Ubuntu 6.10 on a MiniItx board with the same processor, I found out that the previous statement is not 100% true. The Ubuntu kernel hanged on startup due to the lack of some specific and optional

Do graphic cards have instruction sets of their own?

时光毁灭记忆、已成空白 提交于 2019-11-28 16:27:05
问题 Do graphic cards have instruction sets of their own? I assume they do, but I have been wondering if it is 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 does OpenGL or DirectX call on the driver layer via the CPU which then sends a GPU instruction down the bus or is it more elaborate. 回答1: Yes they do. AMD does even provide the specification up to the HD4000 series at the moment. Take a look here: http:/

Are ARM instructuons SWI and SVC exactly same thing?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 11:57:41
ARM assembly has SWI and SVC instructions for entering into 'supervisor mode'. What confuses me is, why there are two of them? Here it is said that SVC was formerly SWI. Does it mean that basically they changed the mnemonic? Are they the same thing? Can I use them interchangeably? Does one of them exist before an architecture, and other after? Yes, SWI and SVC are same thing, it is just a name change. Previously, the SVC instruction was called SWI, Software Interrupt. The opcode for SVC (and SWI) is partially user defined (bit 0-23 is user defined and is like a parameter to SVC handler). Bits

How to MOVe 3 bytes (24bits) from memory to a register?

落爺英雄遲暮 提交于 2019-11-28 08:09:43
问题 I can move data items stored in memory, to a general-purpose register of my choosing, using the MOV instruction. MOV r8, [m8] MOV r16, [m16] MOV r32, [m32] MOV r64, [m64] Now, don’t shoot me, but how is the following achieved: MOV r24, [m24] ? (I appreciate the latter is not legal). In my example, I want to move the characters “Pip”, i.e. 0x706950h, to register rax . section .data ; Section containing initialized data 14 DogsName: db "PippaChips" 15 DogsNameLen: equ $-DogsName I first