提交 2cb16e88 创建 作者: 李川's avatar 李川

Merge branch 'lab4' into 'master'

修改实验模板原理图 See merge request engintime/Dream-Logic/Project-Template/Microcomputer/Lab004!1
......@@ -2,3 +2,15 @@
path = 8086
url = https://www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8086.git
branch = master
[submodule "8259"]
path = 8259
url = https://lichuan@www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8259A.git
[submodule "8237"]
path = 8237
url = https://lichuan@www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8237.git
[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
8259A @ e0d8f978
Subproject commit e0d8f978c45a723a59b0410554b9631b49719659
......@@ -28,8 +28,22 @@
<file relativepath="IO\IO.dlsche"/>
<file relativepath="IO\README.md"/>
</filefolder>
<file relativepath="top.dlsche"/>
<filefolder id="a961777e-cf0e-4210-9527-c3eac629a0d5" 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="README.md"/>
<file relativepath="top.dlsche"/>
<file relativepath="top1.dlsche"/>
</files>
</project>
;test
; 0~15号存储单元存放中断向量,即中断向量表
.int_table
int0
int1
int2
int3
int4
int5
int6
int7
.text
BEGIN:
mov al, 0x1a
cli ; 关中断
; 初始化栈顶地址
mov sp, 0
; 初始化主片8259A
mov al, 0x13
out 0x80, al ; 写ICW1,边沿触发,单片,需要设置ICW4
mov al, 0
out 0x81, al ; 写ICW2,设定IRQ0的中断号为0
out 0x81, al ; 写入ICW4,设定普通全嵌套方式,普通EOI方式(通过发EOI命令结束中断)
out 0x81, al ; 写OCW1,允许全部8级中断请求
sti ; 开中断
mov dl, 0
mov bl, 0
NEXT:
inc dl
cmp dl, 0xff
jnz NEXT
DEAD_LOOP:
jmp DEAD_LOOP
;================================================
; 主片的中断服务程序
int0:
mov bl, 0
mov cl, 1
shr cl, bl
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
int1: ;1 interrupt
mov bl, 0
add bl, 1
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
int2: ;2 interrupt
mov bl, 0
add bl, 2
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
int3: ;3 interrupt
mov bl, 0
add bl, 3
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
UP:
out 2, al
inc al
cmp al, 0x84
jnz UP
dec al
int4: ;
mov bl, 0
add bl, 4
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
DOWN:
out 2, al
dec al
cmp al, 0x19
jnz DOWN
jmp BEGIN
int5: ;
mov bl, 0
add bl, 5
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
int6: ;
mov bl, 0
add bl, 6
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
int7: ;
mov bl, 0
add bl, 7
mov al, 0x20
out 0x80, 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 ; 0~15号存储单元存放中断向量,即中断向量表
0002
0003 .int_table
0004 00 36 int0
0005 01 46 int1
0006 02 54 int2
0007 03 62 int3
0008 04 70 int4
0009 05 7E int5
0010 06 8C int6
0011 07 9A int7
0012
0013 .text
0014
0015 10 74 cli ; 关中断
0016
0017 ; 初始化栈顶地址
0018 11 01 04 00 mov sp, 0
0019
0020 ; 初始化主片8259A
0021 14 01 00 13 mov al, 0x13
0022 17 4E 00 80 out 0x80, al ; 写ICW1,边沿触发,单片,需要设置ICW4
0023 1A 01 00 00 mov al, 0
0024 1D 4E 00 81 out 0x81, al ; 写ICW2,设定IRQ0的中断号为0
0025 20 4E 00 81 out 0x81, al ; 写入ICW4,设定普通全嵌套方式,普通EOI方式(通过发EOI命令结束中断)
0026 23 4E 00 81 out 0x81, al ; 写OCW1,允许全部8级中断请求
0027
0028 26 75 sti ; 开中断
0029
0030 27 01 03 00 mov dl, 0
0031 2A 01 01 00 mov bl, 0
0032
0033 NEXT:
0034 2D 78 03 inc dl
0035 2F 47 03 FF cmp dl, 0xff
0036 32 55 2D jnz NEXT
0037
0038 DEAD_LOOP:
0039 34 57 34 jmp DEAD_LOOP
0040
0041
0042 ;================================================
0043 ; 主片的中断服务程序
0044 int0:
0045 36 01 01 00 mov bl, 0
0046 39 01 02 01 mov cl, 1
0047 3C 65 12 shr cl, bl
0048 3E 01 00 20 mov al, 0x20
0049 41 4E 00 80 out 0x80, al ;中断结束命令eoi
0050 44 5D 44 iret
0051
0052 int1: ;1 interrupt
0053 46 01 01 00 mov bl, 0
0054 49 0E 01 01 add bl, 1
0055 4C 01 00 20 mov al, 0x20
0056 4F 4E 00 80 out 0x80, al ;中断结束命令eoi
0057 52 5D 44 iret
0058
0059 int2: ;2 interrupt
0060 54 01 01 00 mov bl, 0
0061 57 0E 01 02 add bl, 2
0062 5A 01 00 20 mov al, 0x20
0063 5D 4E 00 80 out 0x80, al ;中断结束命令eoi
0064 60 5D 44 iret
0065
0066
0067 int3: ;3 interrupt
0068 62 01 01 00 mov bl, 0
0069 65 0E 01 03 add bl, 3
0070 68 01 00 20 mov al, 0x20
0071 6B 4E 00 80 out 0x80, al ;中断结束命令eoi
0072 6E 5D 44 iret
0073
0074 int4: ;
0075 70 01 01 00 mov bl, 0
0076 73 0E 01 04 add bl, 4
0077 76 01 00 20 mov al, 0x20
0078 79 4E 00 80 out 0x80, al ;中断结束命令eoi
0079 7C 5D 44 iret
0080
0081 int5: ;
0082 7E 01 01 00 mov bl, 0
0083 81 0E 01 05 add bl, 5
0084 84 01 00 20 mov al, 0x20
0085 87 4E 00 80 out 0x80, al ;中断结束命令eoi
0086 8A 5D 44 iret
0087
0088 int6: ;
0089 8C 01 01 00 mov bl, 0
0090 8F 0E 01 06 add bl, 6
0091 92 01 00 20 mov al, 0x20
0092 95 4E 00 80 out 0x80, al ;中断结束命令eoi
0093 98 5D 44 iret
0094
0095 int7: ;
0096 9A 01 01 00 mov bl, 0
0097 9D 0E 01 07 add bl, 7
0098 A0 01 00 20 mov al, 0x20
0099 A3 4E 00 80 out 0x80, al ;中断结束命令eoi
0100 A6 5D 44 iret
0101
没有这种文件类型的预览
没有这种文件类型的预览
差异被折叠。
添加文件
差异被折叠。
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论