SOCS

Post on 11-Jan-2016

38 views 3 download

description

SOCS. Hoofdstuk 3 Basisprogrammatuur. Inhoud. De Vertaler De Voorvertaler De Lader De Binder De Vertolker Het Speurprogramma Het Opstarten van de Computer. Inhoud. De Vertaler De Voorvertaler De Lader De Binder Verantwoording Modules + Vertaler directieven Taken van de Binder - PowerPoint PPT Presentation

Transcript of SOCS

1

SOCS

Hoofdstuk 3

Basisprogrammatuur

2

Inhoud

De Vertaler De Voorvertaler De Lader De Binder De Vertolker Het Speurprogramma Het Opstarten van de Computer

3

Inhoud

De Vertaler De Voorvertaler De Lader De Binder

Verantwoording Modules + Vertaler directieven Taken van de Binder Werking van de Binder Van Bron-programma tot Uitvoering

De Vertolker Het Speurprogramma Het Opstarten van de Computer

4

Project

VertaleVertalerr

7299999999…

2131000000…

…12210000109999999999…

druk: DRU …

som: OPT R0,b…

main: … BIG R0,a STPa: RESGR 1

VertaleVertalerr

VertaleVertalerr

Vertaalde ModuleModule

5

Binder

BinderBinder

7299999999…

2131000000…

…12210000109999999999…

Vertaalde Module

7299999999…

21310000400040…

…122100006600669999999999…

Uitvoerbaar programma

6

Zelfde Resultaat

VertaleVertalerr

SamengevoegdeModules

druk: DRU …

som: OPT R0,b…

main: … BIG R0,a STPa: RESGR 1

7299999999…

21310000400040…

…122100006600669999999999…

Uitvoerbaar programma

7

Verantwoording

Samenvoegen van bronprogramma: Unieke symbolische adressen ? Stricte afspraken nodig

Hervertaling duurt langer Verbetering fout in een module

Programmabibliotheken Reeds vertaalde deelprogramma’s

Vb. parse (ASCII-string binair getal), sqrt, sort, …

Broncode niet beschikbaar Bovendien onpraktisch om manueel samen

te voegen

8

Modules

Gedeelte van een programma Hoofdprogramma Procedure of Functie

Verwijzigingen symbolische adressen uit andere modules

main: … SBR kwad …

Module A

…kwad: … HIA R0,A …

Module B

*** fout *** lijn 17: ‘kwad’ niet gedefinieerd*** fout *** lijn 17: ‘kwad’ niet gedefinieerd

9

Vertaler directieven

EXTERN symbolisch_adresEXTERN symbolisch_adres symb.adres is in een andere module gedefinieerd

GLOBAAL symbolisch_adresGLOBAAL symbolisch_adres andere module mag naar symb.adres verwijzen

EXTERN kwadEXTERN kwadmain: … SBR kwad …

Module A

GLOBAAL kwadGLOBAAL kwad…kwad: … HIA R0,A …

Module B

10

Vertaler directieven

STARTPR adresSTARTPR adres De uitvoering start bij “adres” Moet in 1 module aanwezig zijn

EXTERN kwadSTARTPR mainSTARTPR mainmain: … SBR kwad …

Module A

GLOBAAL kwad…kwad: … HIA R0,A …

Module B

11

Objectmodule

Resultaat van vertaling van module Machinecode Niet uitvoerbaar!

Onvolledig Sommige adressen onbekend

(externe symbolische adressen) Reloceerbaar

Samenvoegen (niet allemaal vanaf 0000)

Vertaler genereert steeds objectmodule

12

Objectmodule Uitvoerbaar programma

0000000100

1131100001…

0000000200

#symbolen …

Type Type

Lengte Lengte

Startadres Startadres

Symbool-Symbool-tabeltabel

HoofdingHoofding0000000024002400000000020002

99999999999999999999

Object-Object-modulemodule

0000000100

1131100001

