Q2 (a)
After LDA #$A1
# indicates immediate transfer
$ indicates data i.e A1 is in hexadecimal
In this step, hexadecimal A1i.e 161 in decimal is loaded in A
A=A1, B = NA, N=0, Z=0, C=0,V=0
After STAA $1000
In this step, value stored in A i.e A1 is stored at location 1000
A=A1, B = NA, N=0, Z=0, C=0,V=0
After INCA
In this step, value stored in A is incremented by 1
A=A2, B = NA, N=0, Z=0, C=0,V=0
After LDAB #$1000
In this step, hexadecimal 1000 i.e 4096 in decimal is loaded in B
A=A2, B = 1000, N=0, Z=0, C=0,V=0
After DECB
In this step, value stored in B is incremented by 1
A=A2, B = 1001, N=0, Z=0, C=0,V=0
After ABA
In this step, value of A and B registers are added and the result is stored in A
A=10A3, B = 1001, N=0, Z=0, C=0,V=0
After STAA $111111
In this step, value stored in A i.e 10A3 is stored at location 111111
A=10A3, B = 1001, N=0, Z=0, C=0,V=0
Q2(b)
answers can be easily verified by code warriors also
According to HomeworkLib policy, we are only supposed to answer one question per window
DO 2 AND 3. Question #1 Convert the following assembly program into machine code. LDAA WSA1 STAA $1000 INCA LDAB $10...
Question #1 Convert the following assembly program into machine code. LDAA #$A ! STAA $1000 INCA LDAB $1000 DECB ABA Here: Bra Here Question # 2 (a) In Question # 1 , determine the values of PC, A, B, N, Z, V, C after each instruction (b) Verify your answers by using Code Warrior pleaseanswernumberz Question #1 Convert the following assembly program into machine code. LDAA #$A ! STAA $1000 INCA LDAB $1000 DECB ABA Here: Bra Here Question #...
Can anybody briefly explain what this assembly program does? Question 2.1) Consider the following program: [3 marks] ORG $7000 dc.b $11,$22,$33,$44,$55,$66,$77 LDS #$ 1000 LDX #$ 7000 LDAB #$7 LOOP1: LDAA 0,X PSHA INX DECB BNE LOOP1 LDX #$ 7000 LDAB #$7 LOOP2: PULA STAA 0,X INX DECB BNE LOOP2 WAI
HCS12 Question 1: Fill the blank cells below. Assume that X=$1000. (20 marks) Addressing mode Effective address [A] Instruction LDAA 2,X+ LDAB #SA ABA STAA 4,X LDAA (1,FFD] 00 10 01 C1 18 Address FFD FFE FFF 1000 1001 1002 1003 1004 1005 1006 38 Memory content DF EE 01 4C
Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. include "p24Hxxxx.inc" global__reset bss: Uninitialized data section: Variables start at location 0x0800 x: .space 2: Allocating space (two bytes) to variable. y: .space 2;Allocating space (two bytes) to...
Question 3 (10 points) Convert the following MIPS assembly code into machine language. Write the instruction in hexadecimal. The opcode for sw 43 (101011). sw St1, -4(St3) Question 4 (10 points) Consider the following MIPS assembly code: addi $s3, $0, 5 addi $s1, S0, 3 addi Ss1, $s1, 2 beq Ss3, Ssl, target addi Ss1, Ss1, 1 target: add Ss3, Ss1, Ssl a. After running the code, what is the value of Ss3? b. If the memory address of the...