(a) :-
cmp ecx,[value] ;; compare value with ecx (if count>value) jle endif mov ecx,0 ;; make count (ecx) 0 endif:
(b) :-
push ecx mov ecx,[a] add ecx,[b] ;; add a with b to compare (a+b) cmp ecx,[c] ;; check condition (a+b == c) jne else ;; jmp to else if (a+b) not equal to c (a+b != c ) mov al,'Y' ;; move 'Y' in al (check = 'Y') jmp endif else: mov al,'N' ;; move 'N' in al (check = 'N') endif: pop ecx
(c) : -
cmp al,'a' ;; compare al with 'a' jl else ;; jump to label (else) if al < 'a' cmp al,'z' ;; compare al with 'z' jg else ;; jump to label (else) if al > 'z' if: mov ecx,lowerCount inc dword[ecx] ;; increament lowerCount by 1 (add 1 into lowerCount) jmp endif else: cmp al,'A' ;; compare al with 'A' jl else1 ;; jump to label (else1) if al < 'A' cmp al,'Z' ;; compare al with 'Z' jg else1 ;; jump to label (else1) if al > 'Z' innerif: mov ecx,upperCount inc dword[ecx] ;; increament upperCount by 1 (add 1 into upperCount) jmp endif else1: mov ecx,otherCount inc dword[ecx] ;; increament otherCount by 1 (add 1 into otherCount) jmp endif endif:
In assembly code, and if you're writing it out please write neatly so I can be...
1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that does the following: eax = (ecx + edx ) - (eax + ebx) 2. Write a piece of code that copies the number inside al to ch. Example: Assume that Initially eax = 0x15DBCB19. At the end of your code ecx = 0x00001900. Your code must be as efficient as possible. 3. You are given eax = 0x5. Write one line of code in...
I need my c++ code converted to MASM (assembly language). The instructions below: write an assembly program that does the following; 1. count and display the number of words in the user input string. 2. Flip the case of each character from upper to lower or lower to upper. For example if the user types in: "Hello thEre. How aRe yOu?" Your output should be: The number of words in the input string is: 5 The output string is : hELLO...
I need help creating this code. Write an assembly program (MASM and Irvine's libraries) that calculates and prints out the first five Fibonacci numbers FO=0; F1=1; F2=1; F3=F1+F2; F4=F3+F2; F5=F4+F3 If we use 0, 1 and initial conditions the sequence would be: 0, 1, 1, 2, 3 Use the ebx, eax, and ecx registers. Note WriteHex, Writelnt, WriteDec, all use eax So use ebx for first and eax for second and ecx for temporary The calculation could go something like...
Write an assembly language code for the following pseudo code i. if(op1 == op2) x=1; else x=2; using x86 assembly language
C++ problem where should I do overflow part? in this code do not write a new code for me please /////////////////// // this program read two number from the user // and display the sum of the number #include <iostream> #include <string> using namespace std; const int MAX_DIGITS = 10; //10 digits void input_number(char num[MAX_DIGITS]); void output_number(char num[MAX_DIGITS]); void add(char num1[MAX_DIGITS], char num2[MAX_DIGITS], char result[MAX_DIGITS], int &base); int main() { // declare the array = {'0'} char num1[MAX_DIGITS] ={'0'}; char...
01) Write PIC24 assembly language equivalents for the Sollowing C code fragments. Assume variables u16 iul kal6 j.ul6 n are uintl6 variables, while uš p, u8 q, u8 rare uin variables 1. Code fragent 2. Code fragment . Code frapent (use place holders for if-body, else-body) if-body statements else-body statements 4. Code fragent (use place holders for if-body, else-body) if-body statements l else I else-body statenents 5. Code frapent (use place holders for loop-body) &. Code fragent (use place holders...
Write a program in 68K assembly code that adds an odd parity to each ASCII character. Your code must satisfy the following specifications: 1. Define the following 64 characters in the SRC address.SRC:DC.B 'Computing and Software Systems, University of Washington Bothell' 2. Define the 64-byte space.DST:DC.B 64 3. Read each of the 64 characters, (i.e., each byte) into D0, check the number of 1s in it, set 1 to the MSB with "ORI.B #$80, D0" to create an odd parity,...
Please help me with the following C Programming project. I am providing the code I used which needs to be reworked to add the following requirements. Here is my code #include<stdio.h> char input; int main() { int i = 0; while (true){ scanf_s("%c", &input); if (input == 'X') break; printf("%c", input); } return 0; } Here are the requirements for the code plus and additional note what the code should have. Goals Understand the ASCII representation of character values. Understand...
Exercise 1: For each of the following high-level language code snippets, write the SRO assembly code. Assume that the variables A, B, C, X. are in memory locations MA, MB, MC, MX, respectively. a) XA+ 2B- 4C; b) if (A <0) else if (A> 0) else c) for (int i 1; 10; i++) X A+B+C (Hint: Use branch instructions to set up the loop)
05/0172019 Q1: (20) Choose one of these C code fragments and write it in PIC24 assembly form. if (u16 i< u16 k) |I True if((u 16-i <ul6k) && TAR (ul6j_u16_p)11 (16.9 !=0)) { if body Falttau 16-j != 80)) { if body else else else-body else-body f code rest of code s else. 05/0172019 Q1: (20) Choose one of these C code fragments and write it in PIC24 assembly form. if (u16 i