CS530.Chap3 - Systems Programming SDSU, CS530 Chapter 3 Guy...

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

View Full Document Right Arrow Icon
Systems Programming SDSU, CS530 Chapter 3 Guy E Leonard
Background image of page 1

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

View Full DocumentRight Arrow Icon
Overview Loaders Absolute loader: bootstrap loader Relocating loader: relative loader Linking loader (linker - relocating loader) Linkers Linkage editors Dynamic linking
Background image of page 2
Systems Programming: the Linker and Loader Source Program Assembler Linker program listing with object code Loader object file / executable program . . . 003600 . . . 103000 . . . 00C303 . . . 003030 . . . . . . 3030 . . . 3600 . . . 6390 . . . C303 . . . Main Memory
Background image of page 3

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

View Full DocumentRight Arrow Icon
The Absolute Loader Absolute Program Advantage o Simple and efficient Disadvantage o Requires programmer to specify the actual address o Difficult to use subroutine libraries All library addresses would need to be known Limited to main program and libraries that fit within physical space of computer memory
Background image of page 4
Algorithm For An Absolute Loader Fig. 3.2 begin read Header record verify program name and length read first Text record while record type /= ‘E’ do begin {if object code is in character form, convert into internal representation} move object code to specified location in memory read next object program record end jump to address specified in End record end
Background image of page 5

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

View Full DocumentRight Arrow Icon
Object Program Absolute Loader Fig. 3.1 (a)
Background image of page 6
Fig 3.1
Background image of page 7

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

View Full DocumentRight Arrow Icon
Object Code Representation In the object file Each byte of assembled code is given using its hexadecimal representation in character form “Easy” to read by human beings When loaded in memory Each byte of object code is stored as a single byte Most machines store object programs in a binary form Need to ensure that file and device conventions do not cause some of the program bytes to be interpreted as control characters
Background image of page 8
A Simple Bootstrap Loader Bootstrap Loader When a computer is first tuned on or restarted, a special type of absolute loader, called bootstrap loader is executed This bootstrap loads the first program to be run by the computer -- usually an operating system Example (SIC bootstrap loader) The bootstrap itself begins at address 0 It loads the OS starting address 0x80 No header record or control information, the object code is consecutive bytes of memory
Background image of page 9

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

View Full DocumentRight Arrow Icon
SIC Bootstrap Loader Logic Fig. 3.3 Begin X=0x80 (the address of the next memory location to be loaded Loop A GETC (
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 01/12/2012 for the course CS 530 taught by Professor Staff during the Spring '08 term at San Diego State.

Page1 / 33

CS530.Chap3 - Systems Programming SDSU, CS530 Chapter 3 Guy...

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