- Back to Home »
- Programming »
- INR, INX, DCR, DCX, DAA instruction
11. INR: - The contents of the designated register or memory) are incremented by 1 and the result is stored in the same place. If the operand is a memory location, its location is specified by the contents of the HL registers.
Eg: -INR B( the content of register B is incremented by 1.
INR M( the content of memory location pointed by HL pair in incremented by 1)
12. INX: - Increment register pair by 1.
Eg: INX H (It means the location pointed by the HL pair is incremented by 1)
13.DCR: - The contents of the designated register or memory are M decremented by 1 and the
result is stored in the same place. If the operand is a memory location, its location is specified by the contents of the HL registers.
result is stored in the same place. If the operand is a memory location, its location is specified by the contents of the HL registers.
Eg: - DCR B(content of register B is decremented by 1)
DCR M(the content of memory location pointed by the HL pointer is decremented by 1.)
14. DCX: - decrement the register pair by 1.
Eg: DCX H( it decreases the memory location pointed by HL pair by 1.
15. DAA: - Decimal adjust accumulator.
The contents of the accumulator are changed from a binary value to two 4-bit binary coded decimal (BCD) digits. This is the only instruction that uses the auxiliary flag to perform the binary to BCD conversion, and the
conversion procedure is described below. S, Z, AC, P, CY flags are altered to reflect the results of the operation.
conversion procedure is described below. S, Z, AC, P, CY flags are altered to reflect the results of the operation.
If the value of the low-order 4-bits in the accumulator is greater than 9 or if AC flag is set, the instruction adds 6 to the low-order four bits. If the value of the high-order 4-bits in the accumulator is greater than 9 or if the Carry flag is set, the instruction adds 6 to the high-order four bits.
Register contents is FF if it is incremented then what is the result.
ReplyDeleteregister contains 00 and carry flag is set to 1
Deletebut i have read in INR and DCR inst all flags are changes except carry flag.. i also getting the doubt why carry flag is not changed in INR
DeleteI also have the same doubt.
DeleteWhat is the effect on carry flag??
Carry flag is not set because it is not designed like that. Why do you think one would require carry when increment or decrementing? Carry is used only during addition and subtraction hence is faithfully generated during that operations.
Deleteright abhishek.keep this concept in mind bcz its famous in GATE
DeleteXRA A
ReplyDeleteLXI B,0007H
LOOP: DCX B
JNZ LOOP
How many tyms loop will be executed? If answer is 1. Why so?
This comment has been removed by the author.
DeleteThe program has a very tiny mistake.
DeleteExcept using DCX instruction, the instruction DCR is there. So, If we take DCR B, the loop gets executed only 1 time...
This comment has been removed by the author.
DeleteInfinite times. DCX does not affect the flags. DCR does.
DeleteInfinite times. DCX does not affect the flags. DCR does.
DeleteXRA A means XORing A with A wch gives 00000000 thus making ZERO FLAG as SET.. Thus only 1 Time loop will execute..
DeleteIt will execute one times only Bcoz after XRA A zero flag will be set and as we know DRX,INX and CMA does not affects status of any flag. So zero will remains set and bcoz of ZNZ it will execute one time only.
ReplyDeleteGajab
DeleteWhat type of addressing would INR A be?
ReplyDeleteData Structures
ReplyDeleteSteepest-Ascent Hill Climbing
Forward References | Back-Patching
Transaction State Diagram
Depth Buffer Method / Z-Buffer Method
Algorithm: Single-pass assembler | Intel 8088
Matrix Representation and homogeneous coordinates
Top-Down PDA corresponding to a CFG
DVR B (B=00H) KA result accumulater me kaya aaye ga jaldi please
ReplyDeleteWhy INR R operation does not effect flag register but DCR R operation effects flag register?
ReplyDeleteHow to increment by 2 bytes
ReplyDelete