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

init 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
branch = master
8086 @ 7138533a
Subproject commit 7138533acca68b0779d25164de1c454133c89f9b
添加文件
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="1244" version="1.1" width="2058" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#ffff80" points="36 746, 36 721, 211 721, 236 746, 211 771, 36 771, 36 746" 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="36" y="746">A[7..0]</text>
<polyline fill="none" points="1136 766, 936 766, 786 766, 436 766" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1136 796, 936 796, 786 796, 436 796" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1136 826, 936 826, 786 826, 436 826" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="436" y="766">A3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="436" y="796">A4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="436" y="826">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1186" x2="1136" y1="866" y2="866"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1232" y="865">G1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1159" y="865">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1176" x2="1136" y1="896" y2="896"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1256" y="895">^G2A</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1159" y="897">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1176" x2="1136" y1="926" y2="926"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1256" y="925">^G2B</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1158" y="926">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1186" x2="1136" y1="766" y2="766"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1213" y="766">A</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1146" y="765">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1186" x2="1136" y1="796" y2="796"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1219" y="796">B</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1160" y="796">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1186" x2="1136" y1="826" y2="826"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1213" y="826">C</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1147" y="826">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="746" y2="746"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="743">Y0</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1355" y="746">15</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="776" y2="776"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="773">Y1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1356" y="776">14</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="806" y2="806"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="803">Y2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1356" y="806">13</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="836" y2="836"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="833">Y3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1356" y="836">12</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="866" y2="866"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="863">Y4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1356" y="866">11</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="896" y2="896"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="893">Y5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1356" y="896">10</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="926" y2="926"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1307" y="923">Y6</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1368" y="926">9</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1346" x2="1386" y1="956" y2="956"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1321" y="955">Y7</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1383" y="956">7</text>
<circle cx="1181" cy="926" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="806" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="837" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1342" cy="866" fill="#ffffff" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="746" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="896" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="775" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="925" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1341" cy="957" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1181" cy="896" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<rect fill="#ffffff" fill-opacity="0.5" height="264" stroke="#000000" stroke-width="5" width="146" x="1188" y="712"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1251" y="703">U1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1189" y="1018">74LS138D</text>
<polygon fill="#ffff80" points="36 1196, 36 1171, 161 1171, 186 1196, 161 1221, 36 1221, 36 1196" 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="36" y="1196">MIO</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="16" y="1136">低电平表示访问IO端口</text>
<polygon fill="#ffff80" points="36 446, 36 421, 211 421, 236 446, 211 471, 36 471, 36 446" 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="36" y="446">WR_OUT</text>
<polygon fill="#ffff80" points="36 596, 36 571, 211 571, 236 596, 211 621, 36 621, 36 596" 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="36" y="596">READ_OUT</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="446" x2="386" y1="386" y2="386"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="446" x2="386" y1="446" y2="446"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="576" x2="636" y1="416" y2="416"/>
<path d="M442 370 C 468 409, 441 459, 441 459, 441 459, 441 459, 441 459" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="442 369, 500 369" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="441 459, 499 459" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M500 369 C 552 369, 576 416, 576 416" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M498 459 C 554 459, 576 416, 576 416" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="491" y="359">U3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="479" y="510">OR</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="446" x2="386" y1="536" y2="536"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="446" x2="386" y1="596" y2="596"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="576" x2="636" y1="566" y2="566"/>
<path d="M442 520 C 468 559, 441 609, 441 609, 441 609, 441 609, 441 609" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="442 519, 500 519" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="441 609, 499 609" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M500 519 C 552 519, 576 566, 576 566" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M498 609 C 554 609, 576 566, 576 566" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="491" y="509">U4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="479" y="660">OR</text>
<polyline fill="none" points="386 596, 236 596" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="386 386, 286 386, 286 536" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polygon fill="#ffff80" points="1836 416, 1836 391, 2011 391, 2036 416, 2011 441, 1836 441, 1836 416" 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="1836" y="416">IOW</text>
<polygon fill="#ffff80" points="1836 566, 1836 541, 2011 541, 2036 566, 2011 591, 1836 591, 1836 566" 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="1836" y="566">IOR</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="175" font-weight="700" text-anchor="start" x="426" y="226">I/O地址译码单元</text>
<polyline fill="none" points="386 446, 236 446" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polygon fill="#ffff80" points="36 536, 36 511, 211 511, 236 536, 211 561, 36 561, 36 536" 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="36" y="536">MIO</text>
<polyline fill="none" points="386 536, 236 536" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="646" x2="586" y1="916" y2="916"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="726" x2="786" y1="916" y2="916"/>
<circle cx="722" cy="916" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="646 866, 646 966, 716 916, 646 866" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="666" y="880">U5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="646" y="1012">NOT</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="436" y="916">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="846" x2="786" y1="916" y2="916"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="846" x2="786" y1="976" y2="976"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="976" x2="1036" y1="946" y2="946"/>
<path d="M924 894 A 47 47 0 1 1 924 987" fill="none" stroke="#000000" stroke-linecap="round" stroke-width="5"/>
<polyline fill="none" points="925 988, 846 988, 846 894, 925 894" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="887" y="888">U6</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="870" y="1034">AND</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="436" y="976">A7</text>
<polyline fill="none" points="586 916, 436 916" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="786 976, 436 976" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="386" x2="436" y1="816" y2="766"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="386" x2="436" y1="846" y2="796"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="386" x2="436" y1="876" y2="826"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="386" x2="436" y1="966" y2="916"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="386" x2="436" y1="1026" y2="976"/>
<polyline fill="none" points="236 746, 386 746, 386 1026" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="1136 866, 1036 866, 1036 946" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="186 1196, 1086 1196, 1086 896, 1136 896" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 746, 1836 746" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 776, 1836 776" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 806, 1836 806" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 836, 1836 836" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 866, 1836 866" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 896, 1836 896" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 926, 1836 926" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1386 956, 1836 956" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polygon fill="#ffff80" points="1836 746, 1836 731, 2021 731, 2036 746, 2021 761, 1836 761, 1836 746" 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="1836" y="746">CS0</text>
<polygon fill="#ffff80" points="1836 776, 1836 761, 2021 761, 2036 776, 2021 791, 1836 791, 1836 776" 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="1836" y="776">CS1</text>
<polygon fill="#ffff80" points="1836 806, 1836 791, 2021 791, 2036 806, 2021 821, 1836 821, 1836 806" 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="1836" y="806">CS2</text>
<polygon fill="#ffff80" points="1836 836, 1836 821, 2021 821, 2036 836, 2021 851, 1836 851, 1836 836" 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="1836" y="836">CS3</text>
<polygon fill="#ffff80" points="1836 866, 1836 851, 2021 851, 2036 866, 2021 881, 1836 881, 1836 866" 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="1836" y="866">CS4</text>
<polygon fill="#ffff80" points="1836 896, 1836 881, 2021 881, 2036 896, 2021 911, 1836 911, 1836 896" 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="1836" y="896">CS5</text>
<polygon fill="#ffff80" points="1836 926, 1836 911, 2021 911, 2036 926, 2021 941, 1836 941, 1836 926" 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="1836" y="926">CS6</text>
<polygon fill="#ffff80" points="1836 956, 1836 941, 2021 941, 2036 956, 2021 971, 1836 971, 1836 956" 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="1836" y="956">CS7</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="746">(80H~87H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="776">(88H~8FH)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="806">(90H~97H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="836">(98H~9FH)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="866">(A0H~A7H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="896">(A8H~AFH)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="926">(B0H~B7H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1436" y="956">(B8H~BFH)</text>
<polyline fill="none" points="636 416, 1836 416" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="636 566, 1836 566" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<circle cx="286" cy="536" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="1343" version="1.1" width="2695" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#ffff80" points="388 796, 388 771, 563 771, 588 796, 563 821, 388 821, 388 796" 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="388" y="796">A[7..0]</text>
<polyline fill="none" points="1488 816, 1288 816, 1138 816, 788 816" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1488 846, 1288 846, 1138 846, 788 846" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1488 876, 1288 876, 1138 876, 788 876" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="788" y="816">A3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="788" y="846">A4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="788" y="876">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1538" x2="1488" y1="916" y2="916"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1584" y="915">G1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1511" y="915">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1528" x2="1488" y1="946" y2="946"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1608" y="945">^G2A</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1511" y="947">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1528" x2="1488" y1="976" y2="976"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1608" y="975">^G2B</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1510" y="976">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1538" x2="1488" y1="816" y2="816"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1565" y="816">A</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1498" y="815">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1538" x2="1488" y1="846" y2="846"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1571" y="846">B</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1512" y="846">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1538" x2="1488" y1="876" y2="876"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1565" y="876">C</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1499" y="876">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="796" y2="796"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="793">Y0</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1707" y="796">15</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="826" y2="826"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="823">Y1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1708" y="826">14</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="856" y2="856"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="853">Y2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1708" y="856">13</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="886" y2="886"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="883">Y3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1708" y="886">12</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="916" y2="916"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="913">Y4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1708" y="916">11</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="946" y2="946"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="943">Y5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1708" y="946">10</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="976" y2="976"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="middle" x="1659" y="973">Y6</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1720" y="976">9</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1698" x2="1738" y1="1006" y2="1006"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1673" y="1005">Y7</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1735" y="1006">7</text>
<circle cx="1533" cy="976" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="856" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="887" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1694" cy="916" fill="#ffffff" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="796" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="946" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="825" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="975" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1693" cy="1007" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<circle cx="1533" cy="946" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<rect fill="#ffffff" fill-opacity="0.5" height="264" stroke="#000000" stroke-width="5" width="146" x="1540" y="762"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1603" y="753">U1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1541" y="1068">74LS138D</text>
<polygon fill="#ffff80" points="388 1246, 388 1221, 513 1221, 538 1246, 513 1271, 388 1271, 388 1246" 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="388" y="1246">MIO</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="368" y="1186">低电平表示访问IO端口</text>
<polygon fill="#ffff80" points="388 496, 388 471, 563 471, 588 496, 563 521, 388 521, 388 496" 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="388" y="496">WR_OUT</text>
<polygon fill="#ffff80" points="388 646, 388 621, 563 621, 588 646, 563 671, 388 671, 388 646" 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="388" y="646">READ_OUT</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="798" x2="738" y1="436" y2="436"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="798" x2="738" y1="496" y2="496"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="928" x2="988" y1="466" y2="466"/>
<path d="M794 420 C 820 459, 793 509, 793 509, 793 509, 793 509, 793 509" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="794 419, 852 419" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="793 509, 851 509" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M852 419 C 904 419, 928 466, 928 466" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M850 509 C 906 509, 928 466, 928 466" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="843" y="409">U3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="831" y="560">OR</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="798" x2="738" y1="586" y2="586"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="798" x2="738" y1="646" y2="646"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="928" x2="988" y1="616" y2="616"/>
<path d="M794 570 C 820 609, 793 659, 793 659, 793 659, 793 659, 793 659" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="794 569, 852 569" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="793 659, 851 659" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M852 569 C 904 569, 928 616, 928 616" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M850 659 C 906 659, 928 616, 928 616" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="843" y="559">U4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="831" y="710">OR</text>
<polyline fill="none" points="738 646, 588 646" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="738 436, 638 436, 638 586" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polygon fill="#ffff80" points="2188 466, 2188 441, 2363 441, 2388 466, 2363 491, 2188 491, 2188 466" 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="2188" y="466">IOW</text>
<polygon fill="#ffff80" points="2188 616, 2188 591, 2363 591, 2388 616, 2363 641, 2188 641, 2188 616" 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="2188" y="616">IOR</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="175" font-weight="700" text-anchor="start" x="168" y="226">I/O地址译码模块功能测试电路</text>
<polyline fill="none" points="738 496, 588 496" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polygon fill="#ffff80" points="388 586, 388 561, 563 561, 588 586, 563 611, 388 611, 388 586" 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="388" y="586">MIO</text>
<polyline fill="none" points="738 586, 588 586" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="998" x2="938" y1="966" y2="966"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1078" x2="1138" y1="966" y2="966"/>
<circle cx="1074" cy="966" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="998 916, 998 1016, 1068 966, 998 916" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1018" y="930">U5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="998" y="1062">NOT</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="788" y="966">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1198" x2="1138" y1="966" y2="966"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1198" x2="1138" y1="1026" y2="1026"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1328" x2="1388" y1="996" y2="996"/>
<path d="M1276 944 A 47 47 0 1 1 1276 1037" fill="none" stroke="#000000" stroke-linecap="round" stroke-width="5"/>
<polyline fill="none" points="1277 1038, 1198 1038, 1198 944, 1277 944" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1239" y="938">U6</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1222" y="1084">AND</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="788" y="1026">A7</text>
<polyline fill="none" points="938 966, 788 966" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1138 1026, 788 1026" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="738" x2="788" y1="866" y2="816"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="738" x2="788" y1="896" y2="846"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="738" x2="788" y1="926" y2="876"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="738" x2="788" y1="1016" y2="966"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="738" x2="788" y1="1076" y2="1026"/>
<polyline fill="none" points="588 796, 738 796, 738 1076" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="1488 916, 1388 916, 1388 996" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="538 1246, 1438 1246, 1438 946, 1488 946" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 796, 2188 796" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 826, 2188 826" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 856, 2188 856" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 886, 2188 886" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 916, 2188 916" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 946, 2188 946" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 976, 2188 976" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1738 1006, 2188 1006" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polygon fill="#ffff80" points="2188 796, 2188 781, 2373 781, 2388 796, 2373 811, 2188 811, 2188 796" 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="2188" y="796">CS0</text>
<polygon fill="#ffff80" points="2188 826, 2188 811, 2373 811, 2388 826, 2373 841, 2188 841, 2188 826" 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="2188" y="826">CS1</text>
<polygon fill="#ffff80" points="2188 856, 2188 841, 2373 841, 2388 856, 2373 871, 2188 871, 2188 856" 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="2188" y="856">CS2</text>
<polygon fill="#ffff80" points="2188 886, 2188 871, 2373 871, 2388 886, 2373 901, 2188 901, 2188 886" 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="2188" y="886">CS3</text>
<polygon fill="#ffff80" points="2188 916, 2188 901, 2373 901, 2388 916, 2373 931, 2188 931, 2188 916" 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="2188" y="916">CS4</text>
<polygon fill="#ffff80" points="2188 946, 2188 931, 2373 931, 2388 946, 2373 961, 2188 961, 2188 946" 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="2188" y="946">CS5</text>
<polygon fill="#ffff80" points="2188 976, 2188 961, 2373 961, 2388 976, 2373 991, 2188 991, 2188 976" 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="2188" y="976">CS6</text>
<polygon fill="#ffff80" points="2188 1006, 2188 991, 2373 991, 2388 1006, 2373 1021, 2188 1021, 2188 1006" 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="2188" y="1006">CS7</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="796">(80H~87H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="826">(88H~8FH)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="856">(90H~97H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="886">(98H~9FH)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="916">(A0H~A7H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="946">(A8H~AFH)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="976">(B0H~B7H)</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="22" font-weight="400" text-anchor="start" x="1788" y="1006">(B8H~BFH)</text>
<polyline fill="none" points="988 466, 2188 466" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="988 616, 2188 616" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="268" x2="268" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="263" y="886">0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="248" x2="248" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="243" y="886">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="228" x2="228" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="223" y="886">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="208" x2="208" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="203" y="886">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="188" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="183" y="886">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="168" x2="168" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="163" y="886">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="148" x2="148" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="143" y="886">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="128" x2="128" y1="846" y2="896"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="15" font-weight="400" text-anchor="end" x="123" y="886">7</text>
<rect fill="#000000" fill-opacity="0.5" height="50" stroke="#a0a0a4" stroke-width="5" width="200" x="98" y="796"/>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="188" y="836">12</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="317" y="843">1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="78" y="776">DIGITAL_SOURCE</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="268" y="896">A0</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="248" y="896">A1</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="228" y="896">A2</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="208" y="896">A3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="188" y="896">A4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="168" y="896">A5</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="148" y="896">A6</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="128" y="896">A7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="288" y1="1246" y2="1246"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="128" y="1267">0</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="88" y="1216"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="132" y="1207">2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="19" y="1268">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="89" y="1319">Key = 1</text>
<polyline fill="none" points="288 1246, 388 1246" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<circle cx="638" cy="586" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<project id="a9724f84-5b10-4f80-9a59-4d6b9d9d8246" name="Lab001ww" version="1">
<files>
<filefolder id="c6367782-0a28-4c98-a5fe-d7ab4a483733" name="MEM">
<file relativepath="MEM\MEM.dlsche"/>
<file relativepath="MEM\ram.dlsche"/>
<file relativepath="MEM\ram.asm"/>
<file relativepath="MEM\ram.rxm"/>
<file relativepath="MEM\ram.bat"/>
</filefolder>
<filefolder id="b7132f26-d8eb-4047-9776-662fed73c3d9" name="IO">
<file relativepath="IO\IO.dlsche"/>
<file relativepath="IO\IO_test.dlsche"/>
</filefolder>
<filefolder id="7fa7244b-4e62-4754-8282-a4f68faa0e9f" name="tristate">
<file relativepath="tristate\8tristate.dlsche"/>
<file relativepath="tristate\tristate.dlsche"/>
</filefolder>
<filefolder id="05bbc31d-1db8-4931-a217-4066fc8d2146" 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>
<file relativepath="top.dlsche"/>
<file relativepath="README.md"/>
</files>
</project>
添加文件
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="1454" version="1.1" width="1952" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#ffff80" points="21 402, 21 377, 146 377, 171 402, 146 427, 21 427, 21 402" 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="21" y="402">ABUS[7..0]</text>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="422" y2="472"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="442" y2="492"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="462" y2="512"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="482" y2="532"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="502" y2="552"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="522" y2="572"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="542" y2="592"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="562" y2="612"/>
<polyline fill="none" points="271 472, 541 472" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 492, 541 492" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 512, 541 512" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 532, 541 532" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 552, 541 552" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 572, 541 572" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 592, 541 592" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 612, 541 612" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="472">ABUS0</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="492">ABUS1</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="512">ABUS2</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="532">ABUS3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="552">ABUS4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="572">ABUS5</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="592">ABUS6</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="341" y="612">ABUS7</text>
<polygon fill="#ffff80" points="21 682, 21 657, 146 657, 171 682, 146 707, 21 707, 21 682" 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="21" y="682">DBUS[7..0]</text>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="862" y2="812"/>
<polyline fill="none" points="541 812, 271 812" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="842" y2="792"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="822" y2="772"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="802" y2="752"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="782" y2="732"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="762" y2="712"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="742" y2="692"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="221" x2="271" y1="722" y2="672"/>
<polyline fill="none" points="271 792, 541 792" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 772, 541 772" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 752, 541 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 732, 541 732" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 712, 541 712" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 692, 541 692" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="271 672, 541 672" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="672">DBUS0</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="692">DBUS1</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="712">DBUS2</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="732">DBUS3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="752">DBUS4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="772">DBUS5</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="792">DBUS6</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="12" font-weight="400" text-anchor="start" x="311" y="812">DBUS7</text>
<polygon fill="#ffff80" points="21 1112, 21 1087, 146 1087, 171 1112, 146 1137, 21 1137, 21 1112" 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="21" y="1112">WR_OUT</text>
<polygon fill="#ffff80" points="21 892, 21 867, 146 867, 171 892, 146 917, 21 917, 21 892" 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="21" y="892">CLK</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="472">DBUS0</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="502">DBUS1</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="532">DBUS2</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="562">DBUS3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="592">DBUS4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="622">DBUS5</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="652">DBUS6</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="22" font-weight="400" text-anchor="start" x="1481" y="682">DBUS7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="472" y2="472"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="472">A0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="492" y2="492"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="492">A1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="512" y2="512"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="512">A2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="532" y2="532"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="532">A3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="552" y2="552"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="552">A4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="572" y2="572"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="572">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="592" y2="592"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="592">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="612" y2="612"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="612">A7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="672" y2="672"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="672">D0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="692" y2="692"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="692">D1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="712" y2="712"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="712">D2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="732" y2="732"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="732">D3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="752" y2="752"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="752">D4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="772" y2="772"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="772">D5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="792" y2="792"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="792">D6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="812" y2="812"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="624" y="812">D7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="472" y2="472"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="472">Q0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="492" y2="492"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="492">Q1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="512" y2="512"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="512">Q2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="532" y2="532"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="532">Q3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="552" y2="552"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="552">Q4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="572" y2="572"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="572">Q5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="592" y2="592"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="592">Q6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="741" x2="791" y1="612" y2="612"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="708" y="612">Q7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="872" y2="872"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="644" y="872">W^R</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="591" x2="541" y1="892" y2="892"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="644" y="892">CLK</text>
<rect fill="#ff8057" fill-opacity="0.5" height="490" stroke="#000000" stroke-width="5" width="150" x="591" y="442"/>
<polyline fill="none" points="591 882, 601 892, 591 902" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="90" font-weight="700" text-anchor="start" x="541" y="432">RAM</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="611" y="982">256RAM</text>
<polyline fill="none" points="1431 472, 1631 472" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 502, 1631 502" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 532, 1631 532" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 562, 1631 562" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 592, 1631 592" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 622, 1631 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 652, 1631 652" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1431 682, 1631 682" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="472" y2="422"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="502" y2="452"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="532" y2="482"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="562" y2="512"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="592" y2="542"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="622" y2="572"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="652" y2="602"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="1631" x2="1681" y1="682" y2="632"/>
<polyline fill="none" points="791 472, 1181 472" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 492, 1081 492, 1081 502, 1181 502" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 512, 1061 512, 1061 532, 1181 532" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 532, 1041 532, 1041 562, 1181 562" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 552, 1011 552, 1011 592, 1181 592" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 572, 981 572, 981 622, 1181 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 592, 951 592, 951 652, 1181 652" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="791 612, 921 612, 921 682, 1181 682" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="472" y2="472"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="472">D0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="502" y2="502"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="502">D1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="532" y2="532"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="532">D2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="562" y2="562"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="562">D3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="592" y2="592"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="592">D4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="622" y2="622"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="622">D5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="652" y2="652"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="652">D6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1381" x2="1431" y1="682" y2="682"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="1348" y="682">D7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="472" y2="472"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="472">A0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="502" y2="502"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="502">A1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="532" y2="532"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="532">A2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="562" y2="562"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="562">A3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="592" y2="592"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="592">A4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="622" y2="622"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="622">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="652" y2="652"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="652">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1231" x2="1181" y1="682" y2="682"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1264" y="682">A7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1221" x2="1181" y1="742" y2="742"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1275" y="741">^EN</text>
<rect fill="#a0c0ff" fill-opacity="0.5" height="350" stroke="#000000" stroke-width="5" width="150" x="1231" y="432"/>
<circle cx="1226" cy="742" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="60" font-weight="700" text-anchor="start" x="1131" y="412">MEM_gate</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1231" y="832">BUS_TRANS8</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="150" font-weight="700" text-anchor="start" x="651" y="192">MEM模块</text>
<polygon fill="#ffff80" points="21 1172, 21 1147, 146 1147, 171 1172, 146 1197, 21 1197, 21 1172" 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="21" y="1172">MIO</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="681" x2="621" y1="1112" y2="1112"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="681" x2="621" y1="1172" y2="1172"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="811" x2="871" y1="1142" y2="1142"/>
<path d="M677 1096 C 703 1135, 676 1185, 676 1185, 676 1185, 676 1185, 676 1185" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="677 1095, 735 1095" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="676 1185, 734 1185" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M735 1095 C 787 1095, 811 1142, 811 1142" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M733 1185 C 789 1185, 811 1142, 811 1142" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="726" y="1085">U1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="714" y="1236">OR</text>
<polygon fill="#ffff80" points="21 1372, 21 1347, 146 1347, 171 1372, 146 1397, 21 1397, 21 1372" 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="21" y="1372">READ_OUT</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="681" x2="621" y1="1312" y2="1312"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="681" x2="621" y1="1372" y2="1372"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="811" x2="871" y1="1342" y2="1342"/>
<path d="M677 1296 C 703 1335, 676 1385, 676 1385, 676 1385, 676 1385, 676 1385" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="677 1295, 735 1295" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="676 1385, 734 1385" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M735 1295 C 787 1295, 811 1342, 811 1342" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<path d="M733 1385 C 789 1385, 811 1342, 811 1342" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="726" y="1285">U2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="714" y="1436">OR</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="21" y="1312">MIO为高电平表示访问存储器</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="281" x2="221" y1="1172" y2="1172"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="361" x2="421" y1="1172" y2="1172"/>
<circle cx="357" cy="1172" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="281 1122, 281 1222, 351 1172, 281 1122" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="301" y="1136">U3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="281" y="1268">NOT</text>
<polyline fill="none" points="221 562, 221 402, 171 402" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="221 862, 221 682, 171 682" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="1681 632, 1681 412, 1781 412" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polygon fill="#ffff80" points="1781 412, 1781 387, 1906 387, 1931 412, 1906 437, 1781 437, 1781 412" 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="1781" y="412">DBUS[7..0]</text>
<polyline fill="none" points="171 1372, 621 1372" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="221 1172, 171 1172" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="421 1172, 621 1172" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="621 1112, 171 1112" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="621 1312, 521 1312, 521 1172" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="541 892, 171 892" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="871 1142, 921 1142, 921 1012, 471 1012, 471 872, 541 872" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="871 1342, 1121 1342, 1121 742, 1181 742" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<circle cx="521" cy="1172" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
/*******************************************************************************
Copyright (c) 2008 - 2018 北京英真时代科技有限公司。保留所有权利。
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef unsigned char BYTE;
typedef long BOOL;
#define FALSE 0
#define TRUE 1
#define MAX_LINE_LENGTH 256 // 一行代码最多可以有多少个字符
#define MAX_LINE_COUNT 1024 // 源代码文件最多可以有多少行
#define MAX_MACHINE_CODE_BYTE_COUNT 256 // 源代码编译后最多可以有多少个字节机器码
#define MAX_SYMBOL_LENGTH 64 // 一个符号最多可以包含多少个字符
#define MAX_SYMBOL_COUNT 256 // 源代码文件中最多可以包含多少个符号
#ifndef MAX_PATH
#define MAX_PATH 256 // 文件路径最多可以包含多少个字符
#endif
// 代码行数据库。记录源代码文件中所有代码行的信息(包括注释行、空行)
struct LINE_RECORD
{
char line_string[MAX_LINE_LENGTH]; // 代码行的内容
unsigned long line_num; // 行号
unsigned long address; // 此行代码转换的机器码在映像文件中的地址(偏移)
int machine_code_count; // 此行代码转换的机器码的字节数量
unsigned long flag; // 代码行标志位,32位
};
struct LINE_RECORD line_database[MAX_LINE_COUNT] = { 0 };
int line_count = 0;
int machine_code_line_count = 0; // 记录产生了机器码的代码行的数量
// 在此定义所有的代码行标志位。注意,代码行标志位是按位或的关系。
#define LF_INSTRUCTION 0x00000001 // 代码行标志位的最低位是1,表示此行是一条指令,否则表示此行是数据
// 重定位表。如果指令中使用了标号、变量名等符号,在第一次扫描时无法确定他们的地址,需要
// 在第二次扫描时进行重定位。
struct REALLOCATE
{
unsigned long address; // 第一次扫描时,在这里记录了需要重定位的机器码的地址(偏移),
// 第二次扫描时,根据符号的地址进行重定位。
char symbol_name[MAX_SYMBOL_LENGTH]; // 需要重定位的符号名称。
int line_num; // 行号。
};
struct REALLOCATE reallocate_table[MAX_LINE_COUNT] = { 0 };
int reallocate_count = 0;
// 符号表。符号包括源代码中的标号、变量名。
struct SYMBOL
{
char name[MAX_SYMBOL_LENGTH]; // 符号名称
unsigned long address; // 符号表示的地址。重定位时需要用到。
int machine_code_count; // 符号生成的机器码的数量(以字节为单位)。
int line_num; // 行号
int ref_count; // 引用计数
};
struct SYMBOL symbol_table[MAX_SYMBOL_COUNT] = { 0 };
int symbol_count = 0;
// 汇编过程的状态
enum
{
AS_BEGIN // 起始状态。在遇到代码段名称前,处于此状态
, AS_INT_TABLE // 正在处理中断向量列表。遇到向量列表名称后,遇到代码段名称前,处于此状态
, AS_TEXT // 正在处理代码段。遇到代码段名称后,遇到数据的名称前,处于此状态
, AS_DATA // 正在处理数据段。遇到数据段名称后,处于此状态
};
unsigned long assembler_state = AS_BEGIN;
//
// 在下面定义所有的关键字
//
// 段名称
const char* int_table_section_keyword = ".int_table"; // 中断向量列表标志
const char* code_section_keyword = ".text"; // 代码段标志
char const* data_section_keyword = ".data"; // 数据段标志
// 指令名称
const char* mov_instruction_keyword = "mov";
const char* add_instruction_keyword = "add";
const char* adc_instruction_keyword = "adc";
const char* sub_instruction_keyword = "sub";
const char* sbb_instruction_keyword = "sbb";
const char* and_instruction_keyword = "and";
const char* or_instruction_keyword = "or";
const char* xor_instruction_keyword = "xor";
const char* shr_instruction_keyword = "shr";
const char* shl_instruction_keyword = "shl";
const char* rcr_instruction_keyword = "rcr";
const char* rcl_instruction_keyword = "rcl";
const char* sal_instruction_keyword = "sal";
const char* sar_instruction_keyword = "sar";
const char* rol_instruction_keyword = "rol";
const char* ror_instruction_keyword = "ror";
const char* not_instruction_keyword = "not";
const char* push_instruction_keyword = "push";
const char* pop_instruction_keyword = "pop";
const char* in_instruction_keyword = "in";
const char* out_instruction_keyword = "out";
const char* call_instruction_keyword = "call";
const char* ret_instruction_keyword = "ret";
const char* int_instruction_keyword = "int";
const char* iret_instruction_keyword = "iret";
const char* inc_instruction_keyword = "inc";
const char* dec_instruction_keyword = "dec";
const char* lea_instruction_keyword = "lea";
const char* cmp_instruction_keyword = "cmp";
const char* nop_instruction_keyword = "nop";
const char* cli_instruction_keyword = "cli";
const char* sti_instruction_keyword = "sti";
const char* jmp_instruction_keyword = "jmp";
const char* jc_instruction_keyword = "jc";
const char* jz_instruction_keyword = "jz";
const char* je_instruction_keyword = "je";
const char* jne_instruction_keyword = "jne";
const char* jnz_instruction_keyword = "jnz";
// 通用寄存器名称
const char* al_register_keyword = "al";
const char* bl_register_keyword = "bl";
const char* cl_register_keyword = "cl";
const char* dl_register_keyword = "dl";
const char* sp_register_keyword = "sp";
const char* bp_register_keyword = "bp";
const char* si_register_keyword = "si";
const char* di_register_keyword = "di";
const char* cs_register_keyword = "cs";
const char* ds_register_keyword = "ds";
const char* ss_register_keyword = "ss";
const char* es_register_keyword = "es";
const char* al_register_indirect_keyword = "[al]";
const char* bl_register_indirect_keyword = "[bl]";
const char* cl_register_indirect_keyword = "[cl]";
const char* dl_register_indirect_keyword = "[dl]";
const char* sp_register_indirect_keyword = "[sp]";
const char* bp_register_indirect_keyword = "[bp]";
const char* si_register_indirect_keyword = "[si]";
const char* di_register_indirect_keyword = "[di]";
const char* cs_register_indirect_keyword = "[cs]";
const char* ds_register_indirect_keyword = "[ds]";
const char* ss_register_indirect_keyword = "[ss]";
const char* es_register_indirect_keyword = "[es]";
const char* delimit_char = "\n\t\r "; // 需要忽略的空白字符
const char* delimit_char_comma = "\n\t\r, "; // 需要忽略的空白字符,包括英文逗号
// 汇编产生的机器码
#define MAX_MACHINE_CODE 1024
BYTE machine_code[MAX_MACHINE_CODE];
unsigned long machine_code_address = 0;
unsigned long machine_code_old_address = 0;
const char* assembly_file_name = NULL; // 汇编文件路径
const char* target_file_name = NULL; // 目标文件路径
const char* list_file_name = NULL; // 列表文件路径
const char* dbg_file_name = NULL; // 调试信息文件路径
const unsigned long dbg_file_magic = 58;
const unsigned long dbg_file_version = 1;
// 输出汇编过程中发现的语法错误信息
void error_msg(const char* error_msg, int line_num)
{
if (line_num >= 1)
{
printf("%s:%d: error: %s\n", assembly_file_name, line_num, error_msg);
}
else
{
printf("%s: error: %s\n", assembly_file_name, error_msg);
}
exit(1);
}
char formated_msg[1024]; // 将格式化后的错误信息放在此字符串中。
void error_msg_miss_op(const char* instruction_name, int line_num)
{
sprintf(formated_msg, "%s 指令缺少操作数。", instruction_name);
error_msg(formated_msg, line_num);
}
void error_msg_wrong_op(const char* instruction_name, int line_num)
{
sprintf(formated_msg, "%s 指令不支持这样的操作数。", instruction_name);
error_msg(formated_msg, line_num);
}
void error_msg_same_symbol(const char* symbol, int line_num, int ref_line_num)
{
sprintf(formated_msg, "符号 %s 重复定义。参见第 %d 行。", symbol, ref_line_num);
error_msg(formated_msg, line_num);
}
void error_msg_keyword_symbol(const char* symbol, int line_num)
{
sprintf(formated_msg, "不能使用保留的关键字 %s 作为符号名称。", symbol);
error_msg(formated_msg, line_num);
}
void error_msg_keyword_int_vector(const char* vector, int line_num)
{
sprintf(formated_msg, "不能使用保留的关键字 %s 作为中断向量名称。", vector);
error_msg(formated_msg, line_num);
}
void error_msg_wrong_data(const char* data, int line_num)
{
sprintf(formated_msg, "%s 不是有效的数据。", data);
error_msg(formated_msg, line_num);
}
// 输出汇编过程中发现的警告信息
void warning_msg(const char* warning_msg, int line_num)
{
if (line_num >= 1)
{
printf("%s:%d: warning: %s\n", assembly_file_name, line_num, warning_msg);
}
else
{
printf("%s: warning: %s\n", assembly_file_name, warning_msg);
}
}
void warning_msg_invalid_line(int line_num)
{
warning_msg("忽略无效的代码行。", line_num);
}
void warning_msg_unref_symbol(const char* symbol, int line_num)
{
sprintf(formated_msg, "符号 %s 未被引用。", symbol);
warning_msg(formated_msg, line_num);
}
// 判断是否是立即数。如果是数字开头,或者是负号开头的,就认为是立即数。
int is_immediate(const char* token)
{
return (isdigit(token[0]) || '-' == token[0]) ? 1 : 0;
}
// 判断是否是立即数地址。类如,[4]
int is_immediate_address(const char* token)
{
// 最后一个字符必须是"]"
if (token[strlen(token) - 1] != ']')
{
return 0;
}
// 第一个字符必须是"["
if (token[0] != '[')
{
return 0;
}
// 后面的字符必须是数字开头
return (isdigit(token[1]) || ' ' == token[1]) ? 1 : 0;
}
// 判断是否是主存数据
int is_main_memory(const char* token)
{
return (isdigit(token[0]) || '@' == token[0]) ? 1 : 0;
}
// 指令操作数类型
enum
{
OT_REGISTER_AL // al
, OT_REGISTER_BL // bl
, OT_REGISTER_CL // cl
, OT_REGISTER_DL // dl
, OT_REGISTER_SP // sp
, OT_REGISTER_BP // bp
, OT_REGISTER_SI // si
, OT_REGISTER_DI // di
, OT_REGISTER_CS // cs
, OT_REGISTER_DS // ds
, OT_REGISTER_SS // ss
, OT_REGISTER_ES // es
, OT_REGISTER_AL_INDIRECT // [al]
, OT_REGISTER_BL_INDIRECT // [bl]
, OT_REGISTER_CL_INDIRECT // [cl]
, OT_REGISTER_DL_INDIRECT // [dl]
, OT_REGISTER_SP_INDIRECT // [sp]
, OT_REGISTER_BP_INDIRECT // [bp]
, OT_REGISTER_SI_INDIRECT // [si]
, OT_REGISTER_DI_INDIRECT // [di]
, OT_REGISTER_CS_INDIRECT // [cs]
, OT_REGISTER_DS_INDIRECT // [ds]
, OT_REGISTER_SS_INDIRECT // [ss]
, OT_REGISTER_ES_INDIRECT // [es]
, OT_IMMEDIATE // 立即数
, OT_SYMBOL // 符号
};
// 得到指令操作数的类型
unsigned long get_operand_type(const char* op)
{
unsigned long op_type;
if (stricmp(op, al_register_keyword) == 0)
{
op_type = OT_REGISTER_AL;
}
else if (stricmp(op, bl_register_keyword) == 0)
{
op_type = OT_REGISTER_BL;
}
else if (stricmp(op, cl_register_keyword) == 0)
{
op_type = OT_REGISTER_CL;
}
else if (stricmp(op, dl_register_keyword) == 0)
{
op_type = OT_REGISTER_DL;
}
else if (stricmp(op, sp_register_keyword) == 0)
{
op_type = OT_REGISTER_SP;
}
else if (stricmp(op, bp_register_keyword) == 0)
{
op_type = OT_REGISTER_BP;
}
else if (stricmp(op, si_register_keyword) == 0)
{
op_type = OT_REGISTER_SI;
}
else if (stricmp(op, di_register_keyword) == 0)
{
op_type = OT_REGISTER_DI;
}
else if (stricmp(op, cs_register_keyword) == 0)
{
op_type = OT_REGISTER_CS;
}
else if (stricmp(op, ds_register_keyword) == 0)
{
op_type = OT_REGISTER_DS;
}
else if (stricmp(op, ss_register_keyword) == 0)
{
op_type = OT_REGISTER_SS;
}
else if (stricmp(op, es_register_keyword) == 0)
{
op_type = OT_REGISTER_ES;
}
else if (stricmp(op, al_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_AL_INDIRECT;
}
else if (stricmp(op, bl_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_BL_INDIRECT;
}
else if (stricmp(op, cl_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_CL_INDIRECT;
}
else if (stricmp(op, dl_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_DL_INDIRECT;
}
else if (stricmp(op, sp_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_SP_INDIRECT;
}
else if (stricmp(op, bp_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_BP_INDIRECT;
}
else if (stricmp(op, si_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_SI_INDIRECT;
}
else if (stricmp(op, di_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_DI_INDIRECT;
}
else if (stricmp(op, cs_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_CS_INDIRECT;
}
else if (stricmp(op, ds_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_DS_INDIRECT;
}
else if (stricmp(op, ss_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_SS_INDIRECT;
}
else if (stricmp(op, es_register_indirect_keyword) == 0)
{
op_type = OT_REGISTER_ES_INDIRECT;
}
else if (is_immediate(op))
{
op_type = OT_IMMEDIATE;
}
else
{
op_type = OT_SYMBOL;
}
return op_type;
}
// 根据寄存器,得到一个机器码
char get_machine_code_from_r(unsigned long op_type)
{
return (char)(op_type - OT_REGISTER_AL);
}
// 根据通用寄存器和机器码的基础值,得到一个机器码
char get_machine_code_from_r_indirect(unsigned long op_type)
{
return (char)(op_type - OT_REGISTER_AL_INDIRECT);
}
// 根据立即数得到一个机器码。注意,允许使用负数,所以返回值是带符号的 8 位 char。
char get_machine_code_from_immediate(const char* immediate)
{
char* end;
int start_index = (immediate[0] == '-' ? 1 : 0);
int base = (immediate[start_index] == '0' && (immediate[start_index + 1] == 'x' || immediate[start_index + 1] == 'X')) ? 16 : 10;
return (char)strtol(immediate, &end, base);
}
// 根据立即数地址得到一个机器码。首先去除中括号,再将立即数转换为带符号的8位字符。
char get_machine_code_from_immediate_address(const char* immediate)
{
char d[7];
int i = 0;
int t = strlen(immediate);
for (; i < t - 2; i++)
{
d[i] = immediate[i + 1];
}
char* temp;
int base = (immediate[1] == '0' && (immediate[2] == 'x' || immediate[2] == 'X')) ? 16 : 10;
return (char)strtol(d, &temp, base);
}
// 向重定位表中添加一个重定位信息
void add_reallocate(const char* symbol, int line_num)
{
reallocate_table[reallocate_count].address = machine_code_address;
strcpy(reallocate_table[reallocate_count].symbol_name, symbol);
reallocate_table[reallocate_count].line_num = line_num;
reallocate_count++;
}
//////////////////////////////////////////////////////////////////////////////////////
// 汇编指令编译函数
// mov op1, op2
//
void parse_mov(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(mov_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_ES)
&& OT_IMMEDIATE == op2_type)
{
// mov reg, immediate
// 操作码
machine_code[machine_code_address] = 0x01;
machine_code_address++;
// reg为目的寄存器操作数
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数机器码
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_ES)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_ES))
{
// mov reg, reg
// 操作码
machine_code[machine_code_address] = 0x02;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_ES) && OT_SYMBOL == op2_type)
{
// mov reg, symbol
// 操作码
machine_code[machine_code_address] = 0x03;
machine_code_address++;
// 目的操作数机器码
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_ES)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_ES_INDIRECT))
{
// mov reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x04;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL_INDIRECT && op1_type <= OT_REGISTER_ES_INDIRECT)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_ES))
{
// mov [reg], reg
// 操作码
machine_code[machine_code_address] = 0x05;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r_indirect(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL_INDIRECT && op1_type <= OT_REGISTER_ES_INDIRECT) && OT_IMMEDIATE == op2_type)
{
// mov [reg], immediate
// 操作码
machine_code[machine_code_address] = 0x06;
machine_code_address++;
// 目的操作数
machine_code[machine_code_address] = get_machine_code_from_r_indirect(op1_type);
machine_code_address++;
// 立即数机器码
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else if (OT_SYMBOL == op1_type && (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_ES))
{
// mov symbol, reg
machine_code[machine_code_address] = 0x07;
machine_code_address++;
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
machine_code[machine_code_address] = rs;
machine_code_address++;
// 重定位
add_reallocate(op1, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(mov_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////////////////
// 加法指令
// add op1, op2
void parse_add(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(add_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// add reg, reg
// 操作码
machine_code[machine_code_address] = 0x08;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// add reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x0a;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// add reg, symbol
// 操作码
machine_code[machine_code_address] = 0x0c;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// add reg, immediate
machine_code[machine_code_address] = 0x0e;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(add_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// 带进位的加法指令
// adc op1, op2
void parse_adc(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(adc_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// adc reg, reg
// 操作码
machine_code[machine_code_address] = 0x10;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// adc reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x12;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// adc reg, symbol
// 操作码
machine_code[machine_code_address] = 0x14;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// adc reg, immediate
machine_code[machine_code_address] = 0x16;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(adc_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
////////////////////////////////////////////////////////////////////////////////////////////
// 减法指令
// sub op1, op2
void parse_sub(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(sub_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// sub reg, reg
// 操作码
machine_code[machine_code_address] = 0x18;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// sub reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x1a;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// sub reg, symbol
// 操作码
machine_code[machine_code_address] = 0x1c;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// sub reg, immediate
machine_code[machine_code_address] = 0x1e;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(sub_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 借位减法指令
// sbb op1, op2
void parse_sbb(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(sbb_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// sbb reg, reg
// 操作码
machine_code[machine_code_address] = 0x20;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// sbb reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x22;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// sbb reg, symbol
// 操作码
machine_code[machine_code_address] = 0x24;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// sbb reg, immediate
machine_code[machine_code_address] = 0x26;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(sbb_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////////////////////////////
// 增减1指令
// inc reg
void parse_inc(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(inc_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (op_type >= OT_REGISTER_AL && op_type <= OT_REGISTER_DI)
{
//
machine_code[machine_code_address] = 0x78;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op_type);
machine_code_address++;
}
else
{
error_msg_wrong_op(inc_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// dec reg
void parse_dec(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(dec_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (op_type >= OT_REGISTER_AL && op_type <= OT_REGISTER_DI)
{
//
machine_code[machine_code_address] = 0x79;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op_type);
machine_code_address++;
}
else
{
error_msg_wrong_op(dec_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////////////////////////////////////
// 按位与指令
// and op1, op2
void parse_and(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(and_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// and reg, reg
// 操作码
machine_code[machine_code_address] = 0x2a;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// and reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x2c;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// and reg, symbol
// 操作码
machine_code[machine_code_address] = 0x2e;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// and reg, immediate
machine_code[machine_code_address] = 0x30;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(and_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////////////////////////
// 按位或指令
// or op1, op2
void parse_or(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(or_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// or reg, reg
// 操作码
machine_code[machine_code_address] = 0x32;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// or reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x34;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// or reg, symbol
// 操作码
machine_code[machine_code_address] = 0x36;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// or reg, immediate
machine_code[machine_code_address] = 0x38;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(or_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////////////////////////
// 按位异或指令
// xor op1, op2
void parse_xor(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(xor_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// xor reg, reg
// 操作码
machine_code[machine_code_address] = 0x3a;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL_INDIRECT && op2_type <= OT_REGISTER_DI_INDIRECT))
{
// xor reg, [reg]
// 操作码
machine_code[machine_code_address] = 0x3c;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r_indirect(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// xor reg, symbol
// 操作码
machine_code[machine_code_address] = 0x3e;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// xor reg, immediate
machine_code[machine_code_address] = 0x40;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else
{
error_msg_wrong_op(xor_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
////////////////////////////////////////////////////
//
// push reg
void parse_push(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char_comma);
if (NULL == op)
{
error_msg_miss_op(push_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (op_type >= OT_REGISTER_AL && op_type <= OT_REGISTER_ES)
{
machine_code[machine_code_address] = 0x42;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op_type);
machine_code_address++;
}
else
{
error_msg_wrong_op(push_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////
//
// pop reg
void parse_pop(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char_comma);
if (NULL == op)
{
error_msg_miss_op(pop_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (op_type >= OT_REGISTER_AL && op_type <= OT_REGISTER_ES)
{
machine_code[machine_code_address] = 0x43;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op_type);
machine_code_address++;
}
else
{
error_msg_wrong_op(pop_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////////////////
//
// not reg
void parse_not(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(not_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
// 目标操作数只能是通用寄存器
if (op_type >= OT_REGISTER_AL && op_type <= OT_REGISTER_DI)
{
machine_code[machine_code_address] = 0x44;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op_type);
machine_code_address++;
}
else
{
error_msg_wrong_op(not_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////////////
//
// cmp op1, op2
void parse_cmp(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(cmp_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_IMMEDIATE == op2_type)
{
// cmp reg, immediate
machine_code[machine_code_address] = 0x47;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 立即数
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// cmp reg, reg
// 操作码
machine_code[machine_code_address] = 0x49;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(xor_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////
//
// 接口访问指令
// in op1, op2
void parse_in(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(in_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if (OT_REGISTER_AL == op1_type && OT_IMMEDIATE == op2_type)
{
// in al, imm
machine_code[machine_code_address] = 0x4b;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
machine_code[machine_code_address] = get_machine_code_from_immediate(op2);
machine_code_address++;
}
else if (OT_REGISTER_AL == op1_type && OT_REGISTER_DL == op2_type)
{
// in al, dl
machine_code[machine_code_address] = 0x4c;
machine_code_address++;
//
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
rd = get_machine_code_from_r(op1_type);
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(in_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// out op1, op2
void parse_out(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(out_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if (OT_REGISTER_DL == op1_type && OT_REGISTER_AL == op2_type)
{
// out dl, al
machine_code[machine_code_address] = 0x4d;
machine_code_address++;
//
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
rd = get_machine_code_from_r(op1_type);
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else if (OT_IMMEDIATE == op1_type && OT_REGISTER_AL == op2_type)
{
// out imm, al
machine_code[machine_code_address] = 0x4e;
machine_code_address++;
//
machine_code[machine_code_address] = get_machine_code_from_r(op2_type);
machine_code_address++;
machine_code[machine_code_address] = get_machine_code_from_immediate(op1);
machine_code_address++;
}
else
{
error_msg_wrong_op(out_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
///////////////////////////////////////////////////////
//
// lea reg, symbol
void parse_lea(int line_num)
{
char *op1, *op2;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(lea_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI) && OT_SYMBOL == op2_type)
{
// lea reg, symbol
machine_code[machine_code_address] = 0x4f;
machine_code_address++;
machine_code[machine_code_address] = get_machine_code_from_r(op1_type);
machine_code_address++;
// 重定位
add_reallocate(op2, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(lea_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////
//
// jz/je symbol
void parse_jz(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(jz_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (OT_SYMBOL == op_type)
{
// jz symbol
machine_code[machine_code_address] = 0x54;
machine_code_address++;
// 重定位
add_reallocate(op, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(jz_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////
//
// jnz/jne symbol
void parse_jnz(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(jnz_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (OT_SYMBOL == op_type)
{
machine_code[machine_code_address] = 0x55;
machine_code_address++;
// 重定位
add_reallocate(op, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(jnz_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////
//
// jc symbol
void parse_jc(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(jc_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (OT_SYMBOL == op_type)
{
machine_code[machine_code_address] = 0x56;
machine_code_address++;
// 重定位
add_reallocate(op, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(jc_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////
// jmp symbol
void parse_jmp(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(jmp_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (OT_SYMBOL == op_type)
{
// jmp symbol
machine_code[machine_code_address] = 0x57;
machine_code_address++;
// 重定位
add_reallocate(op, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(jmp_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
////////////////////////////////////////////////////////////////////////////////////
//
// int immediate
void parse_int(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(int_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (OT_IMMEDIATE == op_type)
{
// int immediate
machine_code[machine_code_address] = 0x5a;
machine_code_address++;
//
machine_code[machine_code_address] = 0xB4;
machine_code_address++;
machine_code[machine_code_address] = get_machine_code_from_immediate(op);
machine_code_address++;
}
else
{
error_msg_wrong_op(int_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// iret
void parse_iret(int line_num)
{
machine_code[machine_code_address] = 0x5d;
machine_code_address++;
//
machine_code[machine_code_address] = 0x44;
machine_code_address++;
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////
//
// 移位指令
// sal op1, op2
void parse_sal(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(sal_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x5f;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(sal_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// sar op1, op2
void parse_sar(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(sar_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x61;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(sar_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// shl op1, op2
void parse_shl(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(shl_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x63;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(shl_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// shr op1, op2
void parse_shr(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(shr_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x65;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(shr_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// rol op1, op2
void parse_rol(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(rol_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x67;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(rol_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// ror op1, op2
void parse_ror(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(ror_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x69;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(ror_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// rcl op1, op2
void parse_rcl(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(rcl_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x6b;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(rcl_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// rcr op1, op2
void parse_rcr(int line_num)
{
char *op1, *op2;
char rs, rd;
unsigned long op1_type, op2_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op1 = strtok(NULL, delimit_char_comma);
op2 = strtok(NULL, delimit_char);
if (NULL == op1 || NULL == op2)
{
error_msg_miss_op(rcr_instruction_keyword, line_num);
}
op1_type = get_operand_type(op1);
op2_type = get_operand_type(op2);
if ((op1_type >= OT_REGISTER_AL && op1_type <= OT_REGISTER_DI)
&& (op2_type >= OT_REGISTER_AL && op2_type <= OT_REGISTER_DI))
{
// 操作码
machine_code[machine_code_address] = 0x6d;
machine_code_address++;
// 源操作数寄存器rs
rs = get_machine_code_from_r(op2_type);
rs = rs << 4;
// 目的操作数
rd = get_machine_code_from_r(op1_type);
// 操作数机器码
machine_code[machine_code_address] = rs | rd;
machine_code_address++;
}
else
{
error_msg_wrong_op(rcr_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////////////////
//
// nop
void parse_nop(int line_num)
{
machine_code[machine_code_address] = 0x6f;
machine_code_address++;
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
//////////////////////////////////////////////////////////////////////////
//
// call symbol
void parse_call(int line_num)
{
char *op;
unsigned long op_type;
if (assembler_state != AS_TEXT)
{
warning_msg_invalid_line(line_num);
return;
}
op = strtok(NULL, delimit_char);
if (NULL == op)
{
error_msg_miss_op(call_instruction_keyword, line_num);
}
op_type = get_operand_type(op);
if (OT_SYMBOL == op_type)
{
// call symbol
machine_code[machine_code_address] = 0x71;
machine_code_address++;
// 重定位
add_reallocate(op, line_num);
machine_code_address++;
}
else
{
error_msg_wrong_op(call_instruction_keyword, line_num);
}
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////////////////
//
// ret
void parse_ret(int line_num)
{
machine_code[machine_code_address] = 0x73;
machine_code_address++;
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////////////////
//
// cli
void parse_cli(int line_num)
{
machine_code[machine_code_address] = 0x74;
machine_code_address++;
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
/////////////////////////////////////////////////////////////////////////////
//
// sti
void parse_sti(int line_num)
{
machine_code[machine_code_address] = 0x75;
machine_code_address++;
//
// 在代码行数据库中,标记此行是一个指令行
//
line_database[line_count].flag |= LF_INSTRUCTION;
}
// 向符号表中添加一个符号
void add_symbol(const char* symbol, int line_num)
{
int i;
// 符号名称不能重复
for (i = 0; i < symbol_count; i++)
{
if (stricmp(symbol, symbol_table[i].name) == 0)
{
error_msg_same_symbol(symbol, line_num, symbol_table[i].line_num);
}
}
// 符号数量有限
if (symbol_count == MAX_SYMBOL_COUNT)
{
sprintf(formated_msg, "定义了太多的符号。最多可以定义 %d 个符号。", MAX_SYMBOL_COUNT);
error_msg(formated_msg, line_num);
}
// 添加符号
strcpy(symbol_table[symbol_count].name, symbol);
symbol_table[symbol_count].address = machine_code_address;
symbol_table[symbol_count].line_num = line_num;
symbol_count++;
}
// 解析符号
void parse_symbol(const char* symbol_with_colon, int line_num)
{
char symbol[MAX_SYMBOL_LENGTH];
char* token;
// 删除符号末尾的冒号
strcpy(symbol, symbol_with_colon);
symbol[strlen(symbol) - 1] = 0;
if (AS_TEXT == assembler_state)
{
// 代码段中的标号作为符号。记录到符号表中,不产生机器码。
add_symbol(symbol, line_num);
// 标号必须单独占一行,否则报错
if (strtok(NULL, delimit_char) != NULL)
{
error_msg("标号必须单独占用一行。", line_num);
}
}
else if (AS_DATA == assembler_state)
{
// 数据段中的变量作为符号。一个变量可以包含多个字节数据。记录到符号表中,产生机器码。
add_symbol(symbol, line_num);
while ((token = strtok(NULL, delimit_char)) != NULL)
{
if (!is_immediate(token))
{
error_msg_wrong_data(token, line_num);
}
machine_code[machine_code_address] = get_machine_code_from_immediate(token);
machine_code_address++;
symbol_table[symbol_count - 1].machine_code_count++;
}
}
else
{
warning_msg_invalid_line(line_num);
}
}
// 解析中断向量
void parse_int_vector(const char* symbol_with_colon, int line_num)
{
char symbol[MAX_SYMBOL_LENGTH];
char* token;
if (AS_INT_TABLE == assembler_state)
{
// 重定位
add_reallocate(symbol_with_colon, line_num);
machine_code_address++;
// 中断向量必须单独占一行,否则报错
if (strtok(NULL, delimit_char) != NULL)
{
error_msg("中断向量必须单独占用一行。", line_num);
}
}
}
// 解析中断向量表开始标志
void parse_int_table_section_keyword(int line_num)
{
// 中断向量表标志
if (AS_TEXT == assembler_state)
{
error_msg("中断向量表不能定义在代码段的后面。", line_num);
}
else if (AS_INT_TABLE == assembler_state)
{
error_msg("定义了重复的中断向量列表。", line_num);
}
assembler_state = AS_INT_TABLE;
}
// 解析代码段开始标志
void parse_code_section_keyword(int line_num)
{
// 代码段标志
if (AS_DATA == assembler_state)
{
error_msg("代码段不能定义在数据段的后面。", line_num);
}
else if (AS_TEXT == assembler_state)
{
error_msg("定义了重复的代码段。", line_num);
}
//若当前地址小于0x10,则补充空行
for (; machine_code_address < 0x10;)
{
line_database[line_count].line_num = line_num;
line_database[line_count].address = machine_code_address;
machine_code_address++;
machine_code_old_address++;
}
// 代码段的起始地址为0x10
assembler_state = AS_TEXT;
}
// 解析数据段开始标志
void parse_data_section_keyword(int line_num)
{
// 数据段标志
if (AS_DATA == assembler_state)
{
error_msg("定义了重复的数据段。", line_num);
}
else if (AS_BEGIN == assembler_state)
{
error_msg("数据段不能定义在代码段的前面。", line_num);
}
assembler_state = AS_DATA;
}
// 定义关键字和解析函数的对应关系
typedef void(*PARSE_FUNCTION)(int line_num);
struct KEYWORD_FUNCTION_ENTRY
{
const char** keyword;
PARSE_FUNCTION parse_function;
};
//
// 必须将关键字及其解析函数放在下面的表中。从而可以使用“表驱动”的编程模式。
//
struct KEYWORD_FUNCTION_ENTRY keyword_function_table[] =
{
{ NULL, NULL } // 未用
,{ &int_table_section_keyword, parse_int_table_section_keyword }
,{ &code_section_keyword, parse_code_section_keyword }
,{ &data_section_keyword, parse_data_section_keyword }
,{ &mov_instruction_keyword, parse_mov }
,{ &jmp_instruction_keyword, parse_jmp }
,{ &add_instruction_keyword, parse_add }
,{ &adc_instruction_keyword, parse_adc }
,{ &sub_instruction_keyword, parse_sub }
,{ &sbb_instruction_keyword, parse_sbb }
,{ &and_instruction_keyword, parse_and }
,{ &or_instruction_keyword, parse_or }
,{ &jc_instruction_keyword, parse_jc }
,{ &jz_instruction_keyword, parse_jz }
,{ &je_instruction_keyword, parse_jz }
,{ &jnz_instruction_keyword, parse_jnz }
,{ &jne_instruction_keyword, parse_jnz }
,{ &call_instruction_keyword, parse_call }
,{ &push_instruction_keyword, parse_push }
,{ &pop_instruction_keyword, parse_pop }
,{ &in_instruction_keyword, parse_in }
,{ &out_instruction_keyword, parse_out }
,{ &ret_instruction_keyword, parse_ret }
,{ &shr_instruction_keyword, parse_shr }
,{ &shl_instruction_keyword, parse_shl }
,{ &rcr_instruction_keyword, parse_rcr }
,{ &rcl_instruction_keyword, parse_rcl }
,{ &sal_instruction_keyword, parse_sal }
,{ &sar_instruction_keyword, parse_sar }
,{ &rol_instruction_keyword, parse_rol }
,{ &ror_instruction_keyword, parse_ror }
,{ &not_instruction_keyword, parse_not }
,{ &iret_instruction_keyword, parse_iret }
,{ &nop_instruction_keyword, parse_nop }
,{ &int_instruction_keyword, parse_int }
,{ &lea_instruction_keyword, parse_lea }
,{ &inc_instruction_keyword, parse_inc }
,{ &dec_instruction_keyword, parse_dec }
,{ &cmp_instruction_keyword, parse_cmp }
,{ &cli_instruction_keyword, parse_cli }
,{ &sti_instruction_keyword, parse_sti }
,{ &al_register_keyword, NULL }
,{ &bl_register_keyword, NULL }
,{ &cl_register_keyword, NULL }
,{ &dl_register_keyword, NULL }
,{ &sp_register_keyword, NULL }
,{ &bp_register_keyword, NULL }
,{ &si_register_keyword, NULL }
,{ &di_register_keyword, NULL }
,{ &cs_register_keyword, NULL }
,{ &ds_register_keyword, NULL }
,{ &ss_register_keyword, NULL }
,{ &es_register_keyword, NULL }
,{ &al_register_indirect_keyword, NULL }
,{ &bl_register_indirect_keyword, NULL }
,{ &cl_register_indirect_keyword, NULL }
,{ &dl_register_indirect_keyword, NULL }
,{ &sp_register_indirect_keyword, NULL }
,{ &bp_register_indirect_keyword, NULL }
,{ &si_register_indirect_keyword, NULL }
,{ &di_register_indirect_keyword, NULL }
,{ &cs_register_indirect_keyword, NULL }
,{ &ds_register_indirect_keyword, NULL }
,{ &ss_register_indirect_keyword, NULL }
,{ &es_register_indirect_keyword, NULL }
};
// 判断是否是一个关键字。返回0,不是关键字;返回非0,是关键字,并且返回值就是关键字在表中的下标。
int match_keyword(const char* token)
{
int i;
for (i = 1; i < sizeof(keyword_function_table) / sizeof(keyword_function_table[0]); i++)
{
if (stricmp(token, *keyword_function_table[i].keyword) == 0)
{
return i;
}
}
return 0;
}
// 判断是否是一个符号
int is_symbol(const char* token, int line_num)
{
int i;
char symbol_name[MAX_SYMBOL_LENGTH];
// 最后一个字符必须是冒号
if (token[strlen(token) - 1] != ':')
{
return 0;
}
// 第一个字符必须是字母或者下划线
if (token[0] != '_' && !isalpha(token[0]))
{
return 0;
}
// 后面的字符必须是字母、数字、下划线
for (i = 0; i < (int)strlen(token) - 2; i++)
{
if (token[i] != '_' && !isalpha(token[i]) && !isdigit(token[i]))
{
return 0;
}
}
// 不能与关键字相同
strcpy(symbol_name, token);
symbol_name[strlen(symbol_name) - 1] = 0;
if (match_keyword(symbol_name) != 0)
{
error_msg_keyword_symbol(symbol_name, line_num);
}
return 1;
}
// 判断是否是一个中断向量
int is_int_vector(const char* token, int line_num)
{
int i;
char vector_name[MAX_SYMBOL_LENGTH];
// 第一个字符必须是字母或者下划线
if (token[0] != '_' && !isalpha(token[0]))
{
return 0;
}
// 后面的字符必须是字母、数字、下划线
for (i = 0; i < (int)strlen(token) - 2; i++)
{
if (token[i] != '_' && !isalpha(token[i]) && !isdigit(token[i]))
{
return 0;
}
}
// 不能与关键字相同
strcpy(vector_name, token);
if (match_keyword(vector_name) != 0)
{
error_msg_keyword_int_vector(vector_name, line_num);
}
return 1;
}
// 输出版本信息
void version_msg()
{
printf(
"Engintime DM1000 8位模型机汇编器 [版本 2.0]\n"
"版权所有 (c) 2008-2018 北京英真时代科技有限公司。保留所有权利。\n"
);
}
// 输出帮助信息
void help_msg()
{
printf(
"Engintime DM1000 8位模型机汇编器。\n\n"
"用法:\n\n"
" dmasm.exe assembly_file_name [options]\n\n"
"选项:\n\n"
" -g debug_file_name\t指定生成的调试信息文件路径。\n"
" -h\t\t\t打印此帮助信息。\n"
" -l list_file_name\t指定生成的列表文件路径。\n"
" -o target_file_name\t指定生成的目标文件路径。若未指定,默认生成 a.obj 文件。\n"
" -v\t\t\t打印版本信息。\n"
);
printf("\n");
version_msg();
exit(1);
}
void argument_error_msg()
{
printf("命令行参数错误。\n\n");
help_msg();
}
// 处理器用户输入的命令行参数
void process_argument(int argc, char* argv[])
{
int i;
// argv[0] 是 "easm.exe",所以可以忽略。
for (i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-v") == 0)
{
version_msg();
exit(1);
}
else if (strcmp(argv[i], "-h") == 0)
{
help_msg();
}
else if (strcmp(argv[i], "-o") == 0)
{
if (i + 1 < argc)
{
i++;
target_file_name = argv[i];
}
else
{
argument_error_msg();
}
}
else if (strcmp(argv[i], "-l") == 0)
{
if (i + 1 < argc)
{
i++;
list_file_name = argv[i];
}
else
{
argument_error_msg();
}
}
else if (strcmp(argv[i], "-g") == 0)
{
if (i + 1 < argc)
{
i++;
dbg_file_name = argv[i];
}
else
{
argument_error_msg();
}
}
else if (NULL == assembly_file_name && argv[i][0] != '-')
{
// 输入的汇编源代码文件路径。
assembly_file_name = argv[i];
}
else
{
argument_error_msg();
}
}
//
// 如果命令行参数中没有指定输入的汇编文件,就打印错误信息后退出
//
if (NULL == assembly_file_name)
{
printf("命令行参数错误。没有指定汇编源代码文件的路径。\n");
help_msg();
}
}
// 将一个字符串写入二进制文件中。先将字符串长度写入文件,然后将字符串中的
// 每个字符依次写入文件,不包括字符串末尾的 0.
void write_string_to_binary_file(const char* str, FILE* fp)
{
int str_length;
if (str != NULL)
{
str_length = strlen(str);
fwrite(&str_length, 1, sizeof(str_length), fp);
fwrite(str, 1, str_length, fp);
}
else
{
str_length = 0;
fwrite(&str_length, 1, sizeof(str_length), fp);
}
}
int main(int argc, char* argv[])
{
FILE* fp;
char* token;
char line[MAX_LINE_LENGTH];
int i, j;
int line_num = 1; // 行号从第一行开始计数
int keyword_index;
//
// 处理命令行参数
//
process_argument(argc, argv);
//
// 打开汇编源代码文件
//
fp = fopen(assembly_file_name, "r");
if (NULL == fp)
{
printf("无法打开源代码文件 %s\n", assembly_file_name);
return 1;
}
//////////////////////////////////////////////////////////////////////////
// 第一遍扫描
version_msg();
printf("\n正在汇编 %s...\n", assembly_file_name);
//
// 一次读取一行文本,同时记录所有的代码行信息
//
while (fgets(line, sizeof(line), fp) != NULL)
{
//
// 将一行代码的信息记录到代码行数据库中
//
strcpy(line_database[line_count].line_string, line);
line_database[line_count].line_num = line_num;
line_database[line_count].address = machine_code_address;
//
// 将代码行中的注释剥离
//
line[strcspn(line, ";")] = 0;
//
// 开始解析代码行
//
token = strtok(line, delimit_char);
if (NULL == token)
{
// 如果是空行,不做任何处理
}
else if ((keyword_index = match_keyword(token)) != 0
&& keyword_function_table[keyword_index].parse_function != NULL)
{
// 根据关键字进行相应的处理
keyword_function_table[keyword_index].parse_function(line_num);
}
else if (is_int_vector(token, line_num))
{
// 必须首先判断是否是中断向量,然后再判断是否是标号。因为判断标号的时候会删除最后一个标志字符“:”,而中断向量名称后是没有冒号的
// 中断向量
parse_int_vector(token, line_num);
// 判断符号
if (is_symbol(token, line_num))
{
// 处理符号
parse_symbol(token, line_num);
}
}
else
{
error_msg("无法识别的代码行。", line_num);
}
//
// 补充代码行数据库信息
//
line_database[line_count].machine_code_count = machine_code_address - machine_code_old_address;
machine_code_old_address = machine_code_address;
//
// 检查机器码地址是否超过了最大地址,若超过则报错(一个地址单元存储一个字节机器码)
//
//
if (MAX_MACHINE_CODE_BYTE_COUNT == machine_code_address)
{
sprintf(formated_msg, "汇编代码的机器码过多,最多只能有 %d 个字节机器码。", MAX_MACHINE_CODE_BYTE_COUNT);
error_msg(formated_msg, -1);
}
//
// 记录产生了机器码的代码行数量
//
if (line_database[line_count].machine_code_count != 0)
{
machine_code_line_count++;
}
//
// 增加行号
//
line_count++;
line_num++;
if (line_count == MAX_LINE_COUNT)
{
sprintf(formated_msg, "汇编文件中的代码行过多,最多只能有 %d 行代码。", MAX_LINE_COUNT);
error_msg(formated_msg, -1);
}
}
fclose(fp);
//////////////////////////////////////////////////////////////////////////
// 第二遍扫描
//
// 根据符号表更新重定位表
//
for (i = 0; i < reallocate_count; i++)
{
for (j = 0; j < symbol_count; j++)
{
if (stricmp(symbol_table[j].name, reallocate_table[i].symbol_name) == 0)
{
machine_code[reallocate_table[i].address] = (BYTE)symbol_table[j].address;
symbol_table[j].ref_count++;
break;
}
}
if (j == symbol_count)
{
// 重定位表中使用的符号在符号表中未定义,报错
sprintf(formated_msg, "使用了未定义的符号 %s。", reallocate_table[i].symbol_name);
error_msg(formated_msg, reallocate_table[i].line_num);
}
}
//
// 如果存在未引用的符号,输出警告信息。
//
for (i = 0; i < symbol_count; i++)
{
if (0 == symbol_table[i].ref_count)
{
warning_msg_unref_symbol(symbol_table[i].name, symbol_table[i].line_num);
}
}
//////////////////////////////////////////////////////////////////////////
// 产生各种输出文件
//
// 将机器码写入二进制文件
//
if (NULL == target_file_name)
{
target_file_name = "a.obj";
}
fp = fopen(target_file_name, "wb");
if (NULL == fp)
{
printf("无法打开输出文件 %s\n", target_file_name);
return 1;
}
fwrite(machine_code, 1, machine_code_address, fp);
fclose(fp);
printf("\n生成目标文件 %s\n", target_file_name);
//
// 将代码行数据库中的信息写入列表文件
//
if (list_file_name != NULL)
{
fp = fopen(list_file_name, "w");
if (NULL == fp)
{
printf("无法打开列表文件 %s\n", list_file_name);
return 1;
}
for (i = 0; i < line_count; i++)
{
// 行号
fprintf(fp, "%04d ", line_database[i].line_num);
// 地址和机器码
if (line_database[i].machine_code_count > 0)
{
fprintf(fp, "%02X ", line_database[i].address);
for (j = 0; j < line_database[i].machine_code_count; j++)
{
// 确保每行最多写三个字节的机器码
if (j != 0 && j % 3 == 0)
{
if (3 == j)
{
fprintf(fp, " ");
}
else
{
fprintf(fp, "\n ");
}
}
fprintf(fp, "%02X ", machine_code[line_database[i].address + j]);
if (2 == j)
{
fprintf(fp, " ");
fprintf(fp, line_database[i].line_string);
}
}
if (1 == j)
{
// 单字节指令
fprintf(fp, " ");
fprintf(fp, line_database[i].line_string);
}
else if (2 == j)
{
fprintf(fp, " ");
fprintf(fp, line_database[i].line_string);
}
else if (j > 3)
{
fprintf(fp, "\n");
}
}
else
{
fprintf(fp, " ");
// 源代码
fprintf(fp, line_database[i].line_string);
}
}
fclose(fp);
printf("生成列表文件 %s\n", list_file_name);
}
//
// 将代码行数据库中的信息写入二进制的调试信息文件。
//
// 调试信息的基本格式为:
// 魔数(4字节),固定不可改变
// 版本号(4字节),固定不可改变
// 源代码文件绝对路径字符串长度(4字节)
// 源代码文件绝对路径字符串(不包括字符串结尾的0)
// 列表文件绝对路径字符串长度(4字节)
// 列表文件绝对路径字符串(不包括字符串结尾的0)
//
// 代码行数据库中元素的数量(4字节)
// 代码行数据库中的所有元素
//
// 符号表元素的数量(4字节)
// 符号表中的所有元素
//
if (dbg_file_name != NULL)
{
fp = fopen(dbg_file_name, "wb");
if (NULL == fp)
{
printf("无法打开调试信息文件 %s\n", dbg_file_name);
return 1;
}
// 魔数
fwrite(&dbg_file_magic, 1, sizeof(dbg_file_magic), fp);
// 版本号
fwrite(&dbg_file_version, 1, sizeof(dbg_file_version), fp);
// 源代码文件路径
write_string_to_binary_file(assembly_file_name, fp);
// 列表文件路径
write_string_to_binary_file(list_file_name, fp);
// 代码行数据库中的所有元素
fwrite(&machine_code_line_count, 1, sizeof(machine_code_line_count), fp);
for (i = 0; i < line_count; i++)
{
// 跳过没有产生机器码的代码行
if (0 == line_database[i].machine_code_count)
{
continue;
}
fwrite(&line_database[i].line_num, 1, sizeof(unsigned long), fp);
fwrite(&line_database[i].address, 1, sizeof(unsigned long), fp);
fwrite(&line_database[i].machine_code_count, 1, sizeof(unsigned long), fp);
fwrite(&line_database[i].flag, 1, sizeof(unsigned long), fp);
}
// 符号表中的所有元素
fwrite(&symbol_count, 1, sizeof(symbol_count), fp);
for (i = 0; i < symbol_count; i++)
{
write_string_to_binary_file(symbol_table[i].name, fp);
fwrite(&symbol_table[i].address, 1, sizeof(unsigned long), fp);
fwrite(&symbol_table[i].machine_code_count, 1, sizeof(int), fp);
fwrite(&symbol_table[i].line_num, 1, sizeof(int), fp);
}
fclose(fp);
printf("生成调试信息文件 %s\n", dbg_file_name);
}
return 0;
}
添加文件
;test
.text
BEGIN:
mov al, 0x1a
UP:
out 2, al
inc al
cmp al, 0x84
jz UP
dec al
DOWN:
out 2, al
dec al
cmp al, 0x19
jnz DOWN
jmp BEGIN
@echo off
dmasm.exe ram.asm -o ram.rxm -l ram.lst -g ram.dbg
pause
添加文件
添加文件
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="1494" version="1.1" width="1731" xmlns="http://www.w3.org/2000/svg">
<polyline fill="none" points="658 1122, 458 1122" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="358" x2="458" y1="1122" y2="1122"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="299" y="1142">1</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="258" y="1092"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="302" y="1083">1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="189" y="1144">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="259" y="1195">Key = 1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="358" x2="458" y1="1372" y2="1372"/>
<rect fill="#ffffb0" height="100" stroke="#800000" stroke-width="5" width="100" x="258" y="1322"/>
<polyline fill="none" points="268 1272, 348 1272" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="308 1272, 308 1322" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="278 1402, 308 1402, 308 1342, 338 1342" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="298" y="1259">C1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="168" y="1382">SCLK</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="258" y="1472">Key = A</text>
<polyline fill="none" points="458 1372, 608 1372, 608 1142, 658 1142" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="458" x2="458" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="453" y="612">0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="438" x2="438" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="433" y="612">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="418" x2="418" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="413" y="612">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="398" x2="398" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="393" y="612">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="378" x2="378" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="373" y="612">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="358" x2="358" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="353" y="612">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="338" x2="338" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="333" y="612">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="318" x2="318" y1="572" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="313" y="612">7</text>
<rect fill="#000000" fill-opacity="0.5" height="50" stroke="#a0a0a4" stroke-width="5" width="200" x="288" y="522"/>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="378" y="562">05</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="507" y="569">2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="268" y="502">DIGITAL_SOURCE</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="208" x2="208" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="203" y="912">0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="188" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="183" y="912">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="168" x2="168" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="163" y="912">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="148" x2="148" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="143" y="912">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="128" x2="128" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="123" y="912">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="108" x2="108" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="103" y="912">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="88" x2="88" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="83" y="912">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="68" x2="68" y1="872" y2="922"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="63" y="912">7</text>
<rect fill="#000000" fill-opacity="0.5" height="50" stroke="#a0a0a4" stroke-width="5" width="200" x="38" y="822"/>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="128" y="862">FF</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="257" y="869">3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="18" y="802">DIGITAL_SOURCE</text>
<polyline fill="none" points="658 722, 458 722, 458 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 742, 438 742, 438 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 762, 418 762, 418 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 782, 398 782, 398 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 802, 378 802, 378 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 822, 358 822, 358 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 842, 338 842, 338 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 862, 318 862, 318 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 922, 208 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 942, 188 942, 188 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 962, 168 962, 168 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 982, 148 982, 148 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 1002, 128 1002, 128 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 1022, 108 1022, 108 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 1042, 88 1042, 88 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="658 1062, 68 1062, 68 922" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1258" x2="1258" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1252" y="587">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1308" x2="1308" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1302" y="587">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1358" x2="1358" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1352" y="587">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1408" x2="1408" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1402" y="587">1</text>
<rect fill="#000000" fill-opacity="0.5" height="260" stroke="#c0c0c0" stroke-width="5" width="240" x="1218" y="262"/>
<polygon fill="#ff0000" points="1385 305, 1395 295, 1285 295, 1295 305, 1385 305" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1395 375, 1405 385, 1405 305, 1395 315, 1395 375" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1395 465, 1405 475, 1405 395, 1395 405, 1395 465" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1295 475, 1285 485, 1395 485, 1385 475, 1295 475" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1285 405, 1275 395, 1275 475, 1285 465, 1285 405" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1285 315, 1275 305, 1275 385, 1285 375, 1285 315" stroke="#ff0000" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1318" y="212">U1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1228" y="251">CDC_HEX_DIG</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1508" x2="1508" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1502" y="587">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1558" x2="1558" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1552" y="587">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1608" x2="1608" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1602" y="587">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1658" x2="1658" y1="522" y2="622"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1652" y="587">1</text>
<rect fill="#000000" fill-opacity="0.5" height="260" stroke="#c0c0c0" stroke-width="5" width="240" x="1468" y="262"/>
<polygon fill="#ff0000" points="1635 305, 1645 295, 1535 295, 1545 305, 1635 305" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1645 375, 1655 385, 1655 305, 1645 315, 1645 375" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1645 465, 1655 475, 1655 395, 1645 405, 1645 465" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1545 475, 1535 485, 1645 485, 1635 475, 1545 475" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1535 405, 1525 395, 1525 475, 1535 465, 1535 405" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1535 315, 1525 305, 1525 385, 1535 375, 1535 315" stroke="#ff0000" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1568" y="212">U2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1478" y="251">CDC_HEX_DIG</text>
<polyline fill="none" points="908 722, 1658 722, 1658 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 742, 1608 742, 1608 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 762, 1558 762, 1558 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 782, 1508 782, 1508 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 802, 1408 802, 1408 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 822, 1358 822, 1358 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 842, 1308 842, 1308 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="908 862, 1258 862, 1258 622" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="105" font-weight="700" text-anchor="start" x="378" y="142">存储器读写测试电路</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="722" y2="722"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="722">A0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="742" y2="742"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="742">A1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="762" y2="762"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="762">A2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="782" y2="782"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="782">A3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="802" y2="802"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="802">A4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="822" y2="822"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="822">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="842" y2="842"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="842">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="862" y2="862"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="862">A7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="922" y2="922"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="922">D0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="942" y2="942"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="942">D1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="962" y2="962"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="962">D2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="982" y2="982"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="982">D3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="1002" y2="1002"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="1002">D4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="1022" y2="1022"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="1022">D5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="1042" y2="1042"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="1042">D6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="1062" y2="1062"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="741" y="1062">D7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="722" y2="722"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="722">Q0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="742" y2="742"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="742">Q1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="762" y2="762"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="762">Q2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="782" y2="782"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="782">Q3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="802" y2="802"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="802">Q4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="822" y2="822"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="822">Q5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="842" y2="842"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="842">Q6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="858" x2="908" y1="862" y2="862"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="825" y="862">Q7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="698" x2="658" y1="1122" y2="1122"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="774" y="1122">^W\R</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="708" x2="658" y1="1142" y2="1142"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="761" y="1142">CLK</text>
<rect fill="#ff8057" fill-opacity="0.5" height="490" stroke="#000000" stroke-width="5" width="150" x="708" y="692"/>
<polyline fill="none" points="708 1132, 718 1142, 708 1152" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<circle cx="703" cy="1122" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="748" y="682">RAM1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="728" y="1222">256RAM1</text>
</svg>
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 54 13 jz 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
添加文件
# 说明
8086微机系统实验环境的使用
# 原理图
![实验环境的使用](https://www.codecode.net/engintime/Dream-Logic/Project-Template/Microcomputer/Lab001/raw/master/top.dlsche.svg)
\ No newline at end of file
添加文件
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="4633" version="1.1" width="10389" xmlns="http://www.w3.org/2000/svg">
<text alignment-baseline="after-edge" fill="#800000" font-family="微软雅黑" font-size="200" font-weight="700" text-anchor="start" x="133" y="3856">DBUS[7..0]</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="微软雅黑" font-size="200" font-weight="700" text-anchor="start" x="163" y="1086">ABUS[7..0]</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="微软雅黑" font-size="65" font-weight="700" text-anchor="start" x="1883" y="2556">CLK</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1273" x2="1373" y1="2556" y2="2556"/>
<rect fill="#ffffb0" height="100" stroke="#800000" stroke-width="5" width="100" x="1173" y="2506"/>
<polyline fill="none" points="1183 2456, 1263 2456" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1223 2456, 1223 2506" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1193 2586, 1223 2586, 1223 2526, 1253 2526" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="180" font-weight="700" text-anchor="start" x="793" y="2443">CLOCK</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1083" y="2566">SCLK</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="微软雅黑" font-size="65" font-weight="700" text-anchor="start" x="1083" y="2676">Key = C</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="微软雅黑" font-size="90" font-weight="700" text-anchor="start" x="1553" y="1776">RESET</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1453" x2="1553" y1="1776" y2="1776"/>
<rect fill="#ffffb0" height="100" stroke="#800000" stroke-width="5" width="100" x="1353" y="1726"/>
<polyline fill="none" points="1363 1676, 1443 1676" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1403 1676, 1403 1726" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1373 1806, 1403 1806, 1403 1746, 1433 1746" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="180" font-weight="700" text-anchor="start" x="1133" y="1653">RESET</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1263" y="1786">SCLK</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="微软雅黑" font-size="180" font-weight="700" text-anchor="start" x="1103" y="2076">Key = R</text>
<polyline fill="none" points="4923 156, 4923 4586" stroke="#000000" stroke-dasharray="200,100" stroke-linecap="round" stroke-linejoin="round" stroke-width="50"/>
<polyline fill="none" points="3323 2356, 2973 2356" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="3323 3056, 2973 3056" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="3106" y2="3056"/>
<polyline fill="none" points="2973 2456, 3323 2456" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="2973 2556, 3323 2556" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="2973 2656, 3323 2656" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="2973 2756, 3323 2756" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="2973 2856, 3323 2856" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="2973 2956, 3323 2956" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="3006" y2="2956"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="2906" y2="2856"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="2806" y2="2756"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="2706" y2="2656"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="2606" y2="2556"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="2506" y2="2456"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="2923" x2="2973" y1="2406" y2="2356"/>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2356">DBUS0</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2456">DBUS1</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2556">DBUS2</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2656">DBUS3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2756">DBUS4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2856">DBUS5</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="2956">DBUS6</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="2973" y="3056">DBUS7</text>
<polyline fill="none" points="4013 1656, 4263 1656" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 1756, 4273 1756" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 1856, 4273 1856" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 1956, 4273 1956" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 2056, 4273 2056" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 2156, 4273 2156" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 2256, 4273 2256" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="4023 2356, 4273 2356" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4263" x2="4313" y1="1656" y2="1606"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="1756" y2="1706"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="1856" y2="1806"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="1956" y2="1906"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="2056" y2="2006"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="2156" y2="2106"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="2256" y2="2206"/>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4273" x2="4323" y1="2356" y2="2306"/>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4113" y="1656">ABUS0</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="1756">ABUS1</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="1856">ABUS2</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="1956">ABUS3</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="2056">ABUS4</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="2156">ABUS5</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="2256">ABUS6</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="4123" y="2356">ABUS7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1273" x2="1373" y1="2756" y2="2756"/>
<rect fill="#ffffb0" height="100" stroke="#800000" stroke-width="5" width="100" x="1173" y="2706"/>
<polyline fill="none" points="1183 2766, 1193 2766, 1193 2736, 1213 2736, 1213 2766, 1233 2766, 1233 2736, 1253 2736, 1253 2766" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1213" y="2696">C1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1169" y="2852">CLOCK11</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="1313" y="2736">100Hz</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1273" x2="1373" y1="2956" y2="2956"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="1214" y="2976">1</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="1173" y="2926"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1217" y="2917">2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1104" y="2978">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="1174" y="3029">Key = S</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1733" x2="1673" y1="2556" y2="2556"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1813" x2="1873" y1="2556" y2="2556"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1773" x2="1773" y1="2596" y2="2656"/>
<circle cx="1773" cy="2588" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="1733 2506, 1733 2606, 1813 2556, 1733 2506" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1783" y="2476">U3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1733" y="2506">NBUFFER</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1733" x2="1673" y1="2756" y2="2756"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1813" x2="1873" y1="2756" y2="2756"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1773" x2="1773" y1="2796" y2="2856"/>
<circle cx="1773" cy="2788" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="1733 2706, 1733 2806, 1813 2756, 1733 2706" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1783" y="2676">U4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1733" y="2706">NBUFFER</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1633" x2="1573" y1="2656" y2="2656"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1713" x2="1773" y1="2656" y2="2656"/>
<circle cx="1709" cy="2656" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="1633 2606, 1633 2706, 1703 2656, 1633 2606" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1653" y="2620">U5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1633" y="2752">NOT</text>
<text alignment-baseline="after-edge" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="10333" y="656">in0</text>
<rect fill="#80ff80" height="600" stroke="#800000" stroke-width="1" width="700" x="5623" y="2656"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="250" font-weight="700" text-anchor="start" x="5623" y="2556">MEM</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="5623" y="2606">MEM\MEM.dlsche</text>
<polygon fill="#ffff80" points="5623 2756, 5648 2731, 5698 2731, 5723 2756, 5698 2781, 5648 2781, 5623 2756" 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="5733" y="2756">WR_OUT</text>
<polygon fill="#ffff80" points="5623 2856, 5648 2831, 5698 2831, 5723 2856, 5698 2881, 5648 2881, 5623 2856" 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="5733" y="2856">CLK</text>
<polygon fill="#ffff80" points="5623 2956, 5648 2931, 5698 2931, 5723 2956, 5698 2981, 5648 2981, 5623 2956" 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="5733" y="2956">MIO</text>
<polygon fill="#ffff80" points="5623 3056, 5648 3031, 5698 3031, 5723 3056, 5698 3081, 5648 3081, 5623 3056" 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="5733" y="3056">READ_OUT</text>
<polygon fill="#ffff80" points="5623 3156, 5648 3131, 5698 3131, 5723 3156, 5698 3181, 5648 3181, 5623 3156" 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="5733" y="3156">ABUS[7..0]</text>
<polygon fill="#ffff80" points="6323 2756, 6298 2731, 6248 2731, 6223 2756, 6248 2781, 6298 2781, 6323 2756" 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="6113" y="2756">DBUS[7..0]</text>
<polyline fill="none" points="4323 2306, 4323 1086" stroke="#ff8057" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="5623 3156, 5423 3156, 5423 1086" stroke="#ff8057" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="7523 2656, 7323 2656, 7323 1086" stroke="#ff8057" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="2923 2406, 2923 3856" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="6323 2756, 6523 2756, 6523 3856" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<rect fill="#80ff80" height="1100" stroke="#800000" stroke-width="1" width="700" x="7523" y="2156"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="250" font-weight="700" text-anchor="start" x="7523" y="2056">IO</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="7523" y="2106">IO\IO.dlsche</text>
<polygon fill="#ffff80" points="7523 2256, 7548 2231, 7598 2231, 7623 2256, 7598 2281, 7548 2281, 7523 2256" 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="7633" y="2256">MIO</text>
<polygon fill="#ffff80" points="7523 2356, 7548 2331, 7598 2331, 7623 2356, 7598 2381, 7548 2381, 7523 2356" 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="7633" y="2356">WR_OUT</text>
<polygon fill="#ffff80" points="7523 2456, 7548 2431, 7598 2431, 7623 2456, 7598 2481, 7548 2481, 7523 2456" 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="7633" y="2456">READ_OUT</text>
<polygon fill="#ffff80" points="7523 2556, 7548 2531, 7598 2531, 7623 2556, 7598 2581, 7548 2581, 7523 2556" 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="7633" y="2556">MIO</text>
<polygon fill="#ffff80" points="7523 2656, 7548 2631, 7598 2631, 7623 2656, 7598 2681, 7548 2681, 7523 2656" 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="7633" y="2656">A[7..0]</text>
<polygon fill="#ffff80" points="8223 2256, 8198 2231, 8148 2231, 8123 2256, 8148 2281, 8198 2281, 8223 2256" 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="8013" y="2256">IOW</text>
<polygon fill="#ffff80" points="8223 2356, 8198 2331, 8148 2331, 8123 2356, 8148 2381, 8198 2381, 8223 2356" 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="8013" y="2356">IOR</text>
<polygon fill="#ffff80" points="8223 2456, 8198 2431, 8148 2431, 8123 2456, 8148 2481, 8198 2481, 8223 2456" 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="8013" y="2456">CS0</text>
<polygon fill="#ffff80" points="8223 2556, 8198 2531, 8148 2531, 8123 2556, 8148 2581, 8198 2581, 8223 2556" 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="8013" y="2556">CS1</text>
<polygon fill="#ffff80" points="8223 2656, 8198 2631, 8148 2631, 8123 2656, 8148 2681, 8198 2681, 8223 2656" 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="8013" y="2656">CS2</text>
<polygon fill="#ffff80" points="8223 2756, 8198 2731, 8148 2731, 8123 2756, 8148 2781, 8198 2781, 8223 2756" 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="8013" y="2756">CS3</text>
<polygon fill="#ffff80" points="8223 2856, 8198 2831, 8148 2831, 8123 2856, 8148 2881, 8198 2881, 8223 2856" 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="8013" y="2856">CS4</text>
<polygon fill="#ffff80" points="8223 2956, 8198 2931, 8148 2931, 8123 2956, 8148 2981, 8198 2981, 8223 2956" 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="8013" y="2956">CS5</text>
<polygon fill="#ffff80" points="8223 3056, 8198 3031, 8148 3031, 8123 3056, 8148 3081, 8198 3081, 8223 3056" 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="8013" y="3056">CS6</text>
<polygon fill="#ffff80" points="8223 3156, 8198 3131, 8148 3131, 8123 3156, 8148 3181, 8198 3181, 8223 3156" 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="8013" y="3156">CS7</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="250" font-weight="700" text-anchor="start" x="13" y="316">实验一:8086微机系统实验环境的使用</text>
<polyline fill="none" points="163 1086, 8223 1086" stroke="#ff8057" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="133 3856, 8223 3856" stroke="#000080" stroke-linecap="round" stroke-linejoin="round" stroke-width="20"/>
<polyline fill="none" points="1873 2556, 1973 2556, 1973 2756, 1873 2756" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1673 2756, 1373 2756" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1373 2956, 1773 2956, 1773 2856" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1573 2656, 1573 2956" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1673 2556, 1373 2556" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<rect fill="#80ff80" height="1700" stroke="#800000" stroke-width="1" width="700" x="3323" y="1556"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="250" font-weight="700" text-anchor="start" x="3323" y="1456">8086</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="3323" y="1506">8086\8086.dlsche</text>
<polygon fill="#ffff80" points="3323 1656, 3348 1631, 3398 1631, 3423 1656, 3398 1681, 3348 1681, 3323 1656" 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="3433" y="1656">CLK</text>
<polygon fill="#ffff80" points="3323 1756, 3348 1731, 3398 1731, 3423 1756, 3398 1781, 3348 1781, 3323 1756" 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="3433" y="1756">RESET</text>
<polygon fill="#ffff80" points="3323 1856, 3348 1831, 3398 1831, 3423 1856, 3398 1881, 3348 1881, 3323 1856" 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="3433" y="1856">INTR</text>
<polygon fill="#ffff80" points="3323 1956, 3348 1931, 3398 1931, 3423 1956, 3398 1981, 3348 1981, 3323 1956" 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="3433" y="1956">READY</text>
<polygon fill="#ffff80" points="3323 2056, 3348 2031, 3398 2031, 3423 2056, 3398 2081, 3348 2081, 3323 2056" 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="3433" y="2056">HOLD</text>
<polygon fill="#ffff80" points="3323 2156, 3348 2131, 3398 2131, 3423 2156, 3398 2181, 3348 2181, 3323 2156" 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="3433" y="2156">NMI</text>
<polygon fill="#ffff80" points="3323 2256, 3348 2231, 3398 2231, 3423 2256, 3398 2281, 3348 2281, 3323 2256" 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="3433" y="2256">TESET</text>
<polygon fill="#ffff80" points="3323 2356, 3348 2331, 3398 2331, 3423 2356, 3398 2381, 3348 2381, 3323 2356" 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="3433" y="2356">D0</text>
<polygon fill="#ffff80" points="3323 2456, 3348 2431, 3398 2431, 3423 2456, 3398 2481, 3348 2481, 3323 2456" 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="3433" y="2456">D1</text>
<polygon fill="#ffff80" points="3323 2556, 3348 2531, 3398 2531, 3423 2556, 3398 2581, 3348 2581, 3323 2556" 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="3433" y="2556">D2</text>
<polygon fill="#ffff80" points="3323 2656, 3348 2631, 3398 2631, 3423 2656, 3398 2681, 3348 2681, 3323 2656" 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="3433" y="2656">D3</text>
<polygon fill="#ffff80" points="3323 2756, 3348 2731, 3398 2731, 3423 2756, 3398 2781, 3348 2781, 3323 2756" 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="3433" y="2756">D4</text>
<polygon fill="#ffff80" points="3323 2856, 3348 2831, 3398 2831, 3423 2856, 3398 2881, 3348 2881, 3323 2856" 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="3433" y="2856">D5</text>
<polygon fill="#ffff80" points="3323 2956, 3348 2931, 3398 2931, 3423 2956, 3398 2981, 3348 2981, 3323 2956" 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="3433" y="2956">D6</text>
<polygon fill="#ffff80" points="3323 3056, 3348 3031, 3398 3031, 3423 3056, 3398 3081, 3348 3081, 3323 3056" 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="3433" y="3056">D7</text>
<polygon fill="#ffff80" points="4023 1656, 3998 1631, 3948 1631, 3923 1656, 3948 1681, 3998 1681, 4023 1656" 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="3813" y="1656">A0</text>
<polygon fill="#ffff80" points="4023 1756, 3998 1731, 3948 1731, 3923 1756, 3948 1781, 3998 1781, 4023 1756" 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="3813" y="1756">A1</text>
<polygon fill="#ffff80" points="4023 1856, 3998 1831, 3948 1831, 3923 1856, 3948 1881, 3998 1881, 4023 1856" 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="3813" y="1856">A2</text>
<polygon fill="#ffff80" points="4023 1956, 3998 1931, 3948 1931, 3923 1956, 3948 1981, 3998 1981, 4023 1956" 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="3813" y="1956">A3</text>
<polygon fill="#ffff80" points="4023 2056, 3998 2031, 3948 2031, 3923 2056, 3948 2081, 3998 2081, 4023 2056" 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="3813" y="2056">A4</text>
<polygon fill="#ffff80" points="4023 2156, 3998 2131, 3948 2131, 3923 2156, 3948 2181, 3998 2181, 4023 2156" 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="3813" y="2156">A5</text>
<polygon fill="#ffff80" points="4023 2256, 3998 2231, 3948 2231, 3923 2256, 3948 2281, 3998 2281, 4023 2256" 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="3813" y="2256">A6</text>
<polygon fill="#ffff80" points="4023 2356, 3998 2331, 3948 2331, 3923 2356, 3948 2381, 3998 2381, 4023 2356" 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="3813" y="2356">A7</text>
<polygon fill="#ffff80" points="4023 2456, 3998 2431, 3948 2431, 3923 2456, 3948 2481, 3998 2481, 4023 2456" 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="3813" y="2456">WR_OUT</text>
<polygon fill="#ffff80" points="4023 2556, 3998 2531, 3948 2531, 3923 2556, 3948 2581, 3998 2581, 4023 2556" 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="3813" y="2556">READ_OUT</text>
<polygon fill="#ffff80" points="4023 2656, 3998 2631, 3948 2631, 3923 2656, 3948 2681, 3998 2681, 4023 2656" 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="3813" y="2656">MIO</text>
<polygon fill="#ffff80" points="4023 2756, 3998 2731, 3948 2731, 3923 2756, 3948 2781, 3998 2781, 4023 2756" 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="3813" y="2756">INTA</text>
<polygon fill="#ffff80" points="4023 2856, 3998 2831, 3948 2831, 3923 2856, 3948 2881, 3998 2881, 4023 2856" 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="3813" y="2856">HLDA</text>
<polygon fill="#ffff80" points="4023 2956, 3998 2931, 3948 2931, 3923 2956, 3948 2981, 3998 2981, 4023 2956" 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="3813" y="2956">ALE</text>
<polygon fill="#ffff80" points="4023 3056, 3998 3031, 3948 3031, 3923 3056, 3948 3081, 3998 3081, 4023 3056" 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="3813" y="3056">DEN</text>
<polygon fill="#ffff80" points="4023 3156, 3998 3131, 3948 3131, 3923 3156, 3948 3181, 3998 3181, 4023 3156" 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="3813" y="3156">DTR</text>
<circle cx="7323" cy="1086" fill="#000080" r="25" stroke="#000080" stroke-width="5"/>
<circle cx="5423" cy="1086" fill="#000080" r="25" stroke="#000080" stroke-width="5"/>
<circle cx="4323" cy="1086" fill="#000080" r="25" stroke="#000080" stroke-width="5"/>
<circle cx="6523" cy="3856" fill="#000080" r="25" stroke="#000080" stroke-width="5"/>
<circle cx="2923" cy="3856" fill="#000080" r="25" stroke="#000080" stroke-width="5"/>
<circle cx="1573" cy="2956" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="1836" version="1.1" width="2063" xmlns="http://www.w3.org/2000/svg">
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="802" y2="802"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="802">D0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="832" y2="832"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="832">D1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="862" y2="862"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="862">D2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="892" y2="892"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="892">D3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="922" y2="922"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="922">D4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="952" y2="952"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="952">D5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="982" y2="982"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="982">D6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1012" y2="1012"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1012">D7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="802" y2="802"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="802">A0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="832" y2="832"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="832">A1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="862" y2="862"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="862">A2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="892" y2="892"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="892">A3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="922" y2="922"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="922">A4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="952" y2="952"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="952">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="982" y2="982"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="982">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1012" y2="1012"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1012">A7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="730" x2="690" y1="1072" y2="1072"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="784" y="1071">^EN</text>
<rect fill="#a0c0ff" fill-opacity="0.5" height="350" stroke="#000000" stroke-width="5" width="150" x="740" y="762"/>
<circle cx="735" cy="1072" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="800" y="762">1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="740" y="1162">BUS_TRANS8</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1452" y2="1452"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1452">D0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1482" y2="1482"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1482">D1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1512" y2="1512"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1512">D2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1542" y2="1542"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1542">D3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1572" y2="1572"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1572">D4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1602" y2="1602"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1602">D5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1632" y2="1632"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1632">D6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="890" x2="940" y1="1662" y2="1662"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="start" x="857" y="1662">D7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1452" y2="1452"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1452">A0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1482" y2="1482"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1482">A1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1512" y2="1512"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1512">A2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1542" y2="1542"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1542">A3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1572" y2="1572"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1572">A4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1602" y2="1602"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1602">A5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1632" y2="1632"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1632">A6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="740" x2="690" y1="1662" y2="1662"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="773" y="1662">A7</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="730" x2="690" y1="1722" y2="1722"/>
<text alignment-baseline="central" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="784" y="1721">^EN</text>
<rect fill="#a0c0ff" fill-opacity="0.5" height="350" stroke="#000000" stroke-width="5" width="150" x="740" y="1412"/>
<circle cx="735" cy="1722" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="800" y="1412">2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="740" y="1812">BUS_TRANS8</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="430" x2="430" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="425" y="742">0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="410" x2="410" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="405" y="742">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="390" x2="390" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="385" y="742">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="370" x2="370" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="365" y="742">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="350" x2="350" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="345" y="742">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="330" x2="330" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="325" y="742">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="310" x2="310" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="305" y="742">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="290" x2="290" y1="702" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="285" y="742">7</text>
<rect fill="#000000" fill-opacity="0.5" height="50" stroke="#a0a0a4" stroke-width="5" width="200" x="260" y="652"/>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="350" y="692">15</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="479" y="699">3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="240" y="632">DIGITAL_SOURCE</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="430" x2="430" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="425" y="1442">0</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="410" x2="410" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="405" y="1442">1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="390" x2="390" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="385" y="1442">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="370" x2="370" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="365" y="1442">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="350" x2="350" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="345" y="1442">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="330" x2="330" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="325" y="1442">5</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="310" x2="310" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="305" y="1442">6</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="290" x2="290" y1="1402" y2="1452"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="285" y="1442">7</text>
<rect fill="#000000" fill-opacity="0.5" height="50" stroke="#a0a0a4" stroke-width="5" width="200" x="260" y="1352"/>
<text alignment-baseline="after-edge" fill="#ff0000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="350" y="1392">12</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="479" y="1399">4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="240" y="1332">DIGITAL_SOURCE</text>
<polyline fill="none" points="690 802, 430 802, 430 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 832, 410 832, 410 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 862, 390 862, 390 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 892, 370 892, 370 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 922, 350 922, 350 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 952, 330 952, 330 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 982, 310 982, 310 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1012, 290 1012, 290 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1452, 430 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1482, 410 1482, 410 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1512, 390 1512, 390 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1542, 370 1542, 370 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1572, 350 1572, 350 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1602, 330 1602, 330 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1632, 310 1632, 310 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="690 1662, 290 1662, 290 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="190" x2="290" y1="1072" y2="1072"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="130" y="1093">0</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="90" y="1042"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="134" y="1033">5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="21" y="1094">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="91" y="1145">Key = 1</text>
<polyline fill="none" points="690 1072, 290 1072" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="190" x2="290" y1="1722" y2="1722"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="131" y="1742">1</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="90" y="1692"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="134" y="1683">6</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="21" y="1744">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="91" y="1795">Key = 2</text>
<polyline fill="none" points="690 1722, 290 1722" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 802, 1090 802, 1090 1452, 940 1452" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 1482, 1110 1482, 1110 832, 940 832" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 862, 1130 862, 1130 1512, 940 1512" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 1542, 1150 1542, 1150 892, 940 892" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 922, 1170 922, 1170 1572, 940 1572" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 1602, 1190 1602, 1190 952, 940 952" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 982, 1210 982, 1210 1632, 940 1632" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="940 1662, 1230 1662, 1230 1012, 940 1012" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1590" x2="1590" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1584" y="717">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1640" x2="1640" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1634" y="717">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1690" x2="1690" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1684" y="717">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1740" x2="1740" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1734" y="717">1</text>
<rect fill="#000000" fill-opacity="0.5" height="260" stroke="#c0c0c0" stroke-width="5" width="240" x="1550" y="392"/>
<polygon fill="#ff0000" points="1727 505, 1737 515, 1737 435, 1727 445, 1727 505" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1727 595, 1737 605, 1737 525, 1727 535, 1727 595" stroke="#ff0000" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1650" y="342">U1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1560" y="381">CDC_HEX_DIG</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1840" x2="1840" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1834" y="717">4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1890" x2="1890" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1884" y="717">3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1940" x2="1940" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1934" y="717">2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="1990" x2="1990" y1="652" y2="752"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Courier New" font-size="17" font-weight="400" text-anchor="end" x="1984" y="717">1</text>
<rect fill="#000000" fill-opacity="0.5" height="260" stroke="#c0c0c0" stroke-width="5" width="240" x="1800" y="392"/>
<polygon fill="#ff0000" points="1967 435, 1977 425, 1867 425, 1877 435, 1967 435" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1977 595, 1987 605, 1987 525, 1977 535, 1977 595" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1877 605, 1867 615, 1977 615, 1967 605, 1877 605" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1867 445, 1857 435, 1857 515, 1867 505, 1867 445" stroke="#ff0000" stroke-width="1"/>
<polygon fill="#ff0000" points="1877 515, 1867 525, 1967 525, 1977 515, 1877 515" stroke="#ff0000" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1900" y="342">U2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1810" y="381">CDC_HEX_DIG</text>
<polyline fill="none" points="1090 802, 1990 802, 1990 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1110 832, 1940 832, 1940 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1130 862, 1890 862, 1890 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1150 892, 1840 892, 1840 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1170 922, 1740 922, 1740 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1190 952, 1690 952, 1690 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1210 982, 1640 982, 1640 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="1230 1012, 1590 1012, 1590 752" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="105" font-weight="700" text-anchor="start" x="490" y="142">8位三态门功能测试电路</text>
<circle cx="1090" cy="802" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1110" cy="832" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1130" cy="862" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1150" cy="892" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1170" cy="922" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1190" cy="952" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1210" cy="982" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
<circle cx="1230" cy="1012" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg height="969" version="1.1" width="1048" xmlns="http://www.w3.org/2000/svg">
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="548" x2="488" y1="424" y2="424"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="628" x2="688" y1="424" y2="424"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="588" x2="588" y1="464" y2="524"/>
<circle cx="588" cy="456" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="548 374, 548 474, 628 424, 548 374" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="598" y="344">U1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="548" y="374">NBUFFER</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="548" x2="488" y1="724" y2="724"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="628" x2="688" y1="724" y2="724"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="588" x2="588" y1="764" y2="824"/>
<circle cx="588" cy="756" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<polygon fill="#ffffff" fill-opacity="0.5" points="548 674, 548 774, 628 724, 548 674" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="598" y="644">U2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="548" y="674">NBUFFER</text>
<polyline fill="none" points="688 424, 788 424, 788 724, 688 724" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="488 424, 288 424" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="488 724, 288 724" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="288" y1="424" y2="424"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="128" y="445">0</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="88" y="394"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="132" y="385">1</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="19" y="446">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="89" y="497">Key = 1</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="288" y1="574" y2="574"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="128" y="595">0</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="88" y="544"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="132" y="535">2</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="19" y="596">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="89" y="647">Key = 2</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="288" y1="724" y2="724"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="129" y="744">1</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="88" y="694"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="132" y="685">3</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="19" y="746">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="89" y="797">Key = 3</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="188" x2="288" y1="874" y2="874"/>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="30" font-weight="400" text-anchor="start" x="129" y="894">1</text>
<rect fill="#ffffff" fill-opacity="0.5" height="60" stroke="#800000" stroke-width="5" width="100" x="88" y="844"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="132" y="835">4</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="19" y="896">DCT</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="89" y="947">Key = 4</text>
<line stroke="#000000" stroke-linecap="round" stroke-width="5" x1="788" x2="788" y1="324" y2="424"/>
<circle cx="788" cy="304" fill="#ffffff" fill-opacity="0.5" r="18" stroke="#000000" stroke-width="1"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="780" y="273">5</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="809" y="379">P</text>
<polyline fill="none" points="288 574, 588 574, 588 524" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<polyline fill="none" points="288 874, 588 874, 588 824" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="微软雅黑" font-size="65" font-weight="700" text-anchor="start" x="88" y="94">一位三态门功能测试电路</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="288" y="424">输入1</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="288" y="724">输入2</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="288" y="574">门控1</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="288" y="874">门控2</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="788" y="724">位宽为1的总线</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="78" y="144">两个三态门输出到同一条总线上</text>
<text alignment-baseline="after-edge" fill="#000080" font-family="宋体" font-size="25" font-weight="400" text-anchor="start" x="68" y="204">为了避免信号冲突,就需要始终保证最多一个门打开,其它门关闭</text>
<circle cx="788" cy="424" fill="#0000ff" r="8" stroke="#0000ff" stroke-width="5"/>
</svg>
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论