first commit
This commit is contained in:
BIN
Lab/Lab3/21281280_柯劲帆_第3次实验_8255A实验.zip
Executable file
BIN
Lab/Lab3/21281280_柯劲帆_第3次实验_8255A实验.zip
Executable file
Binary file not shown.
BIN
Lab/Lab3/21281280_柯劲帆_第3次实验_8255A实验/21281280_柯劲帆_第3次实验_8255A实验.pdf
Executable file
BIN
Lab/Lab3/21281280_柯劲帆_第3次实验_8255A实验/21281280_柯劲帆_第3次实验_8255A实验.pdf
Executable file
Binary file not shown.
BIN
Lab/Lab3/21281280_柯劲帆_第3次实验_8255A实验/任务一演示.mp4
Executable file
BIN
Lab/Lab3/21281280_柯劲帆_第3次实验_8255A实验/任务一演示.mp4
Executable file
Binary file not shown.
58
Lab/Lab3/material/.$task1.drawio.bkp
Executable file
58
Lab/Lab3/material/.$task1.drawio.bkp
Executable file
@@ -0,0 +1,58 @@
|
||||
<mxfile host="Electron" modified="2023-05-06T14:49:58.247Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="gX_Ezp9wm0UEAzm5YIdF" version="21.2.8" type="device">
|
||||
<diagram name="第 1 页" id="3iH2U7M1F-pdt02PPPwc">
|
||||
<mxGraphModel dx="824" dy="768" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-1" target="LjnWuoztt-sNhJGu1yFB-2">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-1" value="程序开始" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="160" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-2" target="LjnWuoztt-sNhJGu1yFB-3">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-2" value="向命令口发送命令,将PA口置为1方式输入,PB口置为0方式输出" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="240" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-3" target="LjnWuoztt-sNhJGu1yFB-4">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-3" value="将PB口输出全零,灭掉所有LED灯" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="320" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-4" target="LjnWuoztt-sNhJGu1yFB-5">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-4" value="通过PA口获取各个开关状态到AL" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="400" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-5" target="LjnWuoztt-sNhJGu1yFB-6">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-5" value="向PB口输出AL" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="480" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-6" target="LjnWuoztt-sNhJGu1yFB-7">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-6" value="进入延时子程序,延时一小段时间" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="560" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="LjnWuoztt-sNhJGu1yFB-7" target="LjnWuoztt-sNhJGu1yFB-5">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="420" y="700" />
|
||||
<mxPoint x="320" y="700" />
|
||||
<mxPoint x="320" y="500" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-7" value="使用ROR指令AL向右移一位" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="640" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
58
Lab/Lab3/material/.$task1.drawio.dtmp
Executable file
58
Lab/Lab3/material/.$task1.drawio.dtmp
Executable file
@@ -0,0 +1,58 @@
|
||||
<mxfile host="Electron" modified="2023-05-06T15:21:41.040Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="wLXNmcTcuL1nMTwf1z0g" version="21.2.8" type="device">
|
||||
<diagram name="第 1 页" id="3iH2U7M1F-pdt02PPPwc">
|
||||
<mxGraphModel dx="841" dy="768" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-1" target="LjnWuoztt-sNhJGu1yFB-2" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-1" value="程序开始" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="160" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-2" target="LjnWuoztt-sNhJGu1yFB-3" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-2" value="向命令口发送命令,将PA口置为0方式输入,PB口置为0方式输出" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="320" y="240" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-3" target="LjnWuoztt-sNhJGu1yFB-4" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-3" value="将PB口输出全零,灭掉所有LED灯" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="320" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-4" target="LjnWuoztt-sNhJGu1yFB-5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-4" value="通过PA口获取各个开关状态到AL" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="400" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-5" target="LjnWuoztt-sNhJGu1yFB-6" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-5" value="向PB口输出AL" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="480" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-6" target="LjnWuoztt-sNhJGu1yFB-7" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-6" value="进入延时子程序,延时一小段时间" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="560" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-7" target="LjnWuoztt-sNhJGu1yFB-5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="420" y="700" />
|
||||
<mxPoint x="320" y="700" />
|
||||
<mxPoint x="320" y="500" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-7" value="使用ROR指令AL向右移一位" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="640" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
240
Lab/Lab3/material/21281280_柯劲帆_第3次实验_8255A实验.md
Executable file
240
Lab/Lab3/material/21281280_柯劲帆_第3次实验_8255A实验.md
Executable file
@@ -0,0 +1,240 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1><center><strong>实验二 利用8255A实现LED的流水点亮实验</strong></center></h1>
|
||||
|
||||
### 一、实验目的
|
||||
|
||||
该实验的目的在于掌握8255A和微机接口的连接方法,了解8255A的基本的工作原理和编程方法。
|
||||
|
||||
### 二、实验内容
|
||||
|
||||
**任务一:**PA口接8个拨动开关K1-K8,PB口接8个LED。初始由开关K1-K8设定8位不同的值,当执行程序后LED按K1-K8初始设定的值点亮,并向右流动(8255A工作在0方式)。
|
||||
|
||||
**任务二:**在数码管上显示“8255-A”。
|
||||
|
||||
### 三、流程图
|
||||
|
||||
**任务一:**
|
||||
|
||||

