YOU SEE THIS?
- AttentionKMartShoppers
- Ultimate Member
- Posts: 2163
- Joined: Tue Feb 15, 2005 8:37 pm
- Christian: Yes
- Sex: Male
- Location: Austin, Texas
- Contact:
YOU SEE THIS?
.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
"My actions prove that God takes care of idiots."
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
- AttentionKMartShoppers
- Ultimate Member
- Posts: 2163
- Joined: Tue Feb 15, 2005 8:37 pm
- Christian: Yes
- Sex: Male
- Location: Austin, Texas
- Contact:
That is LC3 assembly language, and you know what it does? It adds 4X4 matrices.
"My actions prove that God takes care of idiots."
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
- BGoodForGoodSake
- Ultimate Member
- Posts: 2127
- Joined: Mon Aug 29, 2005 9:44 am
- Christian: No
- Location: Washington D.C.
.ORIG X3000
LD R2, CHANGE;FFD0 in R2
LD R4, CHANGE2;0030 in R4
AND R6, R6, #0;
ADD R1, R5, #1;1 in R1
LOOP ADD R5, R1, #0; 1 in R5
BRz END;if R5 = 0 then go to END
TRAP x23;print a prompt on the screen and read a single;character from the keyboard its ascii code í R0
ADD R1, R0, R2;ASCII prompt + ffd0 í R1
ADD R7, R1, #-3;result in R1 - 3 í R7
BRz GETNUM;if R7 = 0 go to GETNUM
ADD R7, R1, #-6;result in R1 -3 í R7
BRz GETNUM;if R7 = 0 go to GETNUM
ADD R7, R1, #-9;result in R1 -3 í R7
BRz GETNUM;if R7 = 0 go to GETNUM
BR ENDIF;Go to ENDIF
GETNUM ADD R6, R6, R1;Ascii value goes to R6
ENDIF BR LOOP;Go to LOOP
END AND R1, R1, #0;clear R1
AND R2, R2, #0;clear R2
AND R3, R3, #0;clear R3
ADD R1, R6, #0;Ascci value goes to R1
BRz RESULT1;if R1 = 0 go to RESULT1
BRp RESULT2;if R2 = positive # go to RESULT2
;
RESULT1 LEA R0, ERROR;address of ERROR í R0
TRAP x22;write a string of ascii characters to the console
TRAP x25;halt execution and print a message on the console
;
RESULT2 LEA R0, MESSAGE;address of MESSAGE í R0
TRAP x22;write a string of ascii characters to the console
ADD R1, R6, #-9;
BRnz RESULT3;If R1 = - or 0 go to RESULT3
BR RESULT4;Go to RESULT4
;
RESULT3 ADD R6, R6, R4;ASCII value + 0030 í R6
ADD R0, R6, #0;what is in R6 í R0
TRAP x21;Write a character in R0 to the console display
TRAP x25;halt execution and print a message on the console
;
RESULT4 ADD R0, R6, #0; what is in R6 í R0
WHILE ADD R0, R0, #-10;what is in R6 - 10 í R0
;
BRzp DOBODY;if R0 = 0 or positive go to DOBODY
BR ENDWHILE;go to ENDWHILE
;
DOBODY ADD R3, R3, #1;increment R3
BR WHILE;go to WHILE
;
ENDWHILE ADD R2, R0, #0;result of R0 goes into R2
ADD R2, R2, #10;
ADD R0, R3, R4;
TRAP x21;Write a character in R0 to the console display
;
ADD R0, R2, R4;
TRAP x21;Write a character in R0 to the console display
TRAP x25;halt execution and print a message on the console
;
MESSAGE .STRINGZ " The sum of the multiples of three is:"
ERROR .STRINGZ "There are no multiples of three in the list"
CHANGE .FILL XFFD0
CHANGE2 .FILL x0030
.END
LD R2, CHANGE;FFD0 in R2
LD R4, CHANGE2;0030 in R4
AND R6, R6, #0;
ADD R1, R5, #1;1 in R1
LOOP ADD R5, R1, #0; 1 in R5
BRz END;if R5 = 0 then go to END
TRAP x23;print a prompt on the screen and read a single;character from the keyboard its ascii code í R0
ADD R1, R0, R2;ASCII prompt + ffd0 í R1
ADD R7, R1, #-3;result in R1 - 3 í R7
BRz GETNUM;if R7 = 0 go to GETNUM
ADD R7, R1, #-6;result in R1 -3 í R7
BRz GETNUM;if R7 = 0 go to GETNUM
ADD R7, R1, #-9;result in R1 -3 í R7
BRz GETNUM;if R7 = 0 go to GETNUM
BR ENDIF;Go to ENDIF
GETNUM ADD R6, R6, R1;Ascii value goes to R6
ENDIF BR LOOP;Go to LOOP
END AND R1, R1, #0;clear R1
AND R2, R2, #0;clear R2
AND R3, R3, #0;clear R3
ADD R1, R6, #0;Ascci value goes to R1
BRz RESULT1;if R1 = 0 go to RESULT1
BRp RESULT2;if R2 = positive # go to RESULT2
;
RESULT1 LEA R0, ERROR;address of ERROR í R0
TRAP x22;write a string of ascii characters to the console
TRAP x25;halt execution and print a message on the console
;
RESULT2 LEA R0, MESSAGE;address of MESSAGE í R0
TRAP x22;write a string of ascii characters to the console
ADD R1, R6, #-9;
BRnz RESULT3;If R1 = - or 0 go to RESULT3
BR RESULT4;Go to RESULT4
;
RESULT3 ADD R6, R6, R4;ASCII value + 0030 í R6
ADD R0, R6, #0;what is in R6 í R0
TRAP x21;Write a character in R0 to the console display
TRAP x25;halt execution and print a message on the console
;
RESULT4 ADD R0, R6, #0; what is in R6 í R0
WHILE ADD R0, R0, #-10;what is in R6 - 10 í R0
;
BRzp DOBODY;if R0 = 0 or positive go to DOBODY
BR ENDWHILE;go to ENDWHILE
;
DOBODY ADD R3, R3, #1;increment R3
BR WHILE;go to WHILE
;
ENDWHILE ADD R2, R0, #0;result of R0 goes into R2
ADD R2, R2, #10;
ADD R0, R3, R4;
TRAP x21;Write a character in R0 to the console display
;
ADD R0, R2, R4;
TRAP x21;Write a character in R0 to the console display
TRAP x25;halt execution and print a message on the console
;
MESSAGE .STRINGZ " The sum of the multiples of three is:"
ERROR .STRINGZ "There are no multiples of three in the list"
CHANGE .FILL XFFD0
CHANGE2 .FILL x0030
.END
It is not length of life, but depth of life. -- Ralph Waldo Emerson
- AttentionKMartShoppers
- Ultimate Member
- Posts: 2163
- Joined: Tue Feb 15, 2005 8:37 pm
- Christian: Yes
- Sex: Male
- Location: Austin, Texas
- Contact:
You had to program on that evil simulator as well?
"My actions prove that God takes care of idiots."
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
- BGoodForGoodSake
- Ultimate Member
- Posts: 2127
- Joined: Mon Aug 29, 2005 9:44 am
- Christian: No
- Location: Washington D.C.
- AttentionKMartShoppers
- Ultimate Member
- Posts: 2163
- Joined: Tue Feb 15, 2005 8:37 pm
- Christian: Yes
- Sex: Male
- Location: Austin, Texas
- Contact:
SWEEEEET
"My actions prove that God takes care of idiots."
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
- AttentionKMartShoppers
- Ultimate Member
- Posts: 2163
- Joined: Tue Feb 15, 2005 8:37 pm
- Christian: Yes
- Sex: Male
- Location: Austin, Texas
- Contact:
What I don't get is why does everyone start the program at x3000
"My actions prove that God takes care of idiots."
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
- BGoodForGoodSake
- Ultimate Member
- Posts: 2127
- Joined: Mon Aug 29, 2005 9:44 am
- Christian: No
- Location: Washington D.C.
you don't have to you can start at x6000 or just leave it blank.AttentionKMartShoppers wrote:What I don't get is why does everyone start the program at x3000
Older computers used to reserve the lower memory addresses.
If you leave it blank the program will run in the first available memory space.
It is not length of life, but depth of life. -- Ralph Waldo Emerson
- AttentionKMartShoppers
- Ultimate Member
- Posts: 2163
- Joined: Tue Feb 15, 2005 8:37 pm
- Christian: Yes
- Sex: Male
- Location: Austin, Texas
- Contact:
Ah, so it's just tradition
"My actions prove that God takes care of idiots."
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous
He occasionally stumbled over the truth, but hastily picked himself up and hurried on as if nothing had happened.
- On Stanley Baldwin
-Winston Churchill
An atheist can't find God for the same reason a criminal can't find a police officer.
You need to start asking out girls so that you can get used to the rejections.
-Anonymous