Commit 4e770177 authored by Kai Rese's avatar Kai Rese
Browse files

Replace tabulators with whitespaces

parent 2dfa1549
......@@ -3,51 +3,51 @@
# new number against all already found primes.
# reg0 -> function parameter & return value
alias reg0 fnParam0
alias reg0 retVal
alias reg0 fnParam0
alias reg0 retVal
# reg1 -> function parameter
alias reg0 fnParam1
alias reg0 fnParam1
alias reg7 testNum
alias reg8 numLeft
alias reg9 listIter
alias reg7 testNum
alias reg8 numLeft
alias reg9 listIter
# points beyond the last element
alias reg10 listEnd
alias reg11 prime
alias reg12 lenLeft
alias reg10 listEnd
alias reg11 prime
alias reg12 lenLeft
alias reg13 retAddr
alias reg13 retAddr
:Initialization
add numLeft 1
add testNum 1
shiftl numLeft 11
target listEnd :ListStart
add numLeft 1
add testNum 1
shiftl numLeft 11
target listEnd :ListStart
# foot controlled loop
:FindPrimeBegin
add testNum 1
target listIter :ListStart
add testNum 1
target listIter :ListStart
# head controlled loop
:CheckPrimeBegin
sub lenLeft listEnd listIter
bzero lenLeft :CheckPrimeEnd
load fnParam0 listIter
add fnParam1 testNum
target retAddr +3
store retAddr sp
add sp -1
jump :Modulo
sub lenLeft listEnd listIter
bzero lenLeft :CheckPrimeEnd
load fnParam0 listIter
add fnParam1 testNum
target retAddr +3
store retAddr sp
add sp -1
jump :Modulo
# Not a prime, next number
bzero retVal :FindPrimeBegin
add listIter 1
jump :CheckPrimeBegin
bzero retVal :FindPrimeBegin
add listIter 1
jump :CheckPrimeBegin
:CheckPrimeEnd
add numLeft -1
bzero numLeft :FindPrimeEnd
jump :FindPrimeBegin
add numLeft -1
bzero numLeft :FindPrimeEnd
jump :FindPrimeBegin
:FindPrimeEnd
stop
......@@ -58,48 +58,48 @@ stop
# the divisor until it's at the original value again. The remainder is
# our result.
# This does: reg0 = reg0 % reg1
alias reg0 remainder
alias reg1 divisor
alias reg2 dividend
alias reg3 shftCnt
alias reg0 remainder
alias reg1 divisor
alias reg2 dividend
alias reg3 shftCnt
:Modulo
add dividend fnParam0 zero
add shftCnt zero zero
add dividend fnParam0 zero
add shftCnt zero zero
# loop
:ShiftLeftBegin
shiftl divisor
shiftl divisor
# use retVal as temp value
sub remainder dividend divisor
bneg remainder :ShiftLeftEnd
add shftCnt 1
jump :ShiftLeftBegin
sub remainder dividend divisor
bneg remainder :ShiftLeftEnd
add shftCnt 1
jump :ShiftLeftBegin
:ShiftLeftEnd
# undo last step
shiftr divisor
add remainder dividend zero
shiftr divisor
add remainder dividend zero
# loop
:SubtrationBegin
sub remainder divisor
add shftCnt -1
bneg remainder :Undo
sub remainder divisor
add shftCnt -1
bneg remainder :Undo
:UndoReturn
bneg shftCnt :SubtractionEnd
shiftr divisor
jump :SubtrationBegin
bneg shftCnt :SubtractionEnd
shiftr divisor
jump :SubtrationBegin
:SubtractionEnd
add sp 1
load retAddr sp
jump retAddr
add sp 1
load retAddr sp
jump retAddr
# if
:Undo
add remainder divisor
jump :UndoReturn
add remainder divisor
jump :UndoReturn
# begin of data section
:ListStart
......@@ -176,51 +176,51 @@ Currently, the only way to get information out is by reading the register state
# new number against all already found primes.
# reg0 -> function parameter & return value
alias reg0 fnParam0
alias reg0 retVal
alias reg0 fnParam0
alias reg0 retVal
# reg1 -> function parameter
alias reg0 fnParam1
alias reg0 fnParam1
alias reg7 testNum
alias reg8 numLeft
alias reg9 listIter
alias reg7 testNum
alias reg8 numLeft
alias reg9 listIter
# points beyond the last element
alias reg10 listEnd
alias reg11 prime
alias reg12 lenLeft
alias reg10 listEnd
alias reg11 prime
alias reg12 lenLeft
alias reg13 retAddr
alias reg13 retAddr
:Initialization
add numLeft 1
add testNum 1
shiftl numLeft 11
target listEnd :ListStart
add numLeft 1
add testNum 1
shiftl numLeft 11
target listEnd :ListStart
# foot controlled loop
:FindPrimeBegin
add testNum 1
target listIter :ListStart
add testNum 1
target listIter :ListStart
# head controlled loop
:CheckPrimeBegin
sub lenLeft listEnd listIter
bzero lenLeft :CheckPrimeEnd
load fnParam0 listIter
add fnParam1 testNum
target retAddr +3
store retAddr sp
add sp -1
jump :Modulo
sub lenLeft listEnd listIter
bzero lenLeft :CheckPrimeEnd
load fnParam0 listIter
add fnParam1 testNum
target retAddr +3
store retAddr sp
add sp -1
jump :Modulo
# Not a prime, next number
bzero retVal :FindPrimeBegin
add listIter 1
jump :CheckPrimeBegin
bzero retVal :FindPrimeBegin
add listIter 1
jump :CheckPrimeBegin
:CheckPrimeEnd
add numLeft -1
bzero numLeft :FindPrimeEnd
jump :FindPrimeBegin
add numLeft -1
bzero numLeft :FindPrimeEnd
jump :FindPrimeBegin
:FindPrimeEnd
stop
......@@ -231,48 +231,48 @@ stop
# the divisor until it's at the original value again. The remainder is
# our result.
# This does: reg0 = reg0 % reg1
alias reg0 remainder
alias reg1 divisor
alias reg2 dividend
alias reg3 shftCnt
alias reg0 remainder
alias reg1 divisor
alias reg2 dividend
alias reg3 shftCnt
:Modulo
add dividend fnParam0 zero
add shftCnt zero zero
add dividend fnParam0 zero
add shftCnt zero zero
# loop
:ShiftLeftBegin
shiftl divisor
shiftl divisor
# use retVal as temp value
sub remainder dividend divisor
bneg remainder :ShiftLeftEnd
add shftCnt 1
jump :ShiftLeftBegin
sub remainder dividend divisor
bneg remainder :ShiftLeftEnd
add shftCnt 1
jump :ShiftLeftBegin
:ShiftLeftEnd
# undo last step
shiftr divisor
add remainder dividend zero
shiftr divisor
add remainder dividend zero
# loop
:SubtrationBegin
sub remainder divisor
add shftCnt -1
bneg remainder :Undo
sub remainder divisor
add shftCnt -1
bneg remainder :Undo
:UndoReturn
bneg shftCnt :SubtractionEnd
shiftr divisor
jump :SubtrationBegin
bneg shftCnt :SubtractionEnd
shiftr divisor
jump :SubtrationBegin
:SubtractionEnd
add sp 1
load retAddr sp
jump retAddr
add sp 1
load retAddr sp
jump retAddr
# if
:Undo
add remainder divisor
jump :UndoReturn
add remainder divisor
jump :UndoReturn
# begin of data section
:ListStart
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment