Vous êtes sur la page 1sur 13

Input File

(File name - symin.txt):


1
2
3
4
5
6

0
0
RLOOP
0
ZERO
INPUT

LDA
LDX
TD
JEQ
WORD
BYTE

ZERO
ZERO
INPUT
RLOOP
0
X 'F1'

OUTPUT
Design of Symbol Table
........................................
Enter the File Name : symin.txt
1
0
LDA
ZERO
2
0
LDX
ZERO
3
RLOOP
TD
INPUT
4
0
JEQ
RLOOP
5
ZERO
WORD
0
6
INPUT
BYTE
X'F1'
1 - Create
2 - Insert
3 - Search
4 - Modify
5 - Display
Enter the choice :

Enter the starting memory address : 1000


Enter the name of the output file : symout.txt
Do u want to continue :
Y
1 - Create
2 - Insert
3 - Search
4 - Modify
5 - Display
Enter the choice :
5
CONTENTS IN SYMBOL TABLE are
RLOOP
1006
ZERO 100c
INPUT 100f
Do u want to continue :
y
1 - Create
2 - Insert
3 - Search
4 - Modify
5 Display

Enter the choice :


2
Enter the label & its address which u want to insert into symtab
HLT
76
Do u want to continue :
Y
1 - Create
2 - Insert
3 - Search
4 - Modify
5 - Display
Enter the choice :
5
CONTENTS IN SYMBOL TABLE are
RLOOP 1006
ZERO 100c
INPUT 100f
HLT 76
Do u want to continue :
y
1 - Create
2 - Insert
3 - Search
4 - Modify
5 - Display
Enter the choice :
3
Enter the label u want to search in symtab : INPUT
INPUT100f
Do u want to continue :
Y
1 - Create
2 - Insert
3 - Search
4 - Modify
5 - Display
Enter the choice :
3
Enter the label u want to search in symtab : CCC
Invalid Symbol
Do u want to continue :
N

Input File
File name source.txt
READ
0
0
RLOOP
0
ZERO
INPUT
0

START
LDA
LDX
TD
JEQ
WORD
BYTE
END

1000
ZERO
ZERO
INPUT
RLOOP
0
X 'F1'
1000

OUTPUT
Pass 1 of Two-Pass Assembler
-------------------------------------Enter the file name which contains the source assembly language program :
source.txt
The Source program
READ
0
0
RLOOP
0
ZERO
INPUT
0

START
LDX
LDA
TD
JEQ
WORD
BYTE
END

1000
ZERO
ZERO
INPUT
RLOOP
0
X 'F1'
1000
Intermediate file

1000
1000
1003
1006
1009
100c
100f

READ
0
0
RLOOP
0
ZERO
INPUT
0

START
LDX
LDA
TD
JEQ
WORD
BYTE
END

1000
ZERO
ZERO
INPUT
RLOOP
0
X 'F1'
1000
Symbol Table

RLOOP
ZERO
INPUT

1006
100c
100f

The length of the program is 16

Input Files
File name - hexsheet.txt
LDA 3A
LDX 3B
TD
1A
JEQ 4A
File name - symtab.txt
RLOOP 1006
ZERO
100c
INPUT 100f
File name - inter.txt
1000 READ START
1000 0
LDX
1003 0
LDA
1006 RLOOP TD
1009 0
JEQ
100c ZERO
WORD
100f INPUT BYTE
0
END

1000
ZERO
ZERO
INPUT
RLOOP
0
X'F1'
1000

OUTPUT
Pass 2 of Two-Pass Assembler
-------------------------------------Enter The Hexcode Sheet File :
hexsheet.txt
Contents in the Hexcode Sheet File
LDX 3A
LDA 3B
TD
1A
JEQ
4A
Contents in the SYMTAB
RLOOP 1006
ZERO
100c
INPUT 100f
Enter the name of the intermediate File :
inter.txt
1000 READ START
1000
1000 0
LDX
ZERO
1003 0
LDA
ZERO
1006 RLOOP TD
INPUT
1009 0
JEQ
RLOOP
100c ZERO WORD
0
100f INPUT BYTE
X'F1'
0
END
1000
Enter The Program Length : 16
Header Record
H
READ 1000 10
Text Record
T
1000 10
3A100c
3B100c
1A100f
End record
E
1000

Input Files

4A1006

File name source.txt


