eec70hw2 - add Address_of_twelve, Address of twelve, 11...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Enrique Garcia 996743154 Hw 2, EEC 70 Chp.6 6.1 You can detect overflow when doing single-percision floating point addition by… 6.10 A number x that when added to 1.0 gives x is… Chp.7 7.1 A. To find element 6 (assuming the index starts at zero) with the elements being characters is the starting location plus the element number minus one since each location is one byte. i.e 40+6-1=45 B. Since the elements are now integers each element is 4 bytes long. To account for this we take the starting location and add the number of elements minus one times the size. i.e. 40+(6-1)*4=60 C. Since floats are the same size as integers the calculation is the same as B 40+(6-1)*4=60 D. The same calculation can be done for any size. 40+(6-1)*7=75 7.3 A. .data Chars: .byte 0:60 Address_of_twelve: .word .text __start: la Address_of_twelve, Chars
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: add Address_of_twelve, Address of twelve, 11 done B. .data ints: .byte 0:25 Address_of_twelve: .word elenum: .word .text __start: la Address_of_twelve, Chars mul elenum, 11,4 #this calculates the offset since the array consists of ints add Address_of_twelve, Address of twelve, elenum done Chp.8 8.1 An instruction would require bits if two-address format were used in MAL. 8.2 Register $12 will have . . After the code it executed 8.3 lw $8, label This instruction means that the contents of label are stored in $8 la $8, label This instruction means that the address of label is stores in $8 8.4 In SAL, .data A: .word B: .word C: .word I: .word 1 .text __start: For: bgt I, 20, End add A, A, B bgt A, 5, Next move C, A Next: add I, I, 1 b For End: done In MAL, .data...
View Full Document

This note was uploaded on 05/28/2011 for the course EEC 070 taught by Professor Chuah,c during the Winter '08 term at UC Davis.

Page1 / 2

eec70hw2 - add Address_of_twelve, Address of twelve, 11...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online