……

0000000200

0000000086008600000000020002

99999999919999999991

#symbolen … #relocatie …

Relocatie-Relocatie-& Bindings-& Bindings-tabeltabel

#reloc/bind. … …

Machine-Machine-CodeCode

UitvoerbaarUitvoerbaarprogrammaprogramma

13

Informatie: Vertaler Binder

Objectmodule = reloceerbaar Relocatie-informatie Externe symbolische adressen?

Niet gekend, dus 0000 en informatie voor binder Relocatie- en bindingstabel Relatief-adres +/-BewerkingRelatief-adres +/-Bewerking

Uitgebreide symbooltabel Naam Waarde TypeNaam Waarde Type

Type = lokaal, globaal, extern

14

Voorbeeld STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

15

Afspraak

HIA.w 0,9995(-)HIA.w 0,9995(-)

HIA.w R0,EIND-MACHT

11110099951111009995

VertaleVertalerr

Schrijven als …

16

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

0 PPTT

1 LLTT

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

17

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

0 PPTT

1 LLTT

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

18

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

0 PPTT

2 LLTT

19

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

0 PPTT

3 LLTT

2

20

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

2 PPTT

4 LLTT

3

21

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

3 PPTT

5 LLTT

4

22

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

4 PPTT

6 LLTT

5

23

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

5 PPTT

7 LLTT

6

24

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

6 PPTT

8 LLTT

7

25

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

7 PPTT

9 LLTT

8

26

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

7 PPTT

10 LLTT

8

27

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

0 PPTT

1 LLTT

-1 StSt

28-1 StSt

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

0 PPTT

1 LLTT

2

29

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

0 PPTT

2 LLTT

2 StSt

30

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

0 PPTT

3 LLTT

2

0000000100000000010000000010000000001000

2 StSt

31

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

2 PPTT

4 LLTT

3

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#

0000 – 0005 = 99950000 – 0005 = 9995

32

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

3 PPTT

5 LLTT

4

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRU

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#

33

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

4 PPTT

6 LLTT

5

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#

0000 + 1 = 00010000 + 1 = 0001

34

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

5 PPTT

7 LLTT

6

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)SBR.d 0000(-)SBR.d 0000(-)

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#0005 +KWAD0005 +KWAD

35

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

6 PPTT

8 LLTT

7

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)SBR.d 0000(-)SBR.d 0000(-)DRUDRU

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#0005 +KWAD0005 +KWAD

36

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

7 PPTT

9 LLTT

8

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)SBR.d 0000(-)SBR.d 0000(-)DRUDRUSTPSTP

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#0005 +KWAD0005 +KWAD

37

Vertaler Binder

STARTPR PRG EXTERN KWAD,EINDX: 100; 1000PRG: HIA.w R0,EIND-MACHT DRU HIA R1,X+1MACHT: SBR KWAD DRU STP EINDPR

Vertaler (2de stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

8 PPTT

10 LLTT

00000001000000000100

0002 +EIND0002 +EIND

00000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)SBR.d 0000(-)SBR.d 0000(-)DRUDRUSTPSTP

2 StSt

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#0005 +KWAD0005 +KWAD

38

0000000100

HIA.w 0,9995(-)

HIA.d 1,0001(-)DRU

0000001000

SBR.d 0000(-)DRUSTP

Vertaler Binder8 PPTT

0000000100000000010000000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)SBR.d 0000(-)SBR.d 0000(-)DRUDRUSTPSTP

2 StSt

0002 +EIND0002 +EIND0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#0005 +KWAD0005 +KWAD

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

0000000008000800000000020002

99999999999999999999

39

Vertaler Binder8 PPTT

0000000100000000010000000010000000001000HIA.w 0,9995(-)HIA.w 0,9995(-)DRUDRUHIA.d 1,0001(-)HIA.d 1,0001(-)SBR.d 0000(-)SBR.d 0000(-)DRUDRUSTPSTP

