this is assembly language for HCS12 / 9S12
Solution:
Given, [A] = $60; [B] = $80; [$C300] = $20; [$C301] = $40.
ADDA $C300 ; A [A]+[$C300]
i.e. $60 + $20 = $80 will store in A. Now the value [A] = $80.
LDAB $C301; B = [$C301] i.e. $40 will load in [B]. Now the value of [B] = $40.
SBA ; A [A] - [B]
i.e. $80 - $40 = $40 will store in [A]. Now [A] = $40.
BEQ X1 ; In the above subtraction instruction [A] > [B]. So, it will not jump to X1 loop and proceed to next line.
STAA $C301 ; [$C301] [A] i.e. $40
will store in memory location [$C301].
X1 : STAB $C300 ; [$C300] [B] i.e.
$40 will store in memory location [$C300].
WAI.
After execution of the above program, [A] = $40; [B] = $40; [$C300] = $40; [$C301] = $40.
If you have any query, please send a comment. Thank you.
this is assembly language for HCS12 / 9S12 4. Consider the following assembly-language program. Starting values:...
please help
4. Consider the following assembly-language program. Starting values: [A] - $60, [B]- $80, [SC300] $10, [SC301] $40 (Hint: [SC300] means "contents of memory location $C300".) ADDA LDAB SBA BEQ STAA $C300 $c301 x1 $C301 $C300 X1 STAB WAI WAI" basically means "stop What values are in A, B, memory location $ program finishes? C300, and memory location $C301 when the A]-IB] [SC300] [SC301]-
DO 2 AND 3.
Question #1 Convert the following assembly program into machine code. LDAA WSA1 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 CodeWarrior Question # 3 Assume that the program in Question 1 is saved in memory starting at location $COOA. Drawa memory diagram showing the contents (in...
Construct a program using assembly language to perform the addition of two values - the first value; 4AH stored in register B and the second value; 36H stored in register D. The result of the addition is then stored in memory location 0x2020. Include comments to each instruction line of the program.
Assume the memory display of the HCS12 shows 16 bytes starting at S0800 as follows SOBO0 80 53 05 28 36 89 00 FF FE 80 91 3E 77 AB 8F 7F Cavt the results of the following instructions SP S0805 pula A ?, SP SP S08OAL pula pshb A 7, SP -? SP S0805 pula A ? pulb B Idaa $O803 Idab $0804 aba A 7,8- SP $0805 psha pshb SP 7 Idx S0800 idab $0807 leax B.X X...
Question: WRITE A PROGRAM IN LC-3 ASSEMBLY LANGUAGE. DO NOT ... WRITE A PROGRAM IN LC-3 ASSEMBLY LANGUAGE. DO NOT USE PYTHON, JAVA, C or C++ or OTHERS. Your task is to write a program that counts the number of 1 bits of the value stored at location given by Datal. Your program should print the count (in hexadecimal, as it is easier) along with an appropriate heading. Test your program with the following values stored in Datal: a xFFFE...
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...
Complete the following Intel assembly language program which determines whether the byte sized operand stored in memory location 'number' is prime or not. The program will write the value of 0 into the memory location 'answer' if the number is not prime, otherwise the initial value of '1' will be left unmodified (indicating that the number is prime). The program makes use of the DIV instruction to determine the value of quotient and remainder when dividing the number by 2,3,4,......
2) Write an assembly program that is algorithmically equivalent to the following C+t code Consider the variables to be 8-bit unsigned integers; you may initialize them to any values 0-255 if you like for testing purposes 13 int speed, lower, a, b; 14 15 if (speed < 98) { 16 17 if (speed <80) t 18 lower++; 19 20 21 else f 23 24 25 26 else t 27 28
2) Write an assembly program that is algorithmically equivalent to...