READ
START
0
LDX
0
LDA
RLOOP
TD
0
JEQ
ZERO
WORD
INPUT
BYTE
0
END
File name - hexsheet.txt
LDA 3A
LDX 3B
TD
1A
JEQ 4A

1000
ZERO
ZERO
INPUT
RLOOP
0
X 'F1'
1000

OUTPUT
SINGLE PASS ASSEMBLER
------------------------------------INPUT
--------Enter the source file name : source.txt
READ START 1000
0
LDA
ZERO
0
LDX
ZERO
RLOOP TD
INPUT
0
JEQ
RLOOP
ZERO WORD
0
INPUT BYTE
X'F1'
0
END
1000
Enter the hexcode sheet file : hexsheet.txt
LDA 3a
LDX 3b
TD
1a
JEQ
4a
Enter the starting memory address : 1000
OUTPUT
-----------Symbol Table:
RLOOP 1006
ZERO
100c
INPUT 100f
Object Program:
H
T
E

READ
1000
1000

1000
10

10
3a100c 3b100c 1a100f 4a1006

Input Files

File name - loadin.txt


H
T
T
T
T
T
E

COPY
002000
302015
00201E
454F46
002039
D8305D
002057
002071
DC3079
002000

002000
1E
483061
15
200003
1E
282030
A
19
2C2036

00107A
142033
3C2003
2C2036
100000
242030
303057
102036
342030
383064

483039
00202A
483061

102036
0C2039
182033

282030
00202D
4C0000

302030
53A039
4C0000
E03079
4C0000

E0305D
30303F
2C305E
38303F
F1
201000
303064
4FA039
15

OUTPUT
ABSOLUTE LOADER
------------------------------The object program to be loaded in main memory is:
---------------------------------------------------------------H
T
T
T
T
T
E

COPY
002000
302015
00201E
454F46
002039
D8305D
002057
002071
DC3079
002000

002000
1E
483061
15
200003
1E
282030
A
19
2C2036

00107A
142033
3C2003
2C2036
100000
242030
303057
102036
342030
383064

30391020
0300202A
1820334C
xxxxxxxx
3FD8305D
38303F10
xxxxxxxx
E0307930
30644C00

36282030
0C203900
0000454F
xx242030
28203030
20364C00
xxxxxxxx
30644FA0
0015

483039
00202A
483061

102036
0C2039
182033

282030
00202D
4C0000

302030
53A039
4C0000
E03079
4C0000

E0305D
2C305E
F1
303064
15

30303F
38303F
201000
4FA039

Loaded Program :
---------------------2000
2010
2020
2030
2040
2050
2060
2070
2080

14203348
30613C20
36483061
100000xx
305D3030
392C305E
00xxxxxx
xx342030
2C203638

30201548
202D2C20
46200003
302030E0
305753A0
00F12010
xxxxxxxx
39DC3079

Input File

(File name - relodin.txt):


H
T
T
T
T
T
E

COPY
000000
300015
211033
000011
454196
000031
241064
212064
000058
000065
152079
25
000000

000000
10
015

001073
140033

200033
19
045

412036

15

135

140030

381045
05
056
19
080

100036
340030

481039
481061

100036
311003

280030
200030

481061
100003
430030
210030

380030
200000
141013
301057

412000

520000
141079
220036

151
301064
381064

301000
503039
430000

OUTPUT
RELOCATING LOADER
-------------------------------Enter the location where the program has to be loaded: 3000
The Relocated program looks like the following:
3000
3016
3032
3048
3064
3080
3096
3112
3128

14303348
10613110
50364810
03200000
44241064
381045xx
30365230
14107930
10644300

40391030
03200030
61383030
xx143030
21303030
xxxxxxxx
00154000
40645030
0025

36283030
21103320
41500045
43003014
40575460
xxxxxxxx
301000xx
39152079

30001548
0033xx41
41961030
10133010
39212064
xxxxxx10
xx343030
22003638

Input File

301044
543039

(File name link1in.txt):


H
D
R
T
T
M
M
M
M
E
H
D
R
T
T
M
M
M
M
M
M
E
H
D
R
T
T
M
M
M
M
M
M
E

PROGA
LISTA
LISTB
000020
000054
ffffc0
000024
000054
000058
000064
000000

000000
000040
ENDB
10
16

PROGB
LISTB
LISTA
000036
000070
05100030
000037
000044
000070
000074
000078
000082
000000