2 StSt

0002 +EIND0002 +EIND0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#0005 +KWAD0005 +KWAD

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

KWADKWAD ?? externextern

EINDEIND ?? externextern

XX 00 lokaallokaal

PRGPRG 22 lokaallokaal

MACHTMACHT 55 lokaallokaal

#symbolenKWAD ???? ???? externEIND ???? ???? externX 0000 0000 lokaal

PRG 0002 0002 lokaalMACHT 0005 0005 lokaal

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

40

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

0 PPTT

1 LLTT

41

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM ? ? globaalglobaal

KWADKWAD ? ? globaalglobaal

EINDEIND ? ? globaalglobaal

0 PPTT

1 LLTT

42

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM ? ? globaalglobaal

KWADKWAD ? ? globaalglobaal

EINDEIND ? ? globaalglobaal

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

0 PPTT

2 LLTT

1

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 0 0 globaalglobaal

KWADKWAD ? ? globaalglobaal

EINDEIND ? ? globaalglobaal

43

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD ?? globaalglobaal

EINDEIND ?? globaalglobaal

1 PPTT

3 LLTT

2

44

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD ?? globaalglobaal

EINDEIND ?? globaalglobaal

2 PPTT

4 LLTT

3

45

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD ?? globaalglobaal

EINDEIND ?? globaalglobaal

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND ?? globaalglobaal

3 PPTT

5 LLTT

4

46

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND ?? globaalglobaal

4 PPTT

6 LLTT

5

47

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND ?? globaalglobaal

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND ?? globaalglobaal

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

5 PPTT

7 LLTT

6

48

Vertaler Binder

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Vertaler (1ste stap):

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

6 PPTT

8 LLTT

49

Vertaler BinderVertaler (2de stap):

0 PPTT

1 LLTT

-1 StSt

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

50

Vertaler BinderVertaler (2de stap):

0 PPTT

1 LLTT

-1 StSt

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

51

Vertaler BinderVertaler (2de stap):

0 PPTT

2 LLTT

1

SBR.d 0003(-)SBR.d 0003(-)

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

52

Vertaler BinderVertaler (2de stap):

1 PPTT

3 LLTT

2

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

53

Vertaler BinderVertaler (2de stap):

2 PPTT

4 LLTT

3

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTG

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

54

Vertaler BinderVertaler (2de stap):

3 PPTT

5 LLTT

4

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTGHIA.w 0,0000(1)HIA.w 0,0000(1)

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

55

Vertaler BinderVertaler (2de stap):

4 PPTT

6 LLTT

5

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTGHIA.w 0,0000(1)HIA.w 0,0000(1)VER.w 0,0000(1)VER.w 0,0000(1)

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

56

Vertaler BinderVertaler (2de stap):

5 PPTT

7 LLTT

6

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTGHIA.w 0,0000(1)HIA.w 0,0000(1)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTG

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

57

Vertaler BinderVertaler (2de stap):

6 PPTT

8 LLTT

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTGHIA.w 0,0000(1)HIA.w 0,0000(1)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTG

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

GLOBAAL DDM,KWAD,EINDDDM: SBR KWAD VER R0,R1 KTGKWAD: HIA R0,R1 VER R0,R1EIND: KTG EINDPR

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

58

Vertaler Binder6 PPTT

SBR.d 0003(-)SBR.d 0003(-)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTGHIA.w 0,0000(1)HIA.w 0,0000(1)VER.w 0,0000(1)VER.w 0,0000(1)KTGKTG

-1 StSt

0000 +#LAADADRES#0000 +#LAADADRES#

Symb.Symb.AdresAdres

Abs.Abs.AdresAdres

TypeType

DDMDDM 00 globaalglobaal

KWADKWAD 33 globaalglobaal

EINDEIND 55 globaalglobaal

SBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

#relocatie/binding#relocatie/binding

