# What is the difference between instruction and operation?

hiya

Can you help me with the following questions?

1) My book says that instruction is not the same as operation, even though the two are very similar. What is the difference between the two?

2) In the old CPUs when one would store a value into the accumulator register, this value would be automatically added to the value previously stored in accumulator. Thus if accumulator has value 16 stored in it, and if we then try to store value 20 in accumulator, then the two values 16 and 20 will be added and their sum 36 will be stored in accumulator. Is that still true with modern CPUs? If not, then what is todays function of accumulator register? Just to store data?

3) We can access more than one successive byte in main memory. Is something similar also possible with registers? Meaning if register is 32 bit, can we also access just one of the bytes in this register or will CPE read all 4 bytes even if we are only interested in 1 byte?

• : hiya
:
: Can you help me with the following questions?
:
: 1) My book says that instruction is not the same as operation, even though the two are very similar. What is the difference between the two?
:
[blue]
I would probably define "operation" as a list of instructions to
[/blue]
:
: 2) In the old CPUs when one would store a value into the accumulator register, this value would be automatically added to the value previously stored in accumulator. Thus if accumulator has value 16 stored in it, and if we then try to store value 20 in accumulator, then the two values 16 and 20 will be added and their sum 36 will be stored in accumulator. Is that still true with modern CPUs? If not, then what is todays function of accumulator register? Just to store data?
:
[blue]
Not true in todays CPUs. I simple mov instruction places the value
(doesnt add it) into the accu register (AX)

Some math operations use AX to store data.
[/blue]
:
: 3) We can access more than one successive byte in main memory. Is something similar also possible with registers? Meaning if register is 32 bit, can we also access just one of the bytes in this register or will CPE read all 4 bytes even if we are only interested in 1 byte?
:
[blue]
Some registers allow it. For example, AX is a 16 bit register.
AH and AL represent the 8bit high and low bytes of AX. EAX is
a 32bit register, and is composed of AX (the low word of EAX)
[/blue]
:
:

• : hiya
:
: Can you help me with the following questions?
:
: 1) My book says that instruction is not the same as operation, even though the two are very similar. What is the difference between the two?
[green]
"operation" in what context? Are we talking about something you do to something like memory or an opcode? The websters dictionary version says this if that is what you are looking for:

"a single step performed by a computer in the execution of a program"
[/green]

: 2) In the old CPUs when one would store a value into the accumulator register, this value would be automatically added to the value previously stored in accumulator. Thus if accumulator has value 16 stored in it, and if we then try to store value 20 in accumulator, then the two values 16 and 20 will be added and their sum 36 will be stored in accumulator. Is that still true with modern CPUs? If not, then what
is todays function of accumulator register? Just to store data?

[green]
Well, since this is an x86 board, the answer is no. Add and Sub take two operands in the IA32 instruction set. However, mul and div instructions are one operand. The accumulator is just that, it accumulates data.
[/green]

: 3) We can access more than one successive byte in main memory. Is something similar also possible with registers? Meaning if register is 32 bit, can we also access just one of the bytes in this register or will CPE read all 4 bytes even if we are only interested in 1 byte?

[green]
Well why stop at a byte? Why not a bit. You can access any bit, nybble, byte, word, or dword by using the bitwise instruction like AND, OR, XOR, ect.. Being the programmer, it is YOU that determines how code and data is to be used. The CPU could care less. It only does what it is told. It doesn't know if a number is going to be used as a negative or positive.
[/green]

[green]
All of this book stuff is good to a point but it really doesn't do any good if you don't act upon it. Who cares what the difference between and operation and instruction is. Is knowing that really going to help you get started? Hands on is the only way you are really going to learn, trust me.
[/green]

:

• [b][red]This message was edited by beginner16 at 2007-2-28 15:18:13[/red][/b][hr]
[blue]All of this book stuff is good to a point but it really doesn't do any good if you don't act upon it. Who cares what the difference between and operation and instruction is. Is knowing that really going to help you get started? Hands on is the only way you are really going to learn, trust me. [/blue]

I dropped out of highschool few years ago and now I decided to finish it, so now I'm learning stuf at home and then take exam for particular subject. The stuuf I'm asking is theory and will probably be asked on the test.

thank you both for your kind help