Why do we need to know the registers and the flags in any co

Why do we need to know the registers and the flags in any computer architecture in order to write assembly language programs?

Solution

When write he pograms in high level languages lik c,c++,java,PHP ,python we have variables to perform the different operations but when we use assembly language to write program we do not have variables to perform operations at this time we have ragisters to perform operations.so we can use many number of resgister and perform operation on those registers.Like we you are using the 16 bits mode then you will be having the registers from 0 to 65535.. the most common type of register in 8086 based architecture.

1)General-purpose registers

2) Source and destination data index registers.

3)The Stack Pointer

4)The Instruction/Code Pointer so we can use these register to store number or bit as we store in variables.

still we use resgisters for many purpose because these are the fastest memory .

similarly we have different statement which direct the control of excution based on certain condition like if-else,goto,label,while,return,exit in high level lanuages but in assembly lanuage we have flags to do same task under certain circumtances.These flags control the execution of program the following are the popular flags in assembly language.

OF (Overflow) flag

CF (Carry)

Carry out of (borrow into) high-order bit.

SF (Sign) flag

High-order bit of result.

ZF (Zero) flag

0 -- otherwise

These above were the most important reson that we need to study the falgs and register in order to write the assembly language program.

1 -- result is outside signed-number range
0 -- otherwise
 Why do we need to know the registers and the flags in any computer architecture in order to write assembly language programs?SolutionWhen write he pograms in h

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site