0000 +#LAADADRES#0000 +#LAADADRES#

#symbolenDDM 0000 0000 globaalKWAD 0003 0003 globaal

EIND 0005 0005 globaal

000000000600069999999999

99999999999999999999

59

Taken van de binder

Plaats voorzien voor de modules Machinecode samenvoegen Code reloceren Externe referenties in rekening brengen Startadres bepalen (Relocatietabel genereren)

60

Werking van de binder

Twee stappen: Stap 1: allocatie en globale symbooltabel Stap 2: code samenvoegen, reloceren, binden, …

61

Stap 1: Allocatie- en globale symbooltabel

Allocatietabel Beginadres van elke module bepalen

Globale Symbooltabel globale etiketten globale symbooltabel

Gebruikte delen van objectmodules: Hoofding Symbooltabel

62

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

Stap 1: Allocatie- en globale symbooltabel

0000000008000800000000020002

99999999999999999999

#symbolenKWAD ???? ???? externEIND ???? ???? externX 0000 0000 lokaal

PRG 0002 0002 lokaalMACHT 0005 0005 lokaal

CODE

Relocatie/Binding

Module AModule A

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

AA 00000000

Globale SymbooltabelGlobale Symbooltabel

EtiketEtiket AdresAdres

0 PPTT

A00000000

00080008

8

63

Stap 1: Allocatie- en globale symbooltabel

#symbolenDDM 0000 0000 globaalKWAD 0003 0003 globaal

EIND 0005 0005 globaal

000000000600069999999999

99999999999999999999

CODE

Relocatie/Binding

Module BModule B

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

AA 00000000

Globale SymbooltabelGlobale Symbooltabel

EtiketEtiket AdresAdres

8 PPTT

A00000000

00080008

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

AA 00000000

BB 00080008B

00140014

14

0000 + 0008 = 00080000 + 0008 = 0008

64

Stap 1: Allocatie- en globale symbooltabel

#symbolenDDM 0000 0000 globaalKWAD 0003 0003 globaal

EIND 0005 0005 globaal

000000000600069999999999

99999999999999999999

CODE

Relocatie/Binding

Module BModule B

Globale SymbooltabelGlobale Symbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

14 PPTT

A00000000

00080008B

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

AA 00000000

BB 00080008

00140014

0003 + 0008 = 00110003 + 0008 = 0011

65

Stap 1: Allocatie- en globale symbooltabel

#symbolenDDM 0000 0000 globaalKWAD 0003 0003 globaal

EIND 0005 0005 globaal

000000000600069999999999

99999999999999999999

CODE

Relocatie/Binding

Module BModule B

Globale SymbooltabelGlobale Symbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

14 PPTT

A00000000

00080008B

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

AA 00000000

BB 00080008

00140014

0005 + 0008 = 00130005 + 0008 = 0013

66

Stap 1: Allocatie- en globale symbooltabel

#symbolenDDM 0000 0000 globaalKWAD 0003 0003 globaal

EIND 0005 0005 globaal

000000000600069999999999

99999999999999999999

CODE

Relocatie/Binding

Module BModule B

Globale SymbooltabelGlobale Symbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

14 PPTT

A00000000

00080008B

AllocatietabelAllocatietabel

ModuleModule BeginadresBeginadres

AA 00000000

BB 00080008

00140014

67

Stap 2: Samenvoegen, reloceren en binden

Code van alle modules samenvoegen Relocatie/Binding m.b.v. Relocatie/Bindingstabel

Adres +#LAADADRES# + beginadres van Module

Adres +EXTERN + waarde van globaal symbool

Startadres bepalen startadres + beginadres van de module

Symbooltabel toevoegen Relocatietabel aanmaken

68

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,9995(-)

HIA.d 1,0001(-)DRU

0000001000

