Question

04. Find the CY. AC, and P flags as well as the content of A register after each ADD instruction for the following 8051 code. MOV A, #0 MOV R5, #25H ADD A, R5 MOV R7,#34H ADD A, R7 ADD A,#12H
0 0
Add a comment Improve this question Transcribed image text
Answer #1

After first ADD instruction, A = 25 + 0 so, A = 25

CY = 0

AC = 0

P = 1

After second ADD instruction 34 +25

D7 D6 D5 D4 D3 D3 D1 D0

0 0 1 1 0 1 0 0

0 0 1 0 0 1 0 1

0 1 0 1 1 0 0 1 = A

CY = 0 as no carry from D7 bit

AC = 0 as no carry from D3 to D4

P = 0 as no. of 1 in accumulator is even

After 3rd add instrcution

CY = 0

AC = 0

P = 1

Add a comment
Know the answer?
Add Answer to:
04. Find the CY. AC, and P flags as well as the content of A register...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Examine the following code and answer the following: 10. Register contents after execution of each instruction Machine code using hand assembly EDSIM51 Simulation a. b. c. istart (origin) at 0 ;l...

    Examine the following code and answer the following: 10. Register contents after execution of each instruction Machine code using hand assembly EDSIM51 Simulation a. b. c. istart (origin) at 0 ;load 25H into R5 iload 34H into R7 ;load 0 into A ;add contents of R5 to A now A-A+R5 ; add contents of R7 to A inow A A+R7 ;add to A value 12H ORG OH MOV R5,#25H MOV R7 , #34H MOV A, #0 ADD A, R5 ADD...

  • Anyone explain to (i), (ii) How can we get the instruction words and R8=?[hex]? (i) instruction...

    Anyone explain to (i), (ii) How can we get the instruction words and R8=?[hex]? (i) instruction words[hex] is 0x4508, and R8= 0xF002 How can I get that? (ii) instruction words[hex] is 0x4548 and R8=0x0002 How can I get that? Consider the following instructions given in the table below. For each instruction determine its length (in words), the instruction words (in hexadecimal), source operand addressing mode, and the content of register R7 after execution of each instruction. Fill in the empty...

  • Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at...

    Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...

  • Problem 5 (15pts): Describe what the following program is doing (Do not need to explain each line of instruction....

    Problem 5 (15pts): Describe what the following program is doing (Do not need to explain each line of instruction. Just show me the purpose of this code). .equ LEDS, Ox100000 10 # define LEDS Ox10000010 .text global start #base address of LEDS on DEO-Nano start: movia r2, LEDS movi r3, 0b00000001 movi r4, OX7FFF slli r4, r4, 3 add r4, r4, r4 load: movi r5, 0b10000000 loop: stw rs, o(r2) mov r6, ro count: addi r6, r6, 1 bne r6,...

  • Compute the correct CPU computations and actions. Write the final updated values for each memory, register...

    Compute the correct CPU computations and actions. Write the final updated values for each memory, register and flags after the given instruction executes in the space provided. There are multiple parts of this problem. Endianness: Check for endianness in case of loads and stores, in each part of the question. If the question does not specify the endianness, you can assume little-endian. MOVT R3, #OxBD34 Orig. Updated Data Updated Data R6 Memory Address Ox84F0 0x84F1 0x8452 Ox84F3 Ox8454 Ox84F5 Ox84F6...

  • Consider a VEX-executing VLIW machine with the following characteristics: The machine supports 4 slots (4-wide machine)...

    Consider a VEX-executing VLIW machine with the following characteristics: The machine supports 4 slots (4-wide machine) with the following resources: 2 memory units each with a load latency of 3 cycles 2 integer-add/sub functional units with a latency of 2 cycle 1 integer-multiply functional unit with a latency of 4 cycles Each functional unit in the machine is pipelined and can be issued a new operation at each cycle. However, the results of an operation are only available after the...

  • ARM assembly language Write the final updated values for each memory and register after the given...

    ARM assembly language Write the final updated values for each memory and register after the given instruction executes in the space provided.There are multiple parts of this problem. Note Only write the change values if the values didn't change. Leave the updated cell blank. please explain (as simple as possible ) whats going on after the given command is executed . Q.5.4 Bring to class LSL R6, R6, #3 Updated Data Updated Data Memory Address Ox84F0 Ox 841 Ox84F2 Ox843...

  • Assembly code time

    Consider the following assembly language code:I0: add $R4,$R1,$R0                             //ADD R4 = R1 + R0;I1: lw $R1,100($R3)                             //LDW R1 = MEM[R3 + 100];I2: lw $R9,4,($R1)                                // LDW R9 = MEM[R1 + 4];I3: add $R3,$R4,$R9                             //ADD R3 = R4 + R9;I4: lw $R1,0($R3)                                 //LDW R1 = MEM[R3 + 0];I5: sub $R3,$R1,$R4                             //SUB R3 = R1 - R4;I6: and $R9,$R9,$R7                             //AND R9 = R9 & R7;I7: sw $R2,100($R4)                             //STW MEM[R4 + 100] = R2;I8: and $R4,$R2,$R1                             //AND R4 = R2 & R1;I9: add...

  • Instruction set architecture R: register X, Y, Opl, Op2: Operand Quantity: constant value EA: Effective memory address Opcode Operation Name MOV X, Y XCH Opl, Op2 ADD X, Y SUB X,Y SAL Op, Quantity...

    Instruction set architecture R: register X, Y, Opl, Op2: Operand Quantity: constant value EA: Effective memory address Opcode Operation Name MOV X, Y XCH Opl, Op2 ADD X, Y SUB X,Y SAL Op, Quantity SAR Op, Quantity Shift Arithmetic Right on Op for Quantity SHR Op Quanti AND X, Y OR X, Y XOR X, Y NOT X LOADR, A LOAD R, (A STORE R, A STORE R, (A Description Move data from Y to X Exchange Op1 with Op2...

  • Write the following program in Java using Eclipse. A cash register is used in retail stores...

    Write the following program in Java using Eclipse. A cash register is used in retail stores to help clerks enter a number of items and calculate their subtotal and total. It usually prints a receipt with all the items in some format. Design a Receipt class and Item class. In general, one receipt can contain multiple items. Here is what you should have in the Receipt class: numberOfItems: this variable will keep track of the number of items added to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT