Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3) Given the following sequence of code. Determine the values of the SP and registers specified after each instruction is executed. SP R16 R24 R25
3) Given the following sequence of code. Determine the values of the SP and registers specified after each instruction is executed. SP R16 R24 R25 R26 R27 .ORGO LDI R16, HIGH(RAMEND) OUT SPH, R16 LDI R16, LOW(RAMEND) OUT SPL, R16 LDI R24, Ox10 LDI R25, 0x48 LDI R26, Ox30 LDI R27, 0x09 PUSH R26 PUSH R24 PUSH R27 POP R24 POP R26 POP R25 4) Given the following assembly language instruction sequence and machine codes for the instructions. In the table below, fill in the starting memory location and machine code for each instruction. Show the calculations for the jump instruction to determine the branch addresses as given by the determined machine code values. See Example 3-7. Starting Code Memory Location for Instruction Assembly Language Program Instruction Machine Code (see below for different instructions) $00000 LDI R21, 0x40 LDI R30,2 ADD R21,R30 BRNE AGAIN AGAIN: STS K, Rr Store register Rr in memory location k 1001001rrrrr0000 kkkkkkkk kkkkkkkk O branch if C = 0 1111 10 1 K6 K5 K4 K3 K2 K1 KO 0 0 1 K6 K5 K4 K3 K2 K1 K0 =>-64 to +63 (2s complement range) offset with respect to the current PC 5) Write an assembly language program for the ATmega32 to compute the sum of Ox3C, 0x57, OxA6. Store the result in registers R30 (low byte) and R31 (high byte). See example 3-5 6) Show the status of the C, H, V, S, and Z flags from SREG for the following program segment. LDI R16, 0x87 LDI R20, 0x9D SUB R16, R20 3) Given the following sequence of code. Determine the values of the SP and registers specified after each instruction is executed. SP R16 R24 R25 R26 R27 .ORGO LDI R16, HIGH(RAMEND) OUT SPH, R16 LDI R16, LOW(RAMEND) OUT SPL, R16 LDI R24, Ox10 LDI R25, 0x48 LDI R26, Ox30 LDI R27, 0x09 PUSH R26 PUSH R24 PUSH R27 POP R24 POP R26 POP R25 4) Given the following assembly language instruction sequence and machine codes for the instructions. In the table below, fill in the starting memory location and machine code for each instruction. Show the calculations for the jump instruction to determine the branch addresses as given by the determined machine code values. See Example 3-7. Starting Code Memory Location for Instruction Assembly Language Program Instruction Machine Code (see below for different instructions) $00000 LDI R21, 0x40 LDI R30,2 ADD R21,R30 BRNE AGAIN AGAIN: STS K, Rr Store register Rr in memory location k 1001001rrrrr0000 kkkkkkkk kkkkkkkk O branch if C = 0 1111 10 1 K6 K5 K4 K3 K2 K1 KO 0 0 1 K6 K5 K4 K3 K2 K1 K0 =>-64 to +63 (2s complement range) offset with respect to the current PC 5) Write an assembly language program for the ATmega32 to compute the sum of Ox3C, 0x57, OxA6. Store the result in registers R30 (low byte) and R31 (high byte). See example 3-5 6) Show the status of the C, H, V, S, and Z flags from SREG for the following program segment. LDI R16, 0x87 LDI R20, 0x9D SUB R16, R20
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started