YOU SEE THIS?
Posted: Thu Nov 10, 2005 11:57 pm
.orig x3000
AND R0, R0, #0
AND R1, R1, #0
AND R2, R2, #0
AND R3, R3, #0
LD R7, z3051 ; loads R7 with beginning of first matrix
ADD R6, R7, #4 ;loads R6 with beginning of second matrix
LDR R5, R7, #-1 ; loads number of matrices into R5
ADD R5, R5, #-1 ; decrements matrix counter by one
BRn None ; puts x3200-x3203 (one matrix) to zero.
Brz Store ; puts first matrix into x3200-x3203.
BitOne AND R2, R2, #0
LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, z000f ;loads first bit breaker
AND R0, R0, R3 ; separates first bit in R0
AND R1, R1, R3 ; separates first bit in R1
ADD R0, R0, R1 ; adds bits, places them into R0
LD R1, z00f0 ; loads first bit overflow checker/next bit checker
AND R1, R1, R0 ; checks for overflow
BRz Update1 ; no overflow, loads R0 (bit total) with running total of line
ADD R0, R3, #0 ; if overflow, put an F in R0
Update1 ADD R2, R0, R2
BitTwo LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, z00f0 ;loads first bit breaker
AND R0, R0, R3 ; separates first bit
AND R1, R1, R3 ; separates first bit
ADD R0, R0, R1 ; adds bits
LD R1, z0f00 ; loads first bit overflow checker/next bit checker
AND R1, R1, R0 ; checks for overflow
BRz Update2
ADD R0, R3, #0 ; if overflow, put an F0 in R0
Update2 ADD R2, R0, R2
BitThree LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, z0f00 ;loads first bit breaker
AND R0, R0, R3 ; separates first bit
AND R1, R1, R3 ; separates first bit
ADD R0, R0, R1 ; adds bits
LD R1, zf000 ; loads first bit overflow checker/next bit checker
AND R1, R0, R1 ; checks for overflow
BRz Update3
ADD R0, R3, #0 ; if overflow, put an F00 in R0
Update3 ADD R2, R0, R2
BitFour LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, zf000 ;loads first bit breaker
AND R0, R0, R3 ; separates first bit
Brn Negative
AND R1, R1, R3
Brn PosNeg
ADD R0, R0, R1
Br Update4
Negative AND R1, R1, R3 ; separate second bit
BRp PosNeg
BRn Neg4thBit
PosNeg AND R1, R1, R3 ; separate second bit
Brn Neg4thBit
ADD R0, R0, R1
Br Update4
Neg4thBit ADD R0, R3, #0
Update4 ADD R2, R0, R2
STR R2, R7, #0 ;loads matrix line into memory
ADD R6, R6, #1 ;increments second matrix counter by one
ADD R7, R7, #1 ;increments first matrix counter by one
AND R4, R7, #15 ;checks to see if an entire matrix has been added
ADD R4, R4, #-5 ;checks to see if an entire matrix has been added
Brz Restart
Brn BitOne
Restart ADD R7, R7, #-5 ; sets first matrix counter to x3101 again
ADD R5, R5, #-1 ;decreases matrix counter by 1
Brz Store
Brp BitOne
Store LD R7, z3200; loads beginning of answer location
LD R6, z3051; loads beginning of matrix
LDR R0, R6, #0
LDR R1, R6 #1
LDR R2, R6 #2
LDR R3, R6 #3
Br None
.BLKW 18
None STR R0, R7, #0
STR R1, R7, #1
STR R2, R7, #2
STR R3, R7, #3
HALT
z3051 .fill x3051 ;for loading matrices as well as #of matrices
z3200 .fill x3200 ;for addressing answer's location
z000f .fill x000f ;for splitting 4 bit hex
z00f0 .fill x00f0 ; for splitting 4 bit hex
z0f00 .fill x0f00 ; for splitting 4 bit hex
zf000 .fill xf000 ; for splitting 4 bit hex
.end
AND R0, R0, #0
AND R1, R1, #0
AND R2, R2, #0
AND R3, R3, #0
LD R7, z3051 ; loads R7 with beginning of first matrix
ADD R6, R7, #4 ;loads R6 with beginning of second matrix
LDR R5, R7, #-1 ; loads number of matrices into R5
ADD R5, R5, #-1 ; decrements matrix counter by one
BRn None ; puts x3200-x3203 (one matrix) to zero.
Brz Store ; puts first matrix into x3200-x3203.
BitOne AND R2, R2, #0
LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, z000f ;loads first bit breaker
AND R0, R0, R3 ; separates first bit in R0
AND R1, R1, R3 ; separates first bit in R1
ADD R0, R0, R1 ; adds bits, places them into R0
LD R1, z00f0 ; loads first bit overflow checker/next bit checker
AND R1, R1, R0 ; checks for overflow
BRz Update1 ; no overflow, loads R0 (bit total) with running total of line
ADD R0, R3, #0 ; if overflow, put an F in R0
Update1 ADD R2, R0, R2
BitTwo LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, z00f0 ;loads first bit breaker
AND R0, R0, R3 ; separates first bit
AND R1, R1, R3 ; separates first bit
ADD R0, R0, R1 ; adds bits
LD R1, z0f00 ; loads first bit overflow checker/next bit checker
AND R1, R1, R0 ; checks for overflow
BRz Update2
ADD R0, R3, #0 ; if overflow, put an F0 in R0
Update2 ADD R2, R0, R2
BitThree LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, z0f00 ;loads first bit breaker
AND R0, R0, R3 ; separates first bit
AND R1, R1, R3 ; separates first bit
ADD R0, R0, R1 ; adds bits
LD R1, zf000 ; loads first bit overflow checker/next bit checker
AND R1, R0, R1 ; checks for overflow
BRz Update3
ADD R0, R3, #0 ; if overflow, put an F00 in R0
Update3 ADD R2, R0, R2
BitFour LDR R0, R7, #0 ;loads R0 with first matrix
LDR R1, R6, #0 ;loads R1 with second matrix
LD R3, zf000 ;loads first bit breaker
AND R0, R0, R3 ; separates first bit
Brn Negative
AND R1, R1, R3
Brn PosNeg
ADD R0, R0, R1
Br Update4
Negative AND R1, R1, R3 ; separate second bit
BRp PosNeg
BRn Neg4thBit
PosNeg AND R1, R1, R3 ; separate second bit
Brn Neg4thBit
ADD R0, R0, R1
Br Update4
Neg4thBit ADD R0, R3, #0
Update4 ADD R2, R0, R2
STR R2, R7, #0 ;loads matrix line into memory
ADD R6, R6, #1 ;increments second matrix counter by one
ADD R7, R7, #1 ;increments first matrix counter by one
AND R4, R7, #15 ;checks to see if an entire matrix has been added
ADD R4, R4, #-5 ;checks to see if an entire matrix has been added
Brz Restart
Brn BitOne
Restart ADD R7, R7, #-5 ; sets first matrix counter to x3101 again
ADD R5, R5, #-1 ;decreases matrix counter by 1
Brz Store
Brp BitOne
Store LD R7, z3200; loads beginning of answer location
LD R6, z3051; loads beginning of matrix
LDR R0, R6, #0
LDR R1, R6 #1
LDR R2, R6 #2
LDR R3, R6 #3
Br None
.BLKW 18
None STR R0, R7, #0
STR R1, R7, #1
STR R2, R7, #2
STR R3, R7, #3
HALT
z3051 .fill x3051 ;for loading matrices as well as #of matrices
z3200 .fill x3200 ;for addressing answer's location
z000f .fill x000f ;for splitting 4 bit hex
z00f0 .fill x00f0 ; for splitting 4 bit hex
z0f00 .fill x0f00 ; for splitting 4 bit hex
zf000 .fill xf000 ; for splitting 4 bit hex
.end