Question: use only int 21h Write the assembly codes that work as shown below: 5 ↲ 543210
Please find the code below:
.model small
.stack 100h
.data
.code
main proc
mov ah,1 ; get input
int 21h
mov bl,al ;move value to dl
mov dx,10 ;print \n
mov ah,2
int 21h
mov dx,13 ; cursor at first position
mov ah,2
int 21h
mov al,bl
mov dl,al
sub al,48 ;convert character to number
add al,1
mov cl,al
mov ch,0
loopHere:
mov ah,2
int 21h
sub dl,1
loop loopHere
mov ah,4ch
int 21h
main endp
end main
output:

Question: use only int 21h Write the assembly codes that work as shown below: 5 ↲...
1 . Generate Assembly Codes for the two C programs
below
a. Compare the assembly codes generated
b. For code B , analyze and explain how the function
call “print_hello()” was materialized inside the computer
(compiler, OS and the hardware) for the code B. Use figures and
text descriptions if necessary
A)
B)
#include <stdio.h void print hello0; int main(int argc, char *argv[]) print hello0; return 0; void print hello(){ printf("Hello, worldln');
Please write an assembly language for: int a = 15; int b =5; if ((a>=5 && a<=15) || (b>=2 && b<=14)){ a =a+4; b = b-2; } else{ a = a-2; b=b-5; }
in assembly language only, x86
Calling a procedure Write a procedure with the signature: long isdigit(int d) the returns the value 1 if d is a digit (0-9) or 0 otherwise.
I have a below codes with all details and need to answer this below question ONLY! How to explain below codes with the two properties of a Greedy algorithm - Optimal Substructure and the Greedy Property line by line? ====================== public class TeamFormation { private static ArrayList buildTeam(ArrayList team, int skill) { ArrayList newTeam = new ArrayList(); newTeam.add(skill); for (int player : team) { if (skill == (player + 1)) { newTeam.add(player); } } return newTeam; } private static boolean...
avr
assembly please
3) Write an assembly program that is algorithmically equivalent to the following C++ code. Treat the variable y as a short int (16 bits) 1 int y; 2 for (int x = 2; x <= 20; x = x + 2) { 3 ¡f (x < 18) { 4 5 у 24 6 else f 7 8 9
3) Write an assembly program that is algorithmically equivalent to the following C++ code. Treat the variable y as...
Java questions Part 1 Express the code fragment shown below using only a for loop. int n = 0; while (n <= 100) { int sum = sum + n; n = n + 1; System.out.println (sum); } Part 2 Use a loop structure to determine and print all positive integers between 1 and 100 that are divisible (evenly) by 5 and 8
Write the output of the two codes below, unless there is a compiler error or a runtime error. In those cases, write CE or RE, respectively, and explain why those errors occur. If the code produces an infinite loop, write “LE: infinite loop”. public class ForLoopsDemo{ public static void main(String[] args){ int x = 4; fint x = 4; for( int i = 0; i < x; i++ ){ } } for( int j = 0; j < 2*i+1; j++)}...
Please solve this question clearly and step by step.
Thank you
2. A truss assembly shown in Figure Q2 below is made of aluminum alloy that has a modulus of elasticity, E = 69 GPa. member is 225 mm2 The cross sectional area of each 4300 N (0, 40) m (40, 40) m 2 500 N 3 (0, 0) FIGURE Q2 Determine the global stiffness matrix for the truss assembly. a. [10 marks] Determine the displacement at node 3. b....
In this assignment, try to understand the assembly code instructions addv1.sim1. In #addv1.sim1 using only one acc register, addition of two numbers have been done. For the assignment, you need to write assembly code, whose corresponding c code is as followings. int a = 0; int b = 5; int c = 10; a = (b*2)^c + c; exit(0); Only operations that are allowed is to use add, load, store, shift, and xor. addv1.sim1(txt file) #addv1.sim1 Add contents twice 005,...
please write this in "MARIE assembly language" #include <iostream> using namespace std; int DivideByTwo(int, int); // Data section int Data[] = { 0x0102, 0x0105, 0x0106, 0x0108, 0x011A, 0x0120, 0x0225, 0x0230, 0x0231, 0x0238, 0x0339, 0x0350, 0x0459, 0x055F, 0x066A, 0x0790, 0x08AB, 0x09AF, 0x0AB9, 0x0BBD, 0x0CC1, 0x0DCA, 0x0EFE, 0x0FFE }; int main() { int* BAddr = &Data[0]; int* EAddr = &Data[23]; int Count = 24; // the number of Data int Ffff = 0xffff; // value for "not found" int num; // input...