Please use X86 Assembly Language, Irvine32
Declare a double word array of size 10 and initialize it with some numbers. Find the
number of even numbers and the number of odd numbers in this array and save them in
locations called oddCount and evenCount.
ANSWER:
ASSEMBLY LANGUAGE:
DATA SEGMENT A DW 1,2,3,4,5,6,7,8,9,10 oddCount DW ? evenCount DW ? DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX LEA SI,A MOV DX,0000 MOV BL,02 MOV CL,10 L1:MOV AX,WORD PTR[SI] DIV BL CMP AH,00 JNZ L2 INC evenCount JMP L3 L2:INC oddCount L3: ADD SI,2 DEC CL CMP CL,00 JNZ L1 MOV AH,4CH INT 21H CODE ENDS END START
Answer:
DATA SEGMENT
A DW 1,2,3,4,5,6,7,8,9,10
oddCount DW ?
evenCount DW ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,A
MOV DX,0000
MOV BL,02
MOV CL,10
L1:MOV AX,WORD PTR[SI]
DIV BL
CMP AH,00
JNZ L2
INC evenCount
JMP L3
L2:INC oddCount
L3:
ADD SI,2
DEC CL
CMP CL,00
JNZ L1
MOV AH,4CH
INT 21H
CODE ENDS
END START
PLEASE GIVE POSITIVE RATINGS.THANKYOU..!!
Please use X86 Assembly Language, Irvine32 Declare a double word array of size 10 and initialize...
[In x86 Assembly Language] Declare a double word array of size 10 and initialize it with some numbers. Find the number of even numbers and the number of odd numbers in this array and save them in locations called oddCount and evenCount.
In C language 1. Write a program to declare and initialize an array of size 5 and place odd numbers 3, 5, 7,9 and 11 in it. Declare and initialize another array of size 5 and place even numbers 4, 6, 8, 10 and 12 in it. Write a for loop to add each element and place it in a third array of the same dimensions. Display each array.
[Please write in x86 Assembly Language and attach a screenshot of the result from VS] Thank you!!! Write a program to add the numbers of a word array of size 10 and store the result in a variable called total. Use a loop in this program.
computer organization Write this code using x86 assembly language using the irvine32 library 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts ) 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts )
Declare an array that contains the numbers: 1,2,3,4 (byte size). Use BX to point to the first array element initially. Subtract the second array element from the first, and store the result in the fourth element. Use the INC and DEC commands to change the array element that is pointed to. ANY assembly language.
X86 Assembly language lab: TITLE Lab 3: assembly language fundamentals ;;;;; Q1: Don't forget to document your program ; Name:Yuyan Wang ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; Answer each question below by writing code at the APPROPRIATE places in the file. ;;;;; Hint: the appropriate place is not always right below the question. ;;;;; Q2: Write the directive to bring in the IO library ;;;;; Q3: Create a constant called MAX and initialize it to 150...
MASM Assembly Language for x86 Processors: Given the following array declaration: .data matrix DWORD 50 DUP(10 DUP(?)) If matrix[0][0] is the 0th sequentially stored BYTE in memory, which sequentially stored BYTE is the first byte corresponding to matrix[14][2]? (in decimal) Please expplain how you got the answer, so I can answer other questions like this! Thank you
Can some help me with my code I'm not sure why its not working. Thanks In this exercise, you are to modify the Classify Numbers programming example in this chapter. As written, the program inputs the data from the standard input device (keyboard) and outputs the results on the standard output device (screen). The program can process only 20 numbers. Rewrite the program to incorporate the following requirements: a. Data to the program is input from a file of an...
IN C++ Please!! Declare a global integer constant called SIZE and initialize it to 10. • Declare a global enum variable that will support 10 values – each representing an ant colony {A, B, C, D, E, F, G, H, I, J}. • In the main function, o Declare a 2-dimensional array of size the global integer constant, SIZE. The number of rows and columns should be equal to SIZE, which would make this a square matrix. This array will...
For c++ Write a complete C++ program and declare 2 arrays type double size 5. The name of the first array is Salary and the name of the second array is Tax. Use a for loop loop and enter 5 salaries type double into array Salary. Then multiply each element of array Salary by .10 (10 percent), and save the result into array Tax. Print/display the content of both arrays. Hint: the content of array Tax is 10% percent of...