Ensamblador - Necesito Ayuda

 
Vista:

Necesito Ayuda

Publicado por Juan Pablo (1 intervención) el 22/12/2010 02:12:04
PROBLEMA 3.2
You are required to write a procedure, CharDist that receives as arguments the address of a string of characters and its length passed through the stack. The procedure will count the number of times alphabetic characters (‘a’ to ‘z’ both upper and lower case) occur. Then, it displays a histogram chart showing characters distribution by displaying N stars for a character that is encountered N times. The procedure should preserve all used registers. Write a program to call this procedure to display character distribution of any string entered by the user. A sample execution of the program is given below.

Enter a string of characters: I like assignment#2!!

Character Distribution:
A *
E * *
G *
I * * *
K *
L *
M *
N * *
S * *
T *


PROBLEMA 3.3
Write a procedure, SelectionSort, to sort an array of integers (i.e. 32-bit signed numbers) in an ascending order. The number of integers to be sorted and the address of the array to be sorted are assumed to be passed on the stack. The procedure should maintain the content of all registers to their state before its execution.

The pseudocode for the SelectionSort procedure is given below:

SelectionSort (Array, Size)
for (position= 0 to Size-2)
MinValue = Array[position]
MinPosition = position
for (j=position+1 to Size-1)
if (Array[j] < MinValue) then
MinValue = Array[j]
MinPosition = j
end if
end for
if (position ≠ MinPosition) then
Array[MinPosition] = Array[Position]
Array[Position] = MinValue
end if
end for
end SelectionSort
Write a complete program, showing the place of procedure definition, to use the procedure SelectionSort to sort the Array given below:

Array DD 10, 2, 0, 15, 25, 30, 7, 22

Note that the Content of Array after sorting will be:
Array DD 0, 2, 7, 10, 15, 22, 25, 30

The solution should be well organized and your program should be well documented. Submit a soft copy of your solution in a zip file. The soft copy should include a Readme file indicating the file names containing the solution and whether it works or not. The Readme file should also contain your name and ID.




PROBLEMA 3.4
Write an assembly program that does the following:
(i) Prompts the user to enter a number, n, between 1 and 9.
(ii) Reads an array of n names and scores such that the maximum name length is 25 characters. Scores are given as two-digit scores. A single character separates a score from a name. Each element of the array is entered in a new line. It is required that you store both names and scores in a two-dimensional array called Array.
(iii) Computes the average of the scores and prints it truncating the result to the first fraction.
(iv) Prints the entered array of names and scores in reverse order.

A sample execution of the program is shown below:

Enter a number (1-9): 3
Enter the array of names and scores:
Ali Naser 15
Salem Ahmed 10
Khaled Fahd 25

The average of scores is: 16.6
The array of names and scores in reverse order is:
Khaled Fahd 25
Salem Ahmed 10
Ali Naser 15

The solution should be well organized and your program should be well documented. Submit a soft copy of your solution in a zip file. The soft copy should include a Readme file indicating the file names containing the solution and whether it works or not. The Readme file should also contain your name and ID.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Necesito Ayuda

Publicado por Sebas (4 intervenciones) el 11/02/2011 23:00:01
Buscás a alguien que te haga todo lo que te pidieron que hagas?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar