Skip to content

Commit

Permalink
add 组成原理课程设计
Browse files Browse the repository at this point in the history
  • Loading branch information
qiziqiang committed Feb 19, 2019
1 parent 7bde8ed commit 4ab743b
Show file tree
Hide file tree
Showing 15 changed files with 356 additions and 0 deletions.
Binary file not shown.
7 changes: 7 additions & 0 deletions 【20190104】组成原理课程设计/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 组成原理课程设计

文件夹大小:7.93 MB

## 简介

及格线要求无符号4位乘4位和8位处以四位,这里实现了无符号8位乘8位和无符号16位处以8位。这个课程设计注意早点做完计算机模拟然后上板子的时候早点去占个坑,实验室挺多板子不好用。
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
MOV R0,#00H
MOV R1,#09H
MOV R2,#09H
LOOP1: SUB R2,#00H
JZ LOOP3
MOV A,R2
AND A,#01H
JZ LOOP2
MOV A,R1
ADD R0,A
LOOP2: SHL R1
SHR R2
JMP LOOP1
LOOP3: END


MOV R0,#86H
MOV R1,#09H
MOV R2,#00H
MOV R3,#05H
MOV A,R1
AND A,#0FFH
JZ LOOP3
SHL R1
SHL R1
SHL R1
SHL R1
MOV A,R0
PUSH A
MOV A,R1
SUB R0,A
JC LOOP1
JMP LOOP3
LOOP1: POP A
MOV R0,A
SHL R2
SHR R1
SUB R3,#01H
JZ LOOP4
MOV A,R0
PUSH A
MOV A,R1
SUB R0,A
JC LOOP1
LOOP2: SHL R2
SHR R1
ADD R2,#01H
SUB R3,#01H
JZ LOOP4
MOV A,R0
PUSH A
MOV A,R1
SUB R0,A
JC LOOP1
JMP LOOP2
LOOP3: MOV R2,#0FFH
LOOP4: END
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions 【20190104】组成原理课程设计/code/CHENGFA8.ASM
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
MOV R0,#00H
MOV R1,#88H
MOV R2,#81H
MOV R3,#80H

LOOP:
MOV A,R1
AND A,#01H
JZ NEXT
MOV A,R0
ADD A,R2
MOV R0,A
AND A,#01H
JZ NEXT1
SHR R0
SHR R1
ADD R1,#80H
JMP NEXT2
NEXT1:
SHR R0
SHR R1
JMP NEXT2

NEXT:
MOV A,R0
AND A,#01H
JZ NEXT1
SHR R0
SHR R1
ADD R1,#80H
JMP NEXT2

NEXT2:
SHR R3
ADD R3,#00H
JZ NEXTEND
JMP LOOP
NEXTEND:
JMP NEXTEND
Binary file not shown.
116 changes: 116 additions & 0 deletions 【20190104】组成原理课程设计/code/CHUFA8.ASM
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
MOV R0,#77H
MOV R1,#44H
MOV R2,#00H
MOV R3,#89H

MOV A,R2
PUSH A
;YIWEI
MOV A,R3
MOV R2,A
ADD R2,#00H
JZ LOOPERR
MOV R3,#00H
YIWEI:
MOV A,R0
SUB A,R2
JC LOOP4
SHL R2
JMP YIWEI


LOOP1:
MOV A,R2
AND A,#01H
JZ CSYY1
SHR R2
SHR R3
ADD R3,#80H
JMP SZY
CSYY1:
SHR R2
SHR R3
SZY:
POP A
RL A
PUSH A

MOV A,R2
ADD A,#00H
JZ ENDJIA
JMP LOOP2

LOOP2:
MOV A,R3
ADD R1,A
JC YICHU
JMP JIAFA
YICHU:
ADD R0,#01H
JIAFA:
MOV A,R2
ADD R0,A

MOV A,R0
AND A,#80H
JZ LOOP3
JMP LOOP1

LOOP3:
MOV A,R2
AND A,#01H
JZ CSYY2
SHR R2
SHR R3
ADD R3,#80H
JMP SJY
CSYY2:
SHR R2
SHR R3
SJY:
POP A
RL A
ADD A,#01H
PUSH A

MOV A,R2
ADD A,#00H
JZ ENDJIAN
JMP LOOP4

LOOP4:
MOV A,R3
SUB R1,A
JC JIEWEI2
JMP JIANFA2
JIEWEI2:
SUB R0,#01H
JIANFA2:
MOV A,R2
SUB R0,A

MOV A,R0
AND A,#80H
JZ LOOP3
JMP LOOP1

LOOPERR:
MOV R0,#0FFH
MOV R1,#0FFH
JMP ERREND
ENDJIA:
POP A
RL A
ADD A,#01H
PUSH A
JMP LOOPEND
ENDJIAN:
POP A
RL A
PUSH A
JMP LOOPEND
LOOPEND:
POP A
MOV R0,A
ERREND:
END
Binary file not shown.
137 changes: 137 additions & 0 deletions 【20190104】组成原理课程设计/code/CHUFA82.ASM
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
MOV R0,#77H
MOV R1,#44H
MOV R2,#00H
MOV R3,#89H

MOV A,R2
PUSH A
;YIWEI
MOV A,R3
MOV R2,A
ADD R2,#00H
JZ LOOPERR
MOV R3,#00H
YIWEI:
MOV A,R0
SUB A,R2
JC LOOP4
SHL R2
JMP YIWEI


LOOP1:
MOV A,R2
AND A,#01H
JZ CSYY1
SHR R2
SHR R3
ADD R3,#80H
JMP SZY
CSYY1:
SHR R2
SHR R3
SZY:
POP A
RL A
PUSH A

MOV A,R2
ADD A,#00H
JZ ENDJIA
JMP LOOP2

LOOP2:
MOV A,R3
ADD R1,A
JC YICHU
JMP JIAFA
YICHU:
ADD R0,#01H
JIAFA:
MOV A,R2
ADD R0,A

MOV A,R0
AND A,#80H
JZ LOOP3
JMP LOOP1

LOOP3:
MOV A,R2
AND A,#01H
JZ CSYY2
SHR R2
SHR R3
ADD R3,#80H
JMP SJY
CSYY2:
SHR R2
SHR R3
SJY:
POP A
RL A
ADD A,#01H
PUSH A

MOV A,R2
ADD A,#00H
JZ ENDJIAN
JMP LOOP4

LOOP4:
MOV A,R3
SUB R1,A
JC JIEWEI2
JMP JIANFA2
JIEWEI2:
SUB R0,#01H
JIANFA2:
MOV A,R2
SUB R0,A

MOV A,R0
AND A,#80H
JZ LOOP3
JMP LOOP1

LOOPERR:
MOV R0,#0FFH
MOV R1,#0FFH
JMP ERREND
ENDJIA:
POP A
RL A
ADD A,#01H
PUSH A
JMP LOOPEND

ENDJIAN:
MOV A,R0
AND A,#01H
JZ JIEWEI3
JMP JIANFA3
JIEWEI3:
POP A
RL A
PUSH A
JMP LOOPEND
JIANFA3:
MOV A,R3
SUB R1,A
JC JIEWEI4
JMP JIANFA4
JIEWEI4:
SUB R0,#01H
JIANFA4:
MOV A,R2
SUB R0,A
POP A
RL A
ADD A,#01H
PUSH A
JMP LOOPEND
LOOPEND:
POP A
MOV R0,A
ERREND:
JMP ERREND

0 comments on commit 4ab743b

Please sign in to comment.