联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> javajava

日期:2018-10-21 09:12

AND STRUCTURE OF C OMPUTADORES

G Rado I NGINEERING NGINEERING NGINEERING NGINEERING NGINEERING NGINEERING I NFORMA

Computer Architecture Group

Practice one

Introduction to assembly language

Course 2018/2019

two

Content

Objectives of the practice .............................................. .................................................. ....... 3

Exercise 1 ................................................ .................................................. ......................... 3

Exercise 2 ................................................ .................................................. ......................... 4

Important aspects to consider ............................................ .................................. 5

General rules ................................................ .................................................. ..................... 5

Codes of practice .............................................. .................................................. .................. 5

.............................................. practice memory .................................................. ............... 6

............................................... test definition .................................................. ........ 7

Delivery procedure ............................................ practice .................................. 8

.............................................. assessment practice .................................................. ..... 9

3

Objectives of the practice

The aim of the practice is to understand the basic concepts related to programming in assembler. To do this,

it will be used as an example the MIPS32 assembler and simulator QtSpim. The practice consists of 2

exercises.

Exercise 1

The objective of this exercise is to develop a program in assembler to locate the number of occurrences of a

word in an alphabet soup represented by a square array of characters. To this end, design and implement the

code in a function named

searchwords which accepts three arguments:

- Argument 1: starting address of the character array, which is stored by rows.

- Plot 2: dimension of the matrix (N). It is considered that the matrix is square.

- Argument 3: direction of the string to be searched.

The function will return a single value, the number of times the string appears in the matrix. Be aware that the

array may include upper and lower case. The search will ignore if they are not case sensitive. The function

must be able to run for any parent, of any size and any search word. They are considered only occurrences

that appear in rows and columns (not diagonal) both from right to left and left to right. For example, the matrix

shown below Chain "Hello"

It appears 5 times (are marked in bold).

HO l TO Konx ag h kkme

EB x OR LC c CDIO LC c CDIO LC c CDIO LC c CDIO LC c CDIO LC c CDIO LC c CDIO L X ALOHA L

to s

IO or K

L BBYUJ XO

Oholah OH i

H J KJTF J c

Consider the matrix only includes letters, both uppercase and lowercase letters, but no numbers and special

characters. The string to search always have at least one letter, ie, never pass an empty string as an

argument.

Both the matrix to be used at all times as the search string should be defined in the data segment. To the

above string will be defined as follows:

. data:

WordSearch: .byte 'H', 'O', 'l', 'A', 'K', 'O', 'N', 'X',

'A', 'g', 'h', 'k', 'k', 'm', 'e', ?'E', 'B', 'x', 'O', 'L', 'C ',' c ',' C ',' D ',' I ',' O ',' L '. 'X',

'A,' L ',' O ',' H ',' A ',' L ',' a ',' s', 'I', 'O', 'u', 'K' , 'L', 'B', 'B', 'Y', 'U', 'J', 'X', 'O',

'O', 'H', 'O', 'L', ' A, 'O', 'H', 'i', 'H', 'J', 'K', 'J', 'T', 'F', 'J', 'c'

Word: .asciiz "Hello"

N: .word 8 # dimension of alphabet soup

4

The text segment of the program to be developed must include the function main, the function

searchwords and all those auxiliary functions deemed necessary for the development of the program. The

function main should only be responsible for calling the function

searchwords searchwords searchwords searchwords searchwords searchwords with corresponding arguments ( with corresponding arguments ( with corresponding arguments ( with corresponding arguments ( with corresponding arguments ( with corresponding arguments ( WordSearch, Word WordSearch, Word WordSearch, Word WordSearch, Word WordSearch, Word WordSearch, Word Y N defined in the data segment) and print defined in the data segment) and print defined in the data segment) and print defined in the data segment) and print defined in the data segment) and print defined in the data segment) and print

only the result returned.

The implementation of the program should produce the following output:

X

Where X is the number of occurrences of the search word. For the above example, the program should print:

5

Exercise 2

The objective of this exercise is to develop an assembly program that processes an array of floating point

numbers in single-precision ( float). For this, a function is developed called ExtractExponents which accepts the

following arguments in the following order:

- Argument 1: Start address matrix floating point numbers (A).

- Plot 2: Number of rows of the matrix (N).

- Argument 3: Number of columns of the matrix (M)

- Argument 4: Start address of an array of integers (B) of dimension NxM,

- Argument 5: integer X.

The function will process all the elements of the matrix A and perform the following functions:

If exponent (A [i, j] <X) then B [i, j] = exponent (A [i, j]) Sino B [i, j] = 99999;

Consider the matrix A will only include standard or non-standard numbers, but never contain NaN, positive

infinity or minus infinity. The number 0 is considered a non-normalized number.

The function will return the number of exponents satisfying the condition to be less than

X. The function must consider the real value of the exponent stored in the number. Note that the exponents

are represented in the IEEE 754 standard excess. Arrays are stored by rows. Thus, for example, to the