|
||||
|
||||
**任务二:**
|
||||
|
||||

|
||||
|
||||
### 四、实验过程与分析
|
||||
|
||||
**任务一:**
|
||||
|
||||
首先在实验箱中将接线连好。将8255A芯片的CS连到280H地址。因此命令口为283H,PA口为280H,PB口为281H,PC口为282H。
|
||||
|
||||
将PA口连到开关上,PB口连到LED灯上。
|
||||
|
||||
然后设置好开关。将代码编译后运行。运行效果如视频所示。
|
||||
|
||||
**任务二:**
|
||||
|
||||
首先在实验箱中将接线连好。将8255A芯片的CS连到280H地址。将PA口连到位码接口上,PB口连到段码接口上。
|
||||
|
||||
<img src="task2.jpg" alt="task2" style="zoom:25%;" />
|
||||
|
||||
将代码编译后运行。运行效果如图所示。
|
||||
|
||||
### 五、实验总结
|
||||
|
||||
在本实验中,我掌握了8255A和微机接口的连接方法,了解了8255A的基本的工作原理和编程方法,收获颇丰。
|
||||
|
||||
### 六、思考题
|
||||
|
||||
> 在本实验的硬件电路中,能使用C口对LED指示灯控制码?如果可以写出2种控制方法(编程方法)。
|
||||
|
||||
**控制方法一:**使用命令口直接将PC口置位。
|
||||
|
||||
```assembly
|
||||
MOV DX, 283H ; 设置命令口
|
||||
MOV AL, 00000101B ; 0|xxx|010(指定PC2引脚)|1(置位)
|
||||
OUT DX, AL ; 输出
|
||||
```
|
||||
|
||||
**控制方法二:**使用方式0,将PC口置为数据输出口。
|
||||
|
||||
```assembly
|
||||
MOV DX, 283H
|
||||
MOV AL, 10000000B ; 1|00(A组0方式)|0(PA输入)|0(PC4-7输出)|0(B组0方式)|0(PB输出)|0(PC0-3输出)
|
||||
OUT DX, AL
|
||||
|
||||
MOV DX, 282H
|
||||
MOV AL, 00000001B ; PC1为高电平
|
||||
OUT DX, AL
|
||||
```
|
||||
|
||||
### 源代码附录
|
||||
|
||||
**任务一:**
|
||||
|
||||
```assembly
|
||||
DATA SEGMENT
|
||||
T DW 0FFH
|
||||
DATA ENDS
|
||||
|
||||
CODE SEGMENT
|
||||
ASSUME CS:CODE, DS:DATA
|
||||
|
||||
START:
|
||||
MOV AX, DATA
|
||||
MOV DS, AX
|
||||
|
||||
MOV DX, 283H ; 命令口
|
||||
MOV AL, 10010000B ; 1|00(A组0方式)|1(PA输入)|0(PC4-7输出)|0(B组0方式)|0(PB输出)|0(PC0-3输出)
|
||||
OUT DX, AL
|
||||
|
||||
MOV DX, 281H ; B口
|
||||
MOV AL, 00H ; LED全置0
|
||||
OUT DX, AL
|
||||
|
||||
MOV DX, 280H ; A口
|
||||
IN AL, DX ; 读入到AL
|
||||
|
||||
MOV DX, 281H ; B口
|
||||
LP:
|
||||
OUT DX, AL ; 从B口输出AL
|
||||
CALL DELAY ; 延时
|
||||
ROR AL, 1 ; ROR(Rotate Right)把AL向右移1位,移出的位补到左边,实现走马灯
|
||||
JMP LP ; 无限循环
|
||||
|
||||
DELAY PROC
|
||||
PUSH BX
|
||||
PUSH AX
|
||||
MOV BX, T
|
||||
MOV AX, T
|
||||
DL1:
|
||||
DL2:
|
||||
DEC BX
|
||||
JNZ DL1
|
||||
DEC AX
|
||||
JNZ DL2
|
||||
POP AX
|
||||
POP BX
|
||||
RET
|
||||
DELAY ENDP
|
||||
|
||||
CODE ENDS
|
||||
END START
|
||||
```
|
||||
|
||||
**任务二:**
|
||||
|
||||
```assembly
|
||||
DATA SEGMENT
|
||||
EIGHT DB 7FH
|
||||
TWO DB 5BH
|
||||
FIVE DB 6DH
|
||||
BAR DB 40H
|
||||
A DB 77H
|
||||
T DW 0FFH
|
||||
DATA ENDS
|
||||
|
||||
CODE SEGMENT
|
||||
ASSUME CS:CODE, DS:DATA
|
||||
|
||||
START:
|
||||
MOV AX, DATA
|
||||
MOV DS, AX
|
||||
|
||||
MOV DX, 283H ; 命令口
|
||||
MOV AL, 10000000B ; 1|00(A组0方式)|0(PA输出)|0(PC4-7输出)|0(B组0方式)|0(PB输出)|0(PC0-3输出)
|
||||
OUT DX, AL
|
||||
|
||||
|
||||
LP:
|
||||
MOV DX, 280H ; A口,控制位码
|
||||
MOV AL, 10000000B ; 第1位,PA1置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H ; B口,控制段码
|
||||
MOV AL, EIGHT ; 输出数据段定义的字符“8”
|
||||
OUT DX, AL
|
||||
CALL DELAY ; 延时后清零
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 01000000B ; 第2位,PA2置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, TWO ; 输出数据段定义的字符“2”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00100000B ; 第3位,PA3置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, FIVE ; 输出数据段定义的字符“5”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00010000B ; 第4位,PA4置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, FIVE ; 输出数据段定义的字符“5”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00001000B ; 第5位,PA5置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, BAR ; 输出数据段定义的字符“-”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00000100B ; 第6位,PA6置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, A ; 输出数据段定义的字符“A”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
JMP LP ; 无限循环
|
||||
|
||||
DELAY PROC
|
||||
PUSH BX
|
||||
MOV BX, T
|
||||
DL1:
|
||||
DEC BX
|
||||
JNZ DL1
|
||||
POP BX
|
||||
; 将位码段码都置0,否则前一位显示的字符会在显示下一位字符显示前在该位上显示
|
||||
MOV DX, 280H
|
||||
MOV AL, 00000000B
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, 0
|
||||
OUT DX, AL
|
||||
|
||||
RET
|
||||
DELAY ENDP
|
||||
|
||||
CODE ENDS
|
||||
END START
|
||||
```
|
||||
BIN
Lab/Lab3/material/21281280_柯劲帆_第3次实验_8255实验.pdf
Executable file
BIN
Lab/Lab3/material/21281280_柯劲帆_第3次实验_8255实验.pdf
Executable file
Binary file not shown.
BIN
Lab/Lab3/material/cover.png
Executable file
BIN
Lab/Lab3/material/cover.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
58
Lab/Lab3/material/task1.drawio
Executable file
58
Lab/Lab3/material/task1.drawio
Executable file
@@ -0,0 +1,58 @@
|
||||
<mxfile host="Electron" modified="2023-05-06T15:21:40.345Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="wTuHmDiwrehiRT4wOHhQ" version="21.2.8" type="device">
|
||||
<diagram name="第 1 页" id="3iH2U7M1F-pdt02PPPwc">
|
||||
<mxGraphModel dx="841" dy="768" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-1" target="LjnWuoztt-sNhJGu1yFB-2" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-1" value="程序开始" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="160" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-2" target="LjnWuoztt-sNhJGu1yFB-3" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-2" value="向命令口发送命令,将PA口置为0方式输入,PB口置为0方式输出" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="320" y="240" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-3" target="LjnWuoztt-sNhJGu1yFB-4" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-3" value="将PB口输出全零,灭掉所有LED灯" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="320" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-4" target="LjnWuoztt-sNhJGu1yFB-5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-4" value="通过PA口获取各个开关状态到AL" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="400" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-5" target="LjnWuoztt-sNhJGu1yFB-6" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-5" value="向PB口输出AL" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="480" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-6" target="LjnWuoztt-sNhJGu1yFB-7" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-6" value="进入延时子程序,延时一小段时间" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="560" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="LjnWuoztt-sNhJGu1yFB-7" target="LjnWuoztt-sNhJGu1yFB-5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="420" y="700" />
|
||||
<mxPoint x="320" y="700" />
|
||||
<mxPoint x="320" y="500" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="LjnWuoztt-sNhJGu1yFB-7" value="使用ROR指令AL向右移一位" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="360" y="640" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
4
Lab/Lab3/material/task1.drawio.svg
Executable file
4
Lab/Lab3/material/task1.drawio.svg
Executable file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 12 KiB |
BIN
Lab/Lab3/material/task1.jpg
Executable file
BIN
Lab/Lab3/material/task1.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 MiB |
BIN
Lab/Lab3/material/task1/code.EXE
Executable file
BIN
Lab/Lab3/material/task1/code.EXE
Executable file
Binary file not shown.
80
Lab/Lab3/material/task1/code.LST
Executable file
80
Lab/Lab3/material/task1/code.LST
Executable file
@@ -0,0 +1,80 @@
|
||||
Turbo Assembler Version 5.3 05-06-23 19:07:51 Page 1
|
||||
code.asm
|
||||
|
||||
|
||||
|
||||
1 0000 DATA SEGMENT
|
||||
2 0000 00FF T DW 0FFH
|
||||
3 0002 DATA ENDS
|
||||
4
|
||||
5 0000 CODE SEGMENT
|
||||
6 ASSUME CS:CODE,DS:DATA
|
||||
7
|
||||
8 0000 START:
|
||||
9 0000 B8 0000s MOV AX,DATA
|
||||
10 0003 8E D8 MOV DS,AX
|
||||
11
|
||||
12 0005 BA 0283 MOV DX, 283H
|
||||
13 0008 B0 B1 MOV AL, 0B1H
|
||||
14 000A EE OUT DX, AL
|
||||
15
|
||||
16 000B BA 0281 MOV DX, 281H
|
||||
17 000E B0 00 MOV AL, 00H
|
||||
18 0010 EE OUT DX, AL
|
||||
19
|
||||
20 0011 BA 0280 MOV DX, 280H
|
||||
21 0014 EC IN AL, DX
|
||||
22
|
||||
23 0015 BA 0281 MOV DX, 281H
|
||||
24 0018 LP:
|
||||
25 0018 EE OUT DX, AL
|
||||
26 0019 E8 0004 CALL DELAY
|
||||
27 001C D0 C8 ROR AL, 1
|
||||
28 001E EB F8 JMP LP
|
||||
29
|
||||
30 0020 DELAY PROC
|
||||
31 0020 53 PUSH BX
|
||||
32 0021 50 PUSH AX
|
||||
33 0022 8B 1E 0000r MOV BX, T
|
||||
34 0026 A1 0000r MOV AX, T
|
||||
35 0029 DL1:
|
||||
36 0029 DL2:
|
||||
37 0029 4B DEC BX
|
||||
38 002A 75 FD JNZ DL1
|
||||
39 002C 48 DEC AX
|
||||
40 002D 75 FA JNZ DL2
|
||||
41 002F 58 POP AX
|
||||
42 0030 5B POP BX
|
||||
43 0031 C3 RET
|
||||
44 0032 DELAY ENDP
|
||||
45
|
||||
46 0032 CODE ENDS
|
||||
47 END START
|
||||
Turbo Assembler Version 5.3 05-06-23 19:07:51 Page 2
|
||||
Symbol Table
|
||||
|
||||
|
||||
|
||||
|
||||
Symbol Name Type Value
|
||||
|
||||
??DATE Text "05-06-23"
|
||||
??FILENAME Text "code "
|
||||
??TIME Text "19:07:51"
|
||||
??VERSION Number 0503
|
||||
@CPU Text 0101H
|
||||
@CURSEG Text CODE
|
||||
@FILENAME Text CODE
|
||||
@WORDSIZE Text 2
|
||||
DELAY Near16 CODE:0020
|
||||
DL1 Near16 CODE:0029
|
||||
DL2 Near16 CODE:0029
|
||||
LP Near16 CODE:0018
|
||||
START Near16 CODE:0000
|
||||
T Word DATA:0000
|
||||
|
||||
Groups & Segments Bit Size Align Combine Class
|
||||
|
||||
CODE 16 0032 Para none
|
||||
DATA 16 0002 Para none
|
||||
|
||||
7
Lab/Lab3/material/task1/code.MAP
Executable file
7
Lab/Lab3/material/task1/code.MAP
Executable file
@@ -0,0 +1,7 @@
|
||||
LINK : warning L4021: no stack segment
|
||||
|
||||
Start Stop Length Name Class
|
||||
00000H 00001H 00002H DATA
|
||||
00010H 00041H 00032H CODE
|
||||
|
||||
Program entry point at 0001:0000
|
||||
BIN
Lab/Lab3/material/task1/code.OBJ
Executable file
BIN
Lab/Lab3/material/task1/code.OBJ
Executable file
Binary file not shown.
47
Lab/Lab3/material/task1/code.asm
Executable file
47
Lab/Lab3/material/task1/code.asm
Executable file
@@ -0,0 +1,47 @@
|
||||
DATA SEGMENT
|
||||
T DW 0FFH
|
||||
DATA ENDS
|
||||
|
||||
CODE SEGMENT
|
||||
ASSUME CS:CODE, DS:DATA
|
||||
|
||||
START:
|
||||
MOV AX, DATA
|
||||
MOV DS, AX
|
||||
|
||||
MOV DX, 283H ; 命令口
|
||||
MOV AL, 10010000B ; 1|00(A组0方式)|1(PA输入)|0(PC4-7输出)|0(B组0方式)|0(PB输出)|0(PC0-3输出)
|
||||
OUT DX, AL
|
||||
|
||||
MOV DX, 281H ; B口
|
||||
MOV AL, 00H ; LED全置0
|
||||
OUT DX, AL
|
||||
|
||||
MOV DX, 280H ; A口
|
||||
IN AL, DX ; 读入到AL
|
||||
|
||||
MOV DX, 281H ; B口
|
||||
LP:
|
||||
OUT DX, AL ; 从B口输出AL
|
||||
CALL DELAY ; 延时
|
||||
ROR AL, 1 ; ROR(Rotate Right)把AL向右移1位,移出的位补到左边,实现走马灯
|
||||
JMP LP ; 无限循环
|
||||
|
||||
DELAY PROC
|
||||
PUSH BX
|
||||
PUSH AX
|
||||
MOV BX, T
|
||||
MOV AX, T
|
||||
DL1:
|
||||
DL2:
|
||||
DEC BX
|
||||
JNZ DL1
|
||||
DEC AX
|
||||
JNZ DL2
|
||||
POP AX
|
||||
POP BX
|
||||
RET
|
||||
DELAY ENDP
|
||||
|
||||
CODE ENDS
|
||||
END START
|
||||
94
Lab/Lab3/material/task2.drawio
Executable file
94
Lab/Lab3/material/task2.drawio
Executable file
@@ -0,0 +1,94 @@
|
||||
<mxfile host="Electron" modified="2023-05-06T15:06:22.200Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="KfPBfSVlkAzQTw9RaeJu" version="21.2.8" type="device">
|
||||
<diagram name="第 1 页" id="Gbocf1ZR2_vZdg_gzSWu">
|
||||
<mxGraphModel dx="841" dy="768" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-1" target="araScAr63CeZQoxgV5Wy-2">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-1" value="程序开始" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="80" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-2" target="araScAr63CeZQoxgV5Wy-3">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-2" value="向命令口发送命令,将PA口和PB口全部置为0方式输出" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="160" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-3" target="araScAr63CeZQoxgV5Wy-4">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-3" value="从PA口输出位码10000000B控制数码管第1位显示字符" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="240" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-4" target="araScAr63CeZQoxgV5Wy-9">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-4" value="从PB口输出段码控制数码管显示字符“8”" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="320" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-9" target="araScAr63CeZQoxgV5Wy-10">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-9" value="进入延时子程序" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="400" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-10" target="araScAr63CeZQoxgV5Wy-22">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-10" value="循环延时" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="600" y="400" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-22" target="araScAr63CeZQoxgV5Wy-23">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-22" value="从PA口输出,将位码置0,控制数码管不显示" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="560" y="480" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-23" target="araScAr63CeZQoxgV5Wy-9">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="660" y="620" />
|
||||
<mxPoint x="540" y="620" />
|
||||
<mxPoint x="540" y="430" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-23" value="从PB口输出,将段码置0,控制数码管不显示字符" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="560" y="560" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-26" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-28" target="araScAr63CeZQoxgV5Wy-9">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="240" y="540" as="sourcePoint" />
|
||||
<mxPoint x="290" y="490" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-28" target="araScAr63CeZQoxgV5Wy-29">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-28" value="从PA口输出位码00000100B控制数码管第6位显示字符" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="560" width="200" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-33" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-29" target="araScAr63CeZQoxgV5Wy-32">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-29" value="从PB口输出段码控制数码管显示字符“A”" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="640" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="araScAr63CeZQoxgV5Wy-32" target="araScAr63CeZQoxgV5Wy-3">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="420" y="800" />
|
||||
<mxPoint x="280" y="800" />
|
||||
<mxPoint x="280" y="260" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="araScAr63CeZQoxgV5Wy-32" value="进入延时子程序" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="360" y="720" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
4
Lab/Lab3/material/task2.drawio.svg
Executable file
4
Lab/Lab3/material/task2.drawio.svg
Executable file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 17 KiB |
BIN
Lab/Lab3/material/task2.jpg
Executable file
BIN
Lab/Lab3/material/task2.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 MiB |
BIN
Lab/Lab3/material/task2/code.EXE
Executable file
BIN
Lab/Lab3/material/task2/code.EXE
Executable file
Binary file not shown.
134
Lab/Lab3/material/task2/code.LST
Executable file
134
Lab/Lab3/material/task2/code.LST
Executable file
@@ -0,0 +1,134 @@
|
||||
Turbo Assembler Version 5.3 05-06-23 19:11:34 Page 1
|
||||
code.asm
|
||||
|
||||
|
||||
|
||||
1 0000 DATA SEGMENT
|
||||
2 0000 7F EIGHT DB 7FH
|
||||
3 0001 5B TWO DB 5BH
|
||||
4 0002 6D FIVE DB 6DH
|
||||
5 0003 40 BAR DB 40H
|
||||
6 0004 77 A DB 77H
|
||||
7 0005 00FF T DW 0FFH
|
||||
8 0007 DATA ENDS
|
||||
9
|
||||
10 0000 CODE SEGMENT
|
||||
11 ASSUME CS:CODE, DS:DATA
|
||||
12
|
||||
13 0000 START:
|
||||
14 0000 B8 0000s MOV AX, DATA
|
||||
15 0003 8E D8 MOV DS, AX
|
||||
16
|
||||
17 0005 BA 0283 MOV DX, 283H
|
||||
18 0008 B0 80 MOV AL, 10000000B
|
||||
19 000A EE OUT DX, AL
|
||||
20
|
||||
21
|
||||
22 000B LP:
|
||||
23 000B BA 0280 MOV DX, 280H
|
||||
24 000E B0 80 MOV AL, 10000000B
|
||||
25 0010 EE OUT DX, AL
|
||||
26 0011 BA 0281 MOV DX, 281H
|
||||
27 0014 A0 0000r MOV AL, EIGHT
|
||||
28 0017 EE OUT DX, AL
|
||||
29 0018 E8 0051 CALL DELAY
|
||||
30
|
||||
31 001B BA 0280 MOV DX, 280H
|
||||
32 001E B0 40 MOV AL, 01000000B
|
||||
33 0020 EE OUT DX, AL
|
||||
34 0021 BA 0281 MOV DX, 281H
|
||||
35 0024 A0 0001r MOV AL, TWO
|
||||
36 0027 EE OUT DX, AL
|
||||
37 0028 E8 0041 CALL DELAY
|
||||
38
|
||||
39 002B BA 0280 MOV DX, 280H
|
||||
40 002E B0 20 MOV AL, 00100000B
|
||||
41 0030 EE OUT DX, AL
|
||||
42 0031 BA 0281 MOV DX, 281H
|
||||
43 0034 B0 6D MOV AL, 6DH
|
||||
44 0036 EE OUT DX, AL
|
||||
45 0037 E8 0032 CALL DELAY
|
||||
46
|
||||
47 003A BA 0280 MOV DX, 280H
|
||||
48 003D B0 10 MOV AL, 00010000B
|
||||
49 003F EE OUT DX, AL
|
||||
50 0040 BA 0281 MOV DX, 281H
|
||||
51 0043 A0 0002r MOV AL, FIVE
|
||||
52 0046 EE OUT DX, AL
|
||||
53 0047 E8 0022 CALL DELAY
|
||||
54
|
||||
55 004A BA 0280 MOV DX, 280H
|
||||
56 004D B0 08 MOV AL, 00001000B
|
||||
57 004F EE OUT DX, AL
|
||||
Turbo Assembler Version 5.3 05-06-23 19:11:34 Page 2
|
||||
code.asm
|
||||
|
||||
|
||||
|
||||
58 0050 BA 0281 MOV DX, 281H
|
||||
59 0053 A0 0003r MOV AL, BAR
|
||||
60 0056 EE OUT DX, AL
|
||||
61 0057 E8 0012 CALL DELAY
|
||||
62
|
||||
63 005A BA 0280 MOV DX, 280H
|
||||
64 005D B0 04 MOV AL, 00000100B
|
||||
65 005F EE OUT DX, AL
|
||||
66 0060 BA 0281 MOV DX, 281H
|
||||
67 0063 A0 0004r MOV AL, A
|
||||
68 0066 EE OUT DX, AL
|
||||
69 0067 E8 0002 CALL DELAY
|
||||
70
|
||||
71 006A EB 9F JMP LP
|
||||
72
|
||||
73 006C DELAY PROC
|
||||
74 006C 53 PUSH BX
|
||||
75 006D 8B 1E 0005r MOV BX, T
|
||||
76 0071 DL1:
|
||||
77 0071 4B DEC BX
|
||||
78 0072 75 FD JNZ DL1
|
||||
79 0074 5B POP BX
|
||||
80
|
||||
81 0075 BA 0280 MOV DX, 280H
|
||||
82 0078 B0 00 MOV AL, 00000000B
|
||||
83 007A EE OUT DX, AL
|
||||
84 007B BA 0281 MOV DX, 281H
|
||||
85 007E B0 00 MOV AL, 0
|
||||
86 0080 EE OUT DX, AL
|
||||
87
|
||||
88 0081 C3 RET
|
||||
89 0082 DELAY ENDP
|
||||
90
|
||||
91 0082 CODE ENDS
|
||||
92 END START
|
||||
Turbo Assembler Version 5.3 05-06-23 19:11:34 Page 3
|
||||
Symbol Table
|
||||
|
||||
|
||||
|
||||
|
||||
Symbol Name Type Value
|
||||
|
||||
??DATE Text "05-06-23"
|
||||
??FILENAME Text "code "
|
||||
??TIME Text "19:11:34"
|
||||
??VERSION Number 0503
|
||||
@CPU Text 0101H
|
||||
@CURSEG Text CODE
|
||||
@FILENAME Text CODE
|
||||
@WORDSIZE Text 2
|
||||
A Byte DATA:0004
|
||||
BAR Byte DATA:0003
|
||||
DELAY Near16 CODE:006C
|
||||
DL1 Near16 CODE:0071
|
||||
EIGHT Byte DATA:0000
|
||||
FIVE Byte DATA:0002
|
||||
LP Near16 CODE:000B
|
||||
START Near16 CODE:0000
|
||||
T Word DATA:0005
|
||||
TWO Byte DATA:0001
|
||||
|
||||
Groups & Segments Bit Size Align Combine Class
|
||||
|
||||
CODE 16 0082 Para none
|
||||
DATA 16 0007 Para none
|
||||
|
||||
7
Lab/Lab3/material/task2/code.MAP
Executable file
7
Lab/Lab3/material/task2/code.MAP
Executable file
@@ -0,0 +1,7 @@
|
||||
LINK : warning L4021: no stack segment
|
||||
|
||||
Start Stop Length Name Class
|
||||
00000H 00006H 00007H DATA
|
||||
00010H 00091H 00082H CODE
|
||||
|
||||
Program entry point at 0001:0000
|
||||
BIN
Lab/Lab3/material/task2/code.OBJ
Executable file
BIN
Lab/Lab3/material/task2/code.OBJ
Executable file
Binary file not shown.
92
Lab/Lab3/material/task2/code.asm
Executable file
92
Lab/Lab3/material/task2/code.asm
Executable file
@@ -0,0 +1,92 @@
|
||||
DATA SEGMENT
|
||||
EIGHT DB 7FH
|
||||
TWO DB 5BH
|
||||
FIVE DB 6DH
|
||||
BAR DB 40H
|
||||
A DB 77H
|
||||
T DW 0FFH
|
||||
DATA ENDS
|
||||
|
||||
CODE SEGMENT
|
||||
ASSUME CS:CODE, DS:DATA
|
||||
|
||||
START:
|
||||
MOV AX, DATA
|
||||
MOV DS, AX
|
||||
|
||||
MOV DX, 283H ; 命令口
|
||||
MOV AL, 10000000B ; 1|00(A组0方式)|0(PA输出)|0(PC4-7输出)|0(B组0方式)|0(PB输出)|0(PC0-3输出)
|
||||
OUT DX, AL
|
||||
|
||||
|
||||
LP:
|
||||
MOV DX, 280H ; A口,控制位码
|
||||
MOV AL, 10000000B ; 第1位,PA1置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H ; B口,控制段码
|
||||
MOV AL, EIGHT ; 输出数据段定义的字符“8”
|
||||
OUT DX, AL
|
||||
CALL DELAY ; 延时后清零
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 01000000B ; 第2位,PA2置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, TWO ; 输出数据段定义的字符“2”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00100000B ; 第3位,PA3置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, FIVE ; 输出数据段定义的字符“5”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00010000B ; 第4位,PA4置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, FIVE ; 输出数据段定义的字符“5”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00001000B ; 第5位,PA5置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, BAR ; 输出数据段定义的字符“-”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
MOV DX, 280H
|
||||
MOV AL, 00000100B ; 第6位,PA6置1
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, A ; 输出数据段定义的字符“A”
|
||||
OUT DX, AL
|
||||
CALL DELAY
|
||||
|
||||
JMP LP ; 无限循环
|
||||
|
||||
DELAY PROC
|
||||
PUSH BX
|
||||
MOV BX, T
|
||||
DL1:
|
||||
DEC BX
|
||||
JNZ DL1
|
||||
POP BX
|
||||
; 将位码段码都置0,否则前一位显示的字符会在显示下一位字符显示前在该位上显示
|
||||
MOV DX, 280H
|
||||
MOV AL, 00000000B
|
||||
OUT DX, AL
|
||||
MOV DX, 281H
|
||||
MOV AL, 0
|
||||
OUT DX, AL
|
||||
|
||||
RET
|
||||
DELAY ENDP
|
||||
|
||||
CODE ENDS
|
||||
END START
|
||||
BIN
Lab/Lab3/material/任务一演示.mp4
Executable file
BIN
Lab/Lab3/material/任务一演示.mp4
Executable file
Binary file not shown.
BIN
Lab/Lab3/实验箱安装.doc
Executable file
BIN
Lab/Lab3/实验箱安装.doc
Executable file
Binary file not shown.
BIN
Lab/Lab3/接口技术实验平台补充内容.pptx
Executable file
BIN
Lab/Lab3/接口技术实验平台补充内容.pptx
Executable file
Binary file not shown.
BIN
Lab/Lab3/接口技术常规实验指导书.doc
Executable file
BIN
Lab/Lab3/接口技术常规实验指导书.doc
Executable file
Binary file not shown.
Reference in New Issue
Block a user