提交 7c300cda 创建 作者: 赵鹏翀's avatar 赵鹏翀

Initial commit

上级
*.cir
*.xml
*.bak
/.vs
\ No newline at end of file
[submodule "8086"]
path = 8086
url = https://zpc@www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8086.git
[submodule "8259A"]
path = 8259A
url = https://zpc@www.codecode.net/engintime/Dream-Logic/Intel-classic-chips/8259A.git
8086 @ 0646239b
Subproject commit 0646239b4d1645f6a0da63d7f4bb3142942e567c
8259A @ e090530d
Subproject commit e090530dbe6c8add5b683e25ea969b581be5cfca
添加文件
差异被折叠。
# 说明
IO接口芯片地址译码模块
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<project id="3407fe40-bd78-42b5-914a-e269ea66b67f" name="Lab004" version="1">
<files>
<filefolder id="d7502e9e-b220-4715-a645-2f139d9b4f34" name="MEM">
<file relativepath="MEM\MEM.dlsche"/>
<file relativepath="MEM\ram.asm"/>
<file relativepath="MEM\ram.bat"/>
<file relativepath="MEM\ram.rxm"/>
<file relativepath="MEM\README.md"/>
</filefolder>
<filefolder id="c6ec748e-8eff-4fcb-9ff0-d62ba30af439" name="IO">
<file relativepath="IO\IO.dlsche"/>
<file relativepath="IO\README.md"/>
</filefolder>
<filefolder id="c1859124-7805-4dc5-80ca-ead7e78df13a" name="8086">
<file relativepath="8086\8086.dlsche"/>
<file relativepath="8086\8086.pdf"/>
<file relativepath="8086\ALU.dlsche"/>
<file relativepath="8086\BRANCH.dlsche"/>
<file relativepath="8086\CU.dlsche"/>
<file relativepath="8086\FLAG.dlsche"/>
<file relativepath="8086\PC.dlsche"/>
<file relativepath="8086\README.md"/>
<file relativepath="8086\REGS.dlsche"/>
<file relativepath="8086\rom.bat"/>
<file relativepath="8086\rom.masm"/>
<file relativepath="8086\rom.rxm"/>
<file relativepath="8086\uPC_NEXT.dlsche"/>
</filefolder>
<filefolder id="4e580194-3c19-4f28-9858-1164a71103d7" 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>
添加文件
差异被折叠。
# 说明
8086 微机系统的MEM主存储器,存储指令和数据
\ No newline at end of file
差异被折叠。
添加文件
; 0~15号存储单元存放中断向量,即中断向量表
.int_table
int0
int1
int2
int3
int4
int5
int6
int7
.text
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
int4: ;
mov bl, 0
add bl, 4
mov al, 0x20
out 0x80, al ;中断结束命令eoi
iret
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
@echo off
dmasm.exe ram.asm -o ram.rxm -l ram.lst -g ram.dbg
pause
添加文件
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
添加文件
# 说明
可编程中断控制器实验
# 原理图
![raw svg](top.dlsche.svg)
![raw svg](top1.dlsche.svg)
\ No newline at end of file
添加文件
差异被折叠。
添加文件
差异被折叠。
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论