Compare commits
No commits in common. "c305a8bdb4322de64ea338fb32730d094380eea2" and "9ef89d877287decb55f062ab398b79bf33f143eb" have entirely different histories.
c305a8bdb4
...
9ef89d8772
4 changed files with 14 additions and 33 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -3,5 +3,4 @@ Primer/
|
||||||
#Ignorej sictools
|
#Ignorej sictools
|
||||||
sictools.jar
|
sictools.jar
|
||||||
#ignorej ukaze za sic/xe
|
#ignorej ukaze za sic/xe
|
||||||
Appendix_A_thru_C.pdf
|
Appendix_A_thru_C.pdf
|
||||||
rek_sum.asm
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
10
|
1
|
||||||
5
|
5
|
||||||
6
|
7
|
||||||
0
|
0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
prog START 0
|
prog START 0
|
||||||
JSUB sinit
|
+JSUB sinit
|
||||||
LDA #5
|
LDA #5
|
||||||
JSUB fa
|
JSUB fa
|
||||||
WD #1
|
WD #1
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,16 @@
|
||||||
rek START 0
|
rek START 0
|
||||||
JSUB sinit
|
|
||||||
LDT #10
|
|
||||||
|
|
||||||
loop JSUB read . Pretvorimo iz ASCII v stevilko
|
loop RD #0xFA
|
||||||
COMP #1 . Če je (A) <= 1 končamo, ker 0!=1!=1
|
COMP #1
|
||||||
JLT halt
|
JLT halt
|
||||||
JSUB fa . Sicer izračunamo (A)!
|
JSUB fa
|
||||||
WD #1 . Zapišemo na std izhod
|
WD #1
|
||||||
CLEAR B
|
CLEAR A
|
||||||
CLEAR A
|
J loop
|
||||||
J loop . Gremo prebrat naslednji vhod
|
|
||||||
|
|
||||||
halt J halt
|
halt J halt
|
||||||
|
|
||||||
read RD #0xFA
|
fa STL @stkp
|
||||||
COMP #0xA
|
|
||||||
JEQ rExit . Če preberemo newline gremo na izhod
|
|
||||||
SUB #0x30 . Sicer iz ascii kode dobimo stevko
|
|
||||||
LDB tmp
|
|
||||||
MULR T, B . tmp *= 10
|
|
||||||
ADDR A, B . tmp += A
|
|
||||||
STB tmp
|
|
||||||
J read
|
|
||||||
|
|
||||||
rExit LDA tmp
|
|
||||||
LDB #0
|
|
||||||
STB tmp
|
|
||||||
RSUB
|
|
||||||
|
|
||||||
fa STL @stkp
|
|
||||||
JSUB spush
|
JSUB spush
|
||||||
STB @stkp
|
STB @stkp
|
||||||
JSUB spush
|
JSUB spush
|
||||||
|
|
@ -41,7 +23,7 @@ fa STL @stkp
|
||||||
MULR B, A
|
MULR B, A
|
||||||
|
|
||||||
|
|
||||||
faExit JSUB spop
|
faExit JSUB spop
|
||||||
LDB @stkp
|
LDB @stkp
|
||||||
JSUB spop
|
JSUB spop
|
||||||
LDL @stkp
|
LDL @stkp
|
||||||
|
|
@ -73,5 +55,5 @@ spop . stkp--
|
||||||
stkp WORD 0
|
stkp WORD 0
|
||||||
stk RESW 1000
|
stk RESW 1000
|
||||||
stkA WORD 0
|
stkA WORD 0
|
||||||
tmp WORD 0
|
|
||||||
END rek
|
END rek
|
||||||
Loading…
Add table
Add a link
Reference in a new issue