Successful first run of B interpreter!

I hand compiled hello.b into hello.s and assembled with the interpreter
and runtime library:
perl as7 --out a.out bl.s hello.s bi.s
This commit is contained in:
rswier
2016-03-07 05:57:30 -05:00
parent a7f040b8f5
commit 28a98360a4
6 changed files with 69 additions and 10 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ fetch:
lmq
and o17777
dac addr
ecla lls 4
cla; lls 4 " XXX replaced for now: ecla lls 4
tad .+3
dac .+1
jmp .. i
+5 -5
View File
@@ -11,7 +11,7 @@ jmp start
cma
tad lastv
dac lastv
imq
lmq
lac sp
tad d1
dac sp i
@@ -82,10 +82,10 @@ getc: 0
jmp getc i
putc: 0
and 0777
and o777
sna
jmp putc i
imq
lmq
lac oflg
sza
jmp 1f
@@ -115,7 +115,7 @@ stop:
jms flush
las
sma
sys save
sys exit " XXX replaced for now: sys save
sys exit
flush: 0
@@ -132,7 +132,7 @@ flush: 0
lac obufp
dac 1f
lac .fout
sys write; 1: :.; ..
sys write; 1: ..; ..
lac obufp
dac cobufp
dzm oflg
+9
View File
@@ -0,0 +1,9 @@
main $(
write('He');
write('ll');
write('o,');
write(' W');
write('or');
write('ld');
write('!*n');
$)
+40
View File
@@ -0,0 +1,40 @@
.main: .+1
s 2
x .write
n 2 " etcop mark
n 5 " etcop litrl
36965
n 3 " etcop call
x .write
n 2 " etcop mark
n 5 " etcop litrl
55404
n 3 " etcop call
x .write
n 2 " etcop mark
n 5 " etcop litrl
56876
n 3 " etcop call
x .write
n 2 " etcop mark
n 5 " etcop litrl
16471
n 3 " etcop call
x .write
n 2 " etcop mark
n 5 " etcop litrl
56946
n 3 " etcop call
x .write
n 2 " etcop mark
n 5 " etcop litrl
55396
n 3 " etcop call
x .write
n 2 " etcop mark
n 5 " etcop litrl
16906
n 3 " etcop call
x .flush
n 1 " etcop mcall
n 7 " etcop retrn