CSE230_Set02_AppendixA

CSE230_Set02_AppendixA - CSE 230 Computer Organization and...

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

View Full Document Right Arrow Icon
CSE 230 Computer Organization and Assembly Language Fall 2006 Computer Science & Engineering Department Arizona State University Tempe, AZ 85287 Instructor: Dr. Baoxin Li [email protected] Office: Brickyard 502
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Appendix A Assemblers, Linkers, and the SPIM Simulator What are covered in Appendix A
Background image of page 2
3 Introduction The process that produces an executable file Translate Resolve external references
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 When to use assembly language When the speed or size of a program is critically important (Mostly only true for special purpose computers) Exploit specialized instructions (e.g. string copy or pattern- matching instructions) Older or specialized computers for which no high-level language available A hybrid approach: e.g., using C and assembly languages in a DSP board A programmers' advantage over a compiler has become difficult to maintain Smarter complier Increased complexity due to e.g., pipelining
Background image of page 4
5 Drawbacks of assembly language Machine (architecture) specific Takes longer to program Hard to read and understand Even some embedded applications are written in high-level language Consider a modern printer/copier
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Assemblers For translating assembly language into machine code Two steps Resolve the labels/addresses Translate each instruction into its corresponding binary equivalent ( opcode,registers,addresses,etc) The result is a set of machine instructions, data, and some bookkeeping information the object file Object file may contain external references and cannot be executed in general The assembler provides lists of labels and unresolved references for the linker to use
Background image of page 6
7 Some Issues for Assemblers Forward reference: use a label before it is defined A two step process for the assembler First find all the labels and then translate the instruction Consider A line begins with a label Symbol table Fixed-length instruction v.s. variable-length instruction Possible 1-pass process using backpatching
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Object File Format Object file header Text segment: machine code Data segment Relocation information: identifies instructions & data words that depend on absolute addresses Symbol table Debugging information
Background image of page 8
9 Additional Facilities in Assemblers Data layout directives String directives
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Additional Facilities in Assemblers (cont’d) Macros An example: print the number in $7 using printf (a library routine)
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/11/2010 for the course CSE/EEE CSE/EEE230 taught by Professor Baoxinli during the Fall '08 term at ASU.

Page1 / 36

CSE230_Set02_AppendixA - CSE 230 Computer Organization and...

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

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