提交 55c78114 创建 作者: 李川's avatar 李川

Merge branch 'lab5' into 'master'

修改实验模板 See merge request !2
......@@ -5,3 +5,6 @@
[submodule "8250"]
path = 8250
url = https://lichuan@www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8250.git
[submodule "8259A"]
path = 8259A
url = https://lichuan@www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8259A.git
Subproject commit 0278cc57b2050c74e10bbda5a0b67fb99b83fd58
Subproject commit 4b434cf0833605d141aa66fc8c37357ec9d1afa5
没有这种文件类型的预览
......@@ -87,10 +87,6 @@
<text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="1350" y="1124">CTS</text>
<polygon fill="#ffff80" points="1560 1224, 1535 1199, 1485 1199, 1460 1224, 1485 1249, 1535 1249, 1560 1224" stroke="#800000" stroke-width="1"/>
<text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="1350" y="1224">RLSD</text>
<polygon fill="#ffff80" points="1560 1324, 1535 1299, 1485 1299, 1460 1324, 1485 1349, 1535 1349, 1560 1324" stroke="#800000" stroke-width="1"/>
<text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="1350" y="1324">INTRPT</text>
......@@ -129,7 +125,7 @@
<rect fill="#000000" fill-opacity="0.5" height="50" stroke="#a0a0a4" stroke-width="1" width="160" x="410" y="574"/>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="微软雅黑" font-size="30" font-weight="400" text-anchor="start" x="470" y="621">0c</text>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="微软雅黑" font-size="30" font-weight="400" text-anchor="start" x="470" y="621">c7</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="588" y="620">1</text>
......@@ -275,8 +271,6 @@
<polyline fill="none" points="1560 1024, 1660 1024, 1660 1124, 1560 1124" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1560 1224, 1660 1224, 1660 1124" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="200" font-weight="700" text-anchor="start" x="130" y="254">8250自发自收测试电路</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="260" y="1924">IOR</text>
......@@ -285,6 +279,4 @@
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="560" y="2224">RESET</text>
<circle cx="1660" cy="1124" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
8259A @ 71946c24
Subproject commit 71946c24fc50851866aa083a344656c277867105
......@@ -39,9 +39,22 @@
<file relativepath="8250\reg_rw.dlsche"/>
<file relativepath="8250\TCL.dlsche"/>
</filefolder>
<file relativepath="README.md"/>
<file relativepath="top.dlsche"/>
<filefolder id="e7283145-8b5c-4f21-95a5-bfc1d08aef4e" name="8259A">
<file relativepath="8259A\8259A.dlsche"/>
<file relativepath="8259A\8259A.pdf"/>
<file relativepath="8259A\acs.dlsche"/>
<file relativepath="8259A\apply.dlsche"/>
<file relativepath="8259A\fsm.dlsche"/>
<file relativepath="8259A\initial.dlsche"/>
<file relativepath="8259A\IRR.dlsche"/>
<file relativepath="8259A\ISR.dlsche"/>
<file relativepath="8259A\PR.dlsche"/>
<file relativepath="8259A\README.md"/>
<file relativepath="8259A\sp.dlsche"/>
</filefolder>
<file relativepath="8250_test.dlsche"/>
<file relativepath="top.dlsche"/>
<file relativepath="README.md"/>
</files>
</project>
;test
;采用中断的方式,通过8250将外设字符传送到cpu内部寄存器bl
.int_table
intr0
.text
cli ; 关中断
; 初始化栈顶地址
mov sp, 0
;初始化用于接收字符的8250芯片
mov al, 0x0f
out 0x81, al ;允许中断
;初始化中断控制器8259芯片
mov al, 0x13
out 0x90, al ; 写ICW1,边沿触发,单片,需要设置ICW4
mov al, 0
out 0x91, al ; 写ICW2,设定IRQ0的中断号为0
out 0x91, al ; 写入ICW4,设定普通全嵌套方式,普通EOI方式(通过发EOI命令结束中断)
out 0x91, al ; 写OCW1,允许全部8级中断请求
sti ; 开中断
BEGIN:
mov al, 0x1a
UP:
out 2, al
inc al
cmp al, 0x84
jnz UP
dec al
DOWN:
out 2, al
dec al
cmp al, 0x19
jnz DOWN
jmp BEGIN
;=============================================
;中断服务程序,当接收器满的时候,触发CPU从8250取数据
intr0:
in al, 0x80 ;将端口0x80数据读入al寄存器
mov bl, al ;再将al移动到bl中
mov al, 0x20
out 0x90, al ;中断结束命令eoi
iret
没有这种文件类型的预览
0001 ;test
0002 .text
0003
0004 BEGIN:
0005 10 01 00 1A mov al, 0x1a
0006
0007 UP:
0008 13 4E 00 02 out 2, al
0009 16 78 00 inc al
0010 18 47 00 84 cmp al, 0x84
0011 1B 55 13 jnz UP
0012 1D 79 00 dec al
0013
0014 DOWN:
0015 1F 4E 00 02 out 2, al
0016 22 79 00 dec al
0017 24 47 00 19 cmp al, 0x19
0018 27 55 1F jnz DOWN
0019 29 57 10 jmp BEGIN
0020
0021
0022
0001 ;采用中断的方式,通过8250将外设字符传送到cpu内部寄存器bl
0002
0003 .int_table
0004 00 40 intr0
0005
0006 .text
0007 10 74 cli ; 关中断
0008
0009 ; 初始化栈顶地址
0010 11 01 04 00 mov sp, 0
0011
0012 ;初始化用于接收字符的8250芯片
0013 14 01 00 0F mov al, 0x0f
0014 17 4E 00 81 out 0x81, al ;允许中断
0015
0016 ;初始化中断控制器8259芯片
0017 1A 01 00 13 mov al, 0x13
0018 1D 4E 00 90 out 0x90, al ; 写ICW1,边沿触发,单片,需要设置ICW4
0019 20 01 00 00 mov al, 0
0020 23 4E 00 91 out 0x91, al ; 写ICW2,设定IRQ0的中断号为0
0021 26 4E 00 91 out 0x91, al ; 写入ICW4,设定普通全嵌套方式,普通EOI方式(通过发EOI命令结束中断)
0022 29 4E 00 91 out 0x91, al ; 写OCW1,允许全部8级中断请求
0023
0024 2C 75 sti ; 开中断
0025
0026 BEGIN:
0027 2D 01 00 1A mov al, 0x1a
0028
0029 UP:
0030 30 78 00 inc al
0031 32 47 00 84 cmp al, 0x84
0032 35 55 30 jnz UP
0033
0034 DOWN:
0035 37 79 00 dec al
0036 39 47 00 19 cmp al, 0x19
0037 3C 55 37 jnz DOWN
0038 3E 57 2D jmp BEGIN
0039
0040
0041 ;=============================================
0042 ;中断服务程序,当接收器满的时候,触发CPU从8250取数据
0043 intr0:
0044 40 4B 00 80 in al, 0x80 ;将端口0x80数据读入al寄存器
0045 43 02 01 mov bl, al ;再将al移动到bl中
0046 45 01 00 20 mov al, 0x20
0047 48 4E 00 90 out 0x90, al ;中断结束命令eoi
0048 4B 5D 44 iret
0049
没有这种文件类型的预览
没有这种文件类型的预览
差异被折叠。
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论