number 8.5 ( number 8.5 ( number 8.5 ( number 8.5 ( number 8.5 ( number 8.5 ( number 8.5 ( 10 = 1000.1 ( 1000.1 ( 1000.1 ( 1000.1 ( 1000.1 ( 1000.1 ( 1000.1 ( 2 = 1.0001 3 (2 the exponene to be stored is three. the exponene to be stored is three. the exponene to be stored is three. the exponene to be stored is three. the exponene to be stored is three. the exponene to be stored is three. the exponene to be stored is three.

The two matrices to be used at all times be defined in the data segment. Next, an example of data segment

two matrices A and B representing two 2x3 matrices of dimension numbers is shown float and whole

respectively. the X value (argument 5) is also defined.

5

On

text segment of the program to be developed must include the function main, the function

ExtractExponents and all those auxiliary functions deemed necessary for the development of the program. The

function main should only be responsible for calling the function

ExtractExponents with corresponding motions (A, B, M, N and X defined in data segments) and print only the

result returned. The function developed must operate properly for any matrix any dimension correctly defined

in the data segment.

The result for the information specified above will be:

3, 2, -126

0, -126, 99999

Important things to consider

general rules

one) Delivering practice done through entregadores enabled. Not allowed

delivery via email.

two) Delivery will be made within the period given by the betrayers. It is possible that for a

Global Classroom entregador the deadline for delivery at 24:00 finish 10 minutes earlier. Check the

support Aula Global.

3) Copied special attention to detect functionality between two practices will be provided. In case

finding common implementations in two practices (or the like contained in the memory), both will score 0.

Codes of practice

one) The two exercises performed must use mandatorily functions. To do this

followed agreement parameter passing described class. Those exercises that do not include any

functions besides the main, be graded with 0. Those functions

. data:

A .float 8.3, 4.5, 0,

- 1.2, 0, 40000.57

B: .word 0, 0, 0

0, 0, 0

N: .word 2 M: .word 3

X: .word 10

6

who do not follow correctly the parameter passing convention will also be rated at 0.

two) All exercises should follow the output format requested in each statement.

3) They have to surrender the two years requested.

4) All exercises should follow the output format requested in each statement.

5) Exercises that do not compile or does not fit the functionality and requirements posed,

They will score 0.

6) A program mentioned, get a rating of 0.

Memory Practice

one) Memory (one document) must contain at least the following sections:

or Home where the authors listed (including full name, address and NIA

email).

or Index of contents.

or Contents orders in different exercises (one section per year).

or Conclusions and problems encountered.

two) The length of memory should not exceed 10 pages ( cover and index included).

3) About the possible orders description of the programs:

or It has to detail the main functions implemented. The report must describe

the behavior of programs, as well as major design decisions.

It must include the pseudocode corresponding to each of the exercises in this practice.

or It must include the battery testing (as defined in the following section)

used to validate the functionality of the requested functions and results

obtained. It will be given highest score to advanced testing, extreme cases, and generally those

tests to ensure the proper functioning of the practice in all cases.

or Avoid duplicate tests that evaluate the same program streams. The

score this section is not measured by the number of tests, but the degree of coverage of

them. Better is little evidence evaluating different cases many tests always assess the

same case.

NOTE: DO NOT NEGLECT THE QUALITY OF YOUR PRACTICE REPORT.

Approve memory is so essential to pass the practice as the correct operation thereof. If the memory

evaluated practice, it is considered that does not reach the minimum permitted its practice will be suspended.

7

Definition test

For the definition section and battery testing each of the exercises to be included in the memory the

following format is followed:

Data to be entered: Test description: Expected result: Obtained

result:

For example, for a program manager to determine if a 32-bit integer passed argument is greater than 0, the

various tests that could be performed are shown below:

Data to be entered: Test description: Expected result: Obtained

result:

0 Check if it works on the

limit value 0.

FALSE FALSE

5 Check if it works with any

number greater than

0.

TRUE TRUE

- fifteen Check if it works with any

number less

0.

FALSE FALSE

-2147483648 Check if it works with the

negative limit value of a

32-bit integer.

FALSE FALSE

2147483647 Check if it works with the

positive limit value of a

32-bit integer.

TRUE TRUE

Despite not being able to complete an exercise code must submit the appropriate test design in memory

indicating the result obtained inability to run the test.

8

Delivery procedure practice

Delivering practice 1 done electronically through Global Classroom

The submission deadline for both is the day November 4, 2017 at 23:55 hours.

It is possible to deliver as many times as you like within the deadline given, the only recorded version of his practice is

the last delivered. Valuation practice is the assessment of the content of this latest installment. Always check what you

deliver.

deliverer: He must deliver a single compressed file format zip with the name

ec_p1_AAAAAAAAA_BBBBBBBBB.zip where A and B ... A ... B are the NIA team members.

The file zip must contain only the following files:

ejercicio1.s

ejercicio2.s

memoria.pdf

9

Assessment practice

The evaluation of the practice will be divided into two parts:

Code (7 points)

Memory (3 points)

The score for each year shall be:

Exercise 1 (5 points)

Exercise 2 (5 points)

If an exercise your score is not delivered will be 0. Note that, to follow the continuous evaluation process, the

minimum grade in each practice should be 2 and the average of the two practices 4.

NOTES :

one. If a serious error concept in practice is detected (in any section

any exercise), the overall assessment of the practical will be zero points (0 points).

two. In case of finding common implementations in two practices (or content

Similar memory), both will score 0.

3. If found code snippets obtained directly from the Internet,

practice will have a rating of 0.


版权所有:留学生程序网 2020 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。