Basic Assembly PI 2
Use the HC12 Instruction Table to determine solutions to each of
the following.
A. Write a code segment that uses one instruction to subtract 1
from register X.
B. Write a code segment that loads the value $1234 into register
D.
A) subtract 1 from X register :
mnemonic. Function. Operation
TFR A,X. //Copy x to Accumulator. X--->A
Sub A,#1. // Subtract 1 from Accumulator. A-1--->A
TFR X,A. //Transfer the result to register X. A--->X
B) Load value 1234 into D register
mnemonic. Function. Operation
LDD $1234. // Load value of $1234 into D. D<---$1234
Basic Assembly PI 2 Use the HC12 Instruction Table to determine solutions to each of the...
1. Write a code segment that adds the immediate values $29 and S42, with the final result located in register A. Determine the value of the result. 2. Write a code segment that uses one instruction to add to register B. 3. Write a code segment that uses one instruction to subtract 1 from register X 4. Write a code segment that loads the value $1234 into register D.
1. Write a code segment that adds the immediate values $29 and $42, with the final result located in register A. Determine the value of the result. 2. Write a code segment that uses one instruction to add 1 to register B. 3. Write a code segment that uses one instruction to subtract 1 from register X. 4. Write a code segment that loads the value $1234 into register D. 5. Write a code segment that loads S54 into B,...
2. (25 pts) (a) How one can use a single LC-3 instruction to move the value of R2 into R3? (b) The LC-3 has no subtract instruction. Write an LC-3 code that could perform the following operation: R1 = R2-R3 (c) Using only one LC-3 instruction and without changing the contents of any register, how could one set the condition codes based on the value that resides in RI? (d) Write LC-3 instruction that clears the contents of R2? (e)...
csc
220 assembly
2. Use the following code below as a template and follow the instructions written in the comments Assume I have the following data segment written: data val1 BYTE 10h val2 WORD 8000h val3 DWORD OFFFFh val4 WORD 7FFFh :1. Write an instruction that increments val2. ;2. Write an instruction that subtracts val3 from EAX. ;3. Write instructions that subtract val4 from val2. .code ;Write your instructions here
Write the following code segment in assembly language. The instruction set is shown in table 1.
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...
Use the following tables and the 16-bit instruction table
(table.1) to:
Use the following tables and the 16-bit instruction table (table.1) to: a. Decode the instruction when PC=CD2. b. Show the contents of register AC and the memory after executing the instruction, when the original value of AC=D1B0 c. Decode the instruction when PC=CD3 d. Show the contents of register AC and the memory after execution the instruction, when the original value of AC=D1B0
4. (3 pts. each) Write the hexadecimal representation of each MIPS assembly instruction: (4.1) sub $s3, $t1, $s2 (4.2) bne $t3, $t4, 18 (4.3) sll $s0, $t5, 2 5. (20 pts.) Consider the following C (or java) code: else f=f+2; By storing the value of j in Ss0, write a sequence of MIPS assembly instructions that will execute these lines of code for the following two cases: (5.1) assuming that the values of f, g and h are stored in...
I need help with ARM assembly program :
Using the following code as basic :
1 ) Write a program code that is able to calculate the following
: Result = A + ( B * C ) - D
Place the result as the return value so you can print it
afterwards in the command prompt.
2) This time, use MLA instruction to
reduce the number of instructions in question 1.
Place the result as the return value so...
1) We would like to design a bus system for 32 registers of 16 bits each. How many multiplexers are needed for the design? Select one: 5 16 1 4 32 2) The basic computer can be interrupted while another interrupt is being serviced. Select one: True False 3) If the Opcode bits of an instruction is 111, then the basic computer instruction type is either memory-reference or input-output. Select one: True False 4) The content of AC in the...