In: Computer Science
Write a machine language program to output your name on the output device. The name you output must be longer than two characters. Write it in a format suitable for the loader and execute it on the Pep/9 simulator.
my name is Kevin
Address |
Machine code/object code |
Assembly code |
Meaning |
000 |
D1 00 1F |
LDBA 0x001F,d |
Load K |
003 |
F1 FC 16 |
STBA 0xFC16,d |
o/p K |
006 |
D1 00 20 |
LDBA 0x0020,d |
Load e |
009 |
F1 FC 16 |
STBA 0xFC16,d |
o/p e |
0C |
D1 00 21 |
LDBA 0x0021,d |
Load v |
0F |
F1 FC 16 |
STBA 0xFC16,d |
o/p v |
12 |
D1 00 22 |
LDBA 0x0022,d |
Load i |
15 |
F1 FC 16 |
STBA 0xFC16,d |
o/p i |
018 |
D1 00 23 |
LDBA 0x0023,d |
Load n |
01B |
F1 FC 16 |
STBA 0xFC16,d |
o/p n |
01E |
00 |
STOP |
|
01F |
4B 65 76 69 6E |
.ASCII “Kevin” |
Ascii of each Character stored in memory |
024 |
zz |
.END |
|
Assembly Code
LDBA 0x001F,d
STBA 0xFC16,d
LDBA 0x0020,d
STBA 0xFC16,d
LDBA 0x0021,d
STBA 0xFC16,d
LDBA 0x0022,d
STBA 0xFC16,d
LDBA 0x0023,d
STBA 0xFC16,d
STOP
.ASCII “Kevin”
.END
0000 D1001F LDBA 0x001F,d
0003 F1FC16 STBA 0xFC16,d
0006 D10020 LDBA 0x0020,d
0009 F1FC16 STBA 0xFC16,d
000C D10021 LDBA 0x0021,d
000F F1FC16 STBA 0xFC16,d
0012 D10022 LDBA 0x0022,d
0015 F1FC16 STBA 0xFC16,d
0018 D10023 LDBA 0x0023,d
001B F1FC16 STBA 0xFC16,d
001E 00 STOP
001F 4B6576696E .ASCII “Kevin”
0024 .END
USing STRO TRAP
Address |
Machine code |
Assembly code |
Meaning |
0000 |
49 00 04 |
STRO name,d |
String output trap |
0003 |
00 |
STOP |
|
0004 |
4B 65 76 69 6E |
name: .ASCII “Kevin” |
Ascii of each Character stored in memory |
009 |
.END |