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
;;;;; Q4: Create a constant called MIN and intialize it to 15%
of MAX (from Q3)
;;;;; in an integer expression constant
;;;;; Q5: Define an array of 20 signed doublewords, use any
array name you like.
;;;;; Initialize:
;;;;; - the 1st element to -250
;;;;; - the 2nd element to the hexadecimal value
A924
;;;;; - the 3rd element to the binary value 10100
;;;;; - the 4th element to MAX (from Q3). Use MAX, not
a number.
;;;;; and leave the rest of the array uninitialized.
;;;;; Q6. Define the string "Output = ", use any variable name you like.
;;;;; Q7. Define a prompt that asks the user for a number.
;;;;; Q8. Write code to store the value of MIN into eax, then
print the value
;;;;; to screen.
;;;;; Use the string you defined in Q6 as the text explanation for
your output.
;;;;; Q9. Write code to prompt the user for a number, using the
prompt string that
;;;;; you defined in Q7.
;;;;; Q10. Write code to read in the user input, which you can
assume is always
;;;;; a positive number. Hint: use the correct library routine for
positive number.
;;;;; Q11. Write code to print "Output = " and then echo to screen the user input.
;;;;; Q12. Write code to print "Output = " and then print the
first element of the
;;;;; array defined in Q5.
;;;;; Q13. Build, run, and debug your code.
;;;;; Your output should be similar to this (without the
commented explanation):
;;;;; Output is 22
; printing
MIN
;;;;; Enter a positive number: 7 ; prompt the user for a
number
;;;;; Output is 7
; echo user input
;;;;; Output is -250
; print first element of
array
;;;;; Press any key to continue . . .
;;;;; Q14. At the end of the source file, without using
semicolons (;), add a comment block
;;;;; to show how bigData appears in memory (should be the same 8
hexadecimal values
;;;;; that you saw in assignment 2),
;;;;; and explain why it looks different than the actual value.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.data
bigData QWORD 0abcdef0123456789h ;
same bigData value as last lab
.code
main PROC
exit
main ENDP
END main
X86 Assembly language lab: TITLE Lab 3: assembly language fundamentals ;;;;; Q1: Don't...
In C only Please! This lab is to write a program that will sort an array of structs. Use the functions.h header file with your program. Create a source file named functions.c with the following: A sorting function named sortArray. It takes an array of MyStruct's and the length of that array. It returns nothing. You can use any of the sorting algorithms, you would like though it is recommended that you use bubble sort, insertion sort, or selection sort...
COMP1410 - Lab Exercises #3 (Due at the end of the lab period or beginning of the next) Start Date: Oct. 1st, 2019 Objectives: Practice dealing with 2D arrays. Create a two dimensional array (e.g. int A2D[M] [N] ;) of size MXN to store integer values. Use #define M 4 and N 3 to start. (Using symbolic constants instead of hard coding the array sizes improves scalability). Create an interactive menu within main() for this program (call it Lab3.c) with...
Lab Topics • The basics of Array object Use the following Coding Guidelines • When declaring a variable, you usually want to initialize it. Remember you cannot initialize a number with a string. Remember variable names are case sensitive. Use tabs or spaces to indent code within blocks (code surrounded by braces). Use white space to make your program more readable. Use comments after the ending brace of classes, methods, and blocks to identify to which block it belongs. Problem...
I need help making this work correctly. I'm trying to do an array but it is drawing from a safeInput class that I am supposed to use from a previous lab. The safeInput class is located at the bottom of this question I'm stuck and it is not printing the output correctly. The three parts I think I am having most trouble with are in Bold below. Thanks in advance. Here are the parameters: Create a netbeans project called ArrayStuff...
Programming Lab 4 (Chapter 4) There is one checkpoint, make sure you call your professor to get checked. 4.1 Write a program that prompts the user for two integers and then prints The sum The difference The product The average The distance (absolute value of the difference) The maximum (the larger of the two) The minimum (the smaller of the two) Hint: The max, min, and absolute value methods are declared in the Math class. Lookup https://docs.oracle.com/javase/8/docs/api/java/lang/Math. html the API...
Please answer using C ++ programming language ONLY! We have only used <stdio.h> if that helps. This is a basic course and the furthest we have gone is BASIC arrays. Write the code for the following problems using arrays. Write what would go in the “int main()” part of the program. For these problems, the entire program and program output is not needed. Just include what goes in the int main() part of the program. 1. Declare an integer array...
Introduction: In this lab, you will write a MIPS program to read in (up to) 50 integer values from the user, store them in an array, print out the amay, one number per line, reverse the elements in the array and finally print out the elements in the just-reversed) array. Feel free to do this lab and all assembly programming labs) in Windows. You must use MARS Getting started: l. In MARS, create a new assembly file with the name...
‘C’ programming language question Write a MENU DRIVEN program to A) Count the number of vowels in the string B) Count the number of consonants in the string C) Convert the string to uppercase D) Convert the string to lowercase E) Display the current string X) Exit the program The program should start with a user prompt to enter a string, and let them type it in. Then the menu would be displayed. User may enter option in small case...
CM245 Lab 4 (Chapter 12) Submit online through D2L Implement solutions using the appropriate concepts from Chapter 12. There is no need for any UML for this lab. Provide your implementation (java source code) and the output for each of the tests. There should be one class for exercises 12.2 and 12.3 and two classes for 12.4. I prefer one output file per programming exercise. For each problem you must handle the exception. 12.2 (InputMismatchException) Write a program that prompts...
Rules to follow are:Declare an array with 1000 elements of type intThen in a loop generate 1000 random numbers and assign one to each element in the arrayThe random numbers should be between 1 and 50do not use rand or srand, use code is providedThen, prompt the user to enter a number, store this number in a local variable, the number should be safety checked using the GetInteger() functionThen, iterate through the array and determine how many times the user's...