instructions

Why didn't MIPS designers use the 5 remaining bits in R-format instructions for some other useful things?

江枫思渺然 提交于 2019-12-11 04:26:44
问题 In MIPS the R-format is encoded like this opcode (6) | rs (5) | rt (5) | rd (5) | shamt (5) | funct (6) The shamt field is used only in shift or rotate instructions . In other cases it's always 0. So why couldn't they use it for other more useful things? IMHO it'll be much better to use that field to store the register number that stores the carry/borrow in add or sub instructions . For example addu $Rdest, $Rcarry, $Rsrc1, $Rsrc2 $Rcarry will only be set to 0 or 1 depending on the carry bit.

Why is 'a' the Java bytecode prefix for object references? [closed]

…衆ロ難τιáo~ 提交于 2019-12-10 15:05:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Type-specific Java bytecode instructions have single-character prefixes to specify the type that the instruction relates to. Taken from Wikipedia's entry on Java bytecode In each case, the prefix choice makes sense, consisting of the first letter of the type (except boolean, which doesn't have an instruction

How does one change an instruction with a hex editor?

最后都变了- 提交于 2019-12-10 14:57:52
问题 I am messing around with some reverse engineering, but I don't know how to change a jnz to jz with a hex editor. I understand it will vary between systems but I'm not sure where to look to find this information. I'm working on Mac OS X 64 bit and I disassembled code with IDA Pro. 回答1: If you've found a jz , it will either look like 74 XX or 0F 84 XX XX XX XX . If it's a 74 , change it to 75 . If it's the one with 84 , change it to 85 . This information can be found, among other places, in

Trace of CPU Instruction Reordering

偶尔善良 提交于 2019-12-09 05:04:28
问题 I have studied a few things about instruction re-ordering by processors and Tomasulo's algorithm. In an attempt to understand this topic bit more I want to know if there is ANY way to (get the trace) see the actual dynamic reordering done for a given program? I want to give an input program and see the "out of order instruction execution trace" of my program. I have access to an IBM-P7 machine and an Intel Core2Duo laptop. Also please tell me if there is an easy alternative. 回答1: You have no

Monitoring of the CLFLUSH assembly instruction

谁都会走 提交于 2019-12-08 04:16:33
问题 I am interested in monitoring the CLFLUSH instruction in real-time either system-wide or for a specific process. The platform I am using is on 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux, Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz Currently, I am trying to do that using perf top / perf stat but i am not able to filter on this specific instruction. Any idea would be greatly appreciated. 来源: https://stackoverflow.com/questions/53359764/monitoring-of-the-clflush

Instruction to get the current time on x86

落爺英雄遲暮 提交于 2019-12-08 00:33:21
问题 Is there an x86 instruction to get the current time? Basically... something like a replacement for clock_get_time ... something with the minimum overhead... where I don't really care about getting the time in any specific format... as long as it's a format I can use. Basically I'm doing some work to "Detect how much PHYSICAL REAL LIFE TIME" has gone by... and I want to be able to measure time as frequently as possible! I guess you can imagine i'm doing something like a profiling app... :) I

How does the `test` instruction work?

人走茶凉 提交于 2019-12-07 03:01:20
问题 If we have: test dword ptr [eax], 2000h je label1: Is there any value other than 0 in dword ptr [eax] that would make the jump take place? 回答1: Instruction test works like and instruction, the only difference is that result is not stored back in to the destination operand. So the answer is yes. All binary numbers which not have set the 13th bit on memory address [eax], or all numbers present like b'xxxxxxxx xxxxxxxx xx0xxxxx xxxxxxxx', where x is 0 or 1, there is exactly 2^31 numbers. 来源:

equivalent number of instruction

限于喜欢 提交于 2019-12-06 13:42:16
I've a question (just like me)... but...if I've a choosen algorithm written in C or C++ or whatever code you want...fixed a compiler I can determine the number of instructions but these intructions are different each other: x ADD, y MUL, z MOV, f FADD, t FMUL (F stands for FLOATING)...Is there a methodology or equation or something else that permits to write the number of instructions in number of "Equivalent instruction" to compare different algorith? Is there somebody of you that use this type of metric? is it a rubbish? Thanks Marco Part2: I Know that it dipends on uP and architecture in

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 23:58:01
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 generate shorter machine code by replacing [eax*2] with [eax+eax] . However, NASM also generates [ebp + ebp] for [ebp*2] (i.e. no base register). I suspect [ebp+ebp] references SS segment, and [ebp*2] references DS segment. I asked NASM this question. They think [ebp*2] and [ebp+ebp] are the same, but it doesn't make sense to me. Obviously, [ebp+ebp]

Why doesn't the instruction reorder issue occur on a single CPU core?

倖福魔咒の 提交于 2019-12-03 21:15:34
From this post : Two threads being timesliced on a single CPU core won't run into a reordering problem. A single core always knows about its own reordering and will properly resolve all its own memory accesses. Multiple cores however operate independently in this regard and thus won't really know about each other's reordering. Why can't the instruction reorder issue occur on a single CPU core? This article doesn't explain it. EXAMPLE : The following pictures are picked from Memory Reordering Caught in the Act : Below is recorded: I think the recorded instructions can also cause issue on a