000000
000060

000070
ENDA 000054
LISTC
ENDC
03201D 77100004
100014 15100006

05
06
06
06

150014
00002f

100014

+LISTB
+LISTC
+ENDC
+LISTB

11
18

000088
ENDB
ENDA

000070
LISTC
03100000
100000 05100006

ENDC
772027

05100000
05100020

100000
05
05
06
06
06
06

+LISTA
+ENDA
+ENDA
+ENDC
+ENDC
+ENDA

PROGC
000000
000057
LISTC 000030
ENDC 000042
LISTA
ENDA LISTB
ENDB
000018
12
03100000
77100004
000042
15
100030
100008
100000
000019
05
+LISTA
000023
05
+LISTB
000027
05
+ENDA
000048
06
+LISTA
000051
06
+ENDA
000054
06
+LISTB
000000

OUTPUT

05100000
100011

100000

Pass1 of Direct Linking Loader


-------------------------------------Enter the location where the program has to be loaded: 1000
The intermediate file of Pass1 of DLL is:
CSECT
PROGA

Symname
LISTA
ENDA

PROGB
LISTB
ENDB
PROGC
LISTC
ENDC

Address
1000
1040
1054
1046
10a6
10b6
109e
10ce
10e0

Length
70
0
0
88
0
0
57
0
0

Input Files
File Name - link2in.txt
H
D
R
T
T
M
M
M
M
E
H
D
R
T
T
M
M
M
M
M
M
E
H
D
R
T
T
M
M
M
M
M
M
E

PROGA
LISTA
LISTB
000020
000054
ffffc0
000024
000054
000058
000064
000000

000000
000040
ENDB
10
16

PROGB
LISTB
LISTA
000036
000070
05100030
000037
000044
000070
000074
000078
000082
000000

000000
000060

000070
ENDA 000054
LISTC
ENDC
03201D 77100004
100014 15100006

150014
00002f

100014

05 +LISTB
06 +LISTC
06 +ENDC
06 +LISTB

11
18

000088
ENDB
ENDA

000070
LISTC
03100000
100000 05100006

ENDC
772027

05100000
05100020

100000
05
05
06
06
06
06

+LISTA
+ENDA
+ENDA
+ENDC
+ENDC
+ENDA

PROGC
000000
000057
LISTC 000030
ENDC 000042
LISTA
ENDA LISTB
ENDB
000018
12
03100000
77100004
000042
15
100030
100008
100000
000019
05
+LISTA
000023
05
+LISTB
000027
05
+ENDA
000048
06
+LISTA
000051
06
+ENDA
000054
06
+LISTB
000000

File Name - estab.txt

05100000
100011

100000

CSECT
PROGA

Symname
LISTA
ENDA

PROGB
LISTB
ENDB
PROGC
LISTC
ENDC

Address
1000
1040
1054
1046
10a6
10b6
109e
10ce
10e0

Length
70
0
0
88
0
0
57
0
0

OUTPUT
0
16
32
48
64
80
96
112
128
144
160
176
192
208
224

xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
0xxxxxx
04150014
xxxxxxxx
10000600
77202705
xxxx0xx
00051000
03100000
xxxxxxxx
11100000

xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
0xxxxxx
xxxxxxxx
xxxxxxxx
22f1000
100000xx
xxxx0xx
06051000
77100004
xxxxxxxx
100000

xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxx0320
xx0xxxx
xxxxxxxx
14ffffc0
xxxxxxxx
xxxx0xx
20051000
05100000
10003010

xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
0xxxxxx
1D771000
0xxxx0
101415
03100000
xxxx0xx
xxxx1000
30100000
xxxxxxxx
00081000

OUTPUT

TEXT EDITOR
Enter the File name:

test.txt

1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

Enter the text to be inserted (press ctl+z to end) :


This is a program to demonstrate
text editor operations like insertion,
deletion and display of text.
^Z
1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

The text in the file is :


This is a program to demonstrate
text editor operations like insertion,
deletion and display of text.
1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

Enter the text to be appended (press ctrl+z to end) :


HALT
^Z
1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

The text in the file is :


This is a program to demonstrate
text editor operations like insertion,
deletion and display of text.
HALT
1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

The file contents have been Deleted completely


1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

The text in the file is :


1.Insert
2.Append
3.Erase
4.Display
5.Exit
Enter your Choice :

Vous aimerez peut-être aussi