5.2 - Translating and Starting a Program

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which register does the assembler it self reserve and why?

$at, for pseudo-instructions

What are the 6 pieces of of an object file in UNIX systems

- Object file headers: -describes the size and position of other peices in the object file - text segment - contains machine code - static data segment - contains the data allocation for the life of the program - relocation information - identifies instructions and data words that depend on absolute addresses - symbol table - contains remain labels - debugging information - contains concise description of how modules were compiled

What are the three steps to a linker?

1) Place code and data modules symbolically into memory 2) Determine the address of data and instruction labels 3) Patch internal and external references

Describe the translation hierarchy for java

1) The java program is compiled into a binary version of java byte code 2) The program is now ready to run on an interpreter called a java virtual machine 3) the java virtual machine links desired methods the java libarbry while the program is running 4) To achieve greater performance, the JVM can invoke the JIT compiler, which selectively compiles methods into the native machine language of the machine on which it is running.

Describe the process of converting a high level program into machine code

1) goes into a compiler and gets converted into assembly language 2) then goes into an assembler to get converted into an object module in machine code and object library routines 3) these two things go into a linker which combines multiple object modules (library routines) into machine language

What are pseduinstructions

A common variation of machine instructions that are often treated as an instruction in their own right

What is an executable file?

A file the linker creates that can be ran on a computer. Usually has the same format as an object file EXCEPT that it does it contains no unresolved references

What is the textbook definition of an executable file?

A functional program in the format of an object file that contains no unresolved references. It can contain symbol tables and debugging information. A "stripped executable" does not contain that information. Relocation information may be included for the loader.

What is a loader?

A system program that puts an object program into main memory so it is ready to execute

What are dynamically linked libraries?

Alternative to the static linked libraries where the libraries routines are not linked and loaded until the program is run(executed).

Why do we have dynamically linked libraries?

Although linking libraries in a static fashion is the fastest method it has its downsides 1. library routines become part of the executable code so if a update is released it keeps using to old one 2. Loads all routines in the library that are called anywhere in the executable, even if those calls are not executed

Why must $zero be off limits to the programmer in terms of the assembly language?

Because it is used to create the assembly language instruction that copies the contents of one register to another. Thus the MIPS assembler accepts this instruction even though it is not found in the MIPS architecture: move $t0,$t1 is actually add $t0, $zero, $t1 in the assembler

How did the developers try to combat the slow execution speed?

Create a compiler that translated while the program was running. AKA: Just In TIme compilers

What is java byte code?

Instructions from an instruction set designed to interpret java programs

Describe the 6 steps the loader follows

Now that the executable file is on disk 1. Reads the executable file header to determine size of the text and data segments. 2. Creates an address space large enough for the text and data. 3. Copies the instructions and data from the executable file into memory. 4. Copies the parameters (if any) to the main program onto the stack. 5. Initializes the machine registers and sets the stack pointer to the first free location. 6. Jumps to a start-up routine that copies the parameters into the argument registers and calls the main routine of the program. When the main routine returns, the start-up routine terminates the program with an exit system call.

Describe the purpose of a linker/text editor

Programmers re-compiler functions that were never changed, what the linker does is that it allows the program to compile and assemble each procedure independently so that any change to one line would require compiling and assembling only one procedure. This requires a linker/link editor

What does the linker/text editor actually do?

Takes all of the independently assembled machine language program and stitches them together

Describe the assembler

The assembler turns the assembly language program into an object file (combination of machine language instructions, data, and information needed to place instructions properly in memory)

What do just in time compilers do?

a compiler that operates at runtime, translating the interpreted code segments into the native code of the computer.

How does the assembler convert the blt psedo instruction?

as slt and bne

Describe the compiler

converts a high level language into assembly language before them many languages were written in assembly language because memory was small and compilers were inefficient. However the million fold increase in memory capacity per single DRAM chip has reduced program size concerns

Why is a linker useful?

it is faster to patch code than to recompile/reassemble

How do assemblers convert a binary version of each instruction?

it must determine the addresses corresponding to all labels. This is done through a symbol table

What is the java virtual machine

program that interprets java byte codes

What is assembly language

symbolic instruction that can be translated into machine code

Upside and downsides of the interpretation?

upside: portability, The availability of software Java virtual machines meant that most people could write and run Java programs shortly after Java was announced. downsides: lower performance (slowed by a factor of 10 compared to c compilers)


Set pelajaran terkait

FIN 357 Chapter 10: Making Capital Investment Decisions

View Set

management test #3(Chapter 11)- ECU

View Set

(PrepU) Chapter 2: Theory, Research, and Evidence-Informed Practice

View Set

Chapter 5 - The Integumentary System

View Set

OB Exam 2 - chapters 18,19,20,21

View Set