SBR.d 0000(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

SamenvoegenSamenvoegen

69

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,9995(-)

HIA.d 1,0001(-)DRU

0000001000

SBR.d 0000(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

Module AModule A

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

70

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,9995(-)

HIA.d 1,0001(-)DRU

0000001000

SBR.d 0000(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

Module AModule A

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

9995 + 0013 - 0000 = 00089995 + 0013 - 0000 = 0008

SamenvoegenReloceren + BindenReloceren + Binden

0002 + 0000 = 00020002 + 0000 = 0002

71

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,00080008(-)

HIA.d 1,0001(-)DRU

0000001000

SBR.d 0000(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

Module AModule A

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

0001 + 0000 = 00010001 + 0000 = 0001

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

0004 + 0000 = 00040004 + 0000 = 0004

72

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,00080008(-)

HIA.d 1,00010001(-)DRU

0000001000

SBR.d 0000(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

Module AModule A

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

0000 + 0011 = 00110000 + 0011 = 0011

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

0005 + 0000 = 00050005 + 0000 = 0005

73

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,00080008(-)

HIA.d 1,00010001(-)DRU

0000001000

SBR.d 00110011(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

Module AModule A

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

74

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,00080008(-)

HIA.d 1,00010001(-)DRU

0000001000

SBR.d 00110011(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

Module BModule B

#relocatie/binding#relocatie/binding

0000 +#LAADADRES#0000 +#LAADADRES#

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

75

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,00080008(-)

HIA.d 1,00010001(-)DRU

0000001000

SBR.d 00110011(-)DRUSTPSBR.d 0003(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

Module BModule B

#relocatie/binding#relocatie/binding

0000 +#LAADADRES#0000 +#LAADADRES#

0003 + 0008 = 00110003 + 0008 = 0011

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

0000 + 0008 = 00080000 + 0008 = 0008

76

Stap 2: Samenvoegen, reloceren en binden

0000000100

HIA.w 0,00080008(-)

HIA.d 1,00010001(-)DRU

0000001000

SBR.d 00110011(-)DRUSTPSBR.d 00110011(-)

KTG

VER.w 0,0000(1)HIA.w 0,0000(1)

VER.w 0,0000(1)

KTG

Module BModule B

Globale Globale SymbooltabelSymbooltabel

EtiketEtiket AdresAdres

DDMDDM 00080008

KWADKWAD 00110011

EINDEIND 00130013

00

11

22

33

44

55

66

77

88

99

1010

1111

1212

1313

#relocatie/binding#relocatie/binding

0000 +#LAADADRES#0000 +#LAADADRES#

SamenvoegenReloceren + BindenReloceren + Binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

77

Stap 2: Samenvoegen, reloceren en binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

0002 + 0000 = 00020002 + 0000 = 0002

Module AModule A

0000000008000800000000020002

99999999999999999999

SamenvoegenReloceren + BindenStartadresStartadres 00020002

78

Stap 2: Samenvoegen, reloceren en binden

Module AModule A

#symbolenKWAD ???? ???? externEIND ???? ???? externX 0000 0000 lokaal

PRG 0002 0002 lokaalMACHT 0005 0005 lokaal

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

#symbolen

X 00000000PRG 00020002MACHT 00050005

0000 + 0000 = 00000000 + 0000 = 00000002 + 0000 = 00020002 + 0000 = 00020005 + 0000 = 00050005 + 0000 = 0005

SamenvoegenReloceren + BindenStartadres 0002

SymbooltabelSymbooltabel

79

Stap 2: Samenvoegen, reloceren en binden

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

#symbolen

X 00000000PRG 00020002MACHT 00050005

Module BModule B

#symbolenDDM 0000 0000 globaalKWAD 0003 0003 globaal

EIND 0005 0005 globaal

DDM 00080008KWAD 00110011EIND 00130013

0000 + 0008 = 00080000 + 0008 = 00080003 + 0008 = 00110003 + 0008 = 00110005 + 0008 = 00130005 + 0008 = 0013

SamenvoegenReloceren + BindenStartadresSymbooltabelSymbooltabel

0002

80

Stap 2: Samenvoegen, reloceren en binden

SamenvoegenReloceren + Binden

#relocatie/binding#relocatie/binding

0002 +EIND0002 +EIND

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +KWAD+KWAD

Module AModule A

StartadresSymbooltabel

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

0002 + 0000 = 00020002 + 0000 = 00020004 + 0000 = 00040004 + 0000 = 00040005 + 0000 = 00050005 + 0000 = 0005

#relocatie#relocatie

0002 +#LAADADRES#0002 +#LAADADRES#

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +#LAADADRES#+#LAADADRES#

RelocatietabelRelocatietabel

0002

81

Stap 2: Samenvoegen, reloceren en binden

SamenvoegenReloceren + BindenStartadresSymbooltabel

AllocatietabelAllocatietabel

Mod.Mod. BeginadresBeginadres

AA 00000000

BB 00080008

0000 + 0008 = 00080000 + 0008 = 0008

#relocatie#relocatie

0002 +#LAADADRES#0002 +#LAADADRES#

0002 -#LAADADRES#0002 -#LAADADRES#0004 +#LAADADRES#0004 +#LAADADRES#00050005 +#LAADADRES#+#LAADADRES#

RelocatietabelRelocatietabel

Module BModule B

#relocatie/binding#relocatie/binding

0000 +#LAADADRES#0000 +#LAADADRES#

00080008 +#LAADADRES#+#LAADADRES#

0002

82

Stap 2: Samenvoegen, reloceren en binden

SamenvoegenReloceren + BindenStartadresSymbooltabel

#relocatie#relocatie

0002 +#LAADADRES#0002 +#LAADADRES#

0002 -#LAADADRES#0002 -#LAADADRES#

RelocatietabelRelocatietabel0004 +#LAADADRES#0004 +#LAADADRES#00050005 +#LAADADRES#+#LAADADRES#

00080008 +#LAADADRES#+#LAADADRES#

0002

83

Stap 2: Samenvoegen, reloceren en binden

SamenvoegenReloceren + BindenStartadresSymbooltabel

#relocatie#relocatie

RelocatietabelRelocatietabel

0004 +#LAADADRES#0004 +#LAADADRES#00050005 +#LAADADRES#+#LAADADRES#

00080008 +#LAADADRES#+#LAADADRES#

0002

84

Stap 2: Uitvoerbaar programma

#relocatie#relocatie

0004 +#LAADADRES#0004 +#LAADADRES#00050005 +#LAADADRES#+#LAADADRES#

00080008 +#LAADADRES#+#LAADADRES#

#symbolen

X 00000000PRG 00020002MACHT 00050005DDM 00080008KWAD 00110011EIND 00130013

0000000100

HIA.w 0,00080008(-)

HIA.d 1,00010001(-)DRU

0000001000

SBR.d 00110011(-)DRUSTPSBR.d 00110011(-)

KTGVER.w 0,0000(1)

VER.w 0,0000(1)HIA.w 0,0000(1)

KTG

0000000014001400000000020002

99999999919999999991

85

Programmabibliotheek

Bij vertaler Verzameling subroutines

Vertaald Samengevoegd in bibliotheek

Binder: Symbolisch adres niet gedefinieerd

Gezocht in de bibliotheek

86

RAM

Van bronprogramma tot Uitvoerbaar programma

Module A(met macro’s)

Module B(met macro’s)

Module A(zonder macro’s)

Objectmodule A

VoorvertalerVoorvertaler

VertalerVertaler

BinderBinder

UitvoerbaarProgramma

Module B(zonder macro’s)

Objectmodule B

VoorvertalerVoorvertaler

VertalerVertaler

Programma-bibliotheek

LaderLader

UitvoerbaarProgramma

Broncode

Machinecode

Legende:

87

Cursustekst

Hoofdstuk 3: pag. 63 pag. 77