machine-instruction

Difference between an instruction and a micro-op

一曲冷凌霜 提交于 2021-01-20 19:30:51
问题 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 central processing units, micro-operations (also known as a micro-ops or μops) are detailed low-level instructions used in some designs to implement complex machine instructions (sometimes termed macro-instructions in this context) Am I correct in

Dynamic vs Static instruction count

梦想与她 提交于 2020-08-27 07:17:20
问题 What is the difference between dynamic and static instruction count? a. Derive an expression to calculate the user CPU time as a function of following parameters: the dynamic instruction count (N), clock cycle per instruction (CPI) and clock frequency (f) b. Explain the reason for choosing ‘dynamic’ instruction count as a parameter in Question 3a instead of ‘static’ instruction count 回答1: The dynamic instruction count is the actual number of instructions executed by the CPU for a specific

Why can assembly instructions contain multiplications in the “lea” instruction?

会有一股神秘感。 提交于 2020-01-12 04:53:09
问题 I am working on a very low level part of the application in which performance is critical. While investigating the generated assembly, I noticed the following instruction: lea eax,[edx*8+8] I am used to seeing additions when using memory references (e.g. [edx+4]), but this is the first time I see a multiplication. Does this mean that the x86 processor can perform simple multiplications in the lea instruction? Does this multiplication have an impact on the number of cycles needed to execute

Can C++ have code in the global scope?

我与影子孤独终老i 提交于 2020-01-09 05:19:04
问题 Is it legal to have code (which compiles to assembly instructions in the global scope of a C++ source file? Previously, I was under the impression that except for the Ch programming language (an interpreter for C/C++), you cannot have code in the global scope of a C++ program. Code/instructions can only be inside the body of a function [period]! However, I found out that you can call functions before the main function in C++ by assigning them to a global variable! This would involve a call

What does actual machine code look like at various points? [closed]

不打扰是莪最后的温柔 提交于 2019-12-21 04:02:54
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . There seems to be many opinions on what machine code actually is. I've heard some say it's assembly, or binary, or hex. Is it correct to say that machine code is essentially a set of instructions for a particular

How is data, address and Instruction differentiated in Processor/Register/memory?

狂风中的少年 提交于 2019-12-19 04:44:15
问题 In Processor, how are Data, Address and instructions are differentiated? When a program is executed, how is processor differentiate instructions when everything is in 0 s and 1 s and register`s load both data, addresses? 回答1: The processor only does what you tell it to do. As you noted, the processor can't tell the difference between "data" and "code" in memory: it's all just a sequence of bytes. It's what you tell it to do with those bytes that defines how it's treated. When a program is

Processor Instruction Cycle Execution Time

佐手、 提交于 2019-12-18 16:55:56
问题 My guess is that the __no_operation() intrinsic (ARM) instruction should take 1/(168 MHz) to execute, provided that each NOP executes in one clock cycle, which I would like to verify via documentation. Is there a standard location for information regarding the instruction cycle execution time for a processor? I am trying to determine how long an STM32f407IGh6 processor should take to execute a NOP instruction running at 168 MHz. Some processors require multiple oscillations per instruction

ADC instruction in ASM 8086

十年热恋 提交于 2019-12-09 14:54:10
问题 When I use ADC for exmaple: AL = 01 and BL = 02, and CF = 1 when I make this: ADC AL,BL Will AL be 3 or 4 ? (with the CF addition or without?) 回答1: Few things about the 8086 ADC instruction: Syntax: adc dest, src dest: memory or register src: memory, register, or immediate Action: dest = dest + src + CF Clearly the action says the Carry Flag ( CF ) will be included in the addition so the result will be 4 not 3 . 回答2: It is no different than adding in base 10. 99 +11 9+1 is zero carry the 1 9

ADC instruction in ASM 8086

被刻印的时光 ゝ 提交于 2019-12-04 01:48:44
When I use ADC for exmaple: AL = 01 and BL = 02, and CF = 1 when I make this: ADC AL,BL Will AL be 3 or 4 ? (with the CF addition or without?) Few things about the 8086 ADC instruction: Syntax: adc dest, src dest: memory or register src: memory, register, or immediate Action: dest = dest + src + CF Clearly the action says the Carry Flag ( CF ) will be included in the addition so the result will be 4 not 3 . It is no different than adding in base 10. 99 +11 9+1 is zero carry the 1 9+1+carry is 1 carry the 1 The result of the above decimal math is 10 with a carry of 1, or 110 if you want to

What does actual machine code look like at various points? [closed]

狂风中的少年 提交于 2019-12-03 12:36:30
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . There seems to be many opinions on what machine code actually is. I've heard some say it's assembly, or binary, or hex. Is it correct to say that machine code is essentially a set of instructions for a particular processor? If so, I imagine these can be represented in binary or hexadecimal notation, or assembly. But what does the non