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

st to sp

上级 e16fce46
没有这种文件类型的预览
这个 源代码变更 因为 太大 而不能显示。 你可以 浏览blob
没有这种文件类型的预览
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<polygon fill="#ffff80" points="7001 744, 7026 719, 7076 719, 7101 744, 7076 769, 7026 769, 7001 744" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 744, 7026 719, 7076 719, 7101 744, 7076 769, 7026 769, 7001 744" 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="7113" y="744">ST_REG_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="7113" y="744">SP_REG_EN</text>
<polygon fill="#ffff80" points="7001 824, 7026 799, 7076 799, 7101 824, 7076 849, 7026 849, 7001 824" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 824, 7026 799, 7076 799, 7101 824, 7076 849, 7026 849, 7001 824" stroke="#800000" stroke-width="1"/>
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
<polygon fill="#ffff80" points="7001 964, 7026 939, 7076 939, 7101 964, 7076 989, 7026 989, 7001 964" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 964, 7026 939, 7076 939, 7101 964, 7076 989, 7026 989, 7001 964" 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="7113" y="964">ST_GATE_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="7113" y="964">SP_GATE_EN</text>
<polygon fill="#ffff80" points="7001 1034, 7026 1009, 7076 1009, 7101 1034, 7076 1059, 7026 1059, 7001 1034" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 1034, 7026 1009, 7076 1009, 7101 1034, 7076 1059, 7026 1059, 7001 1034" stroke="#800000" stroke-width="1"/>
...@@ -221,15 +221,15 @@ ...@@ -221,15 +221,15 @@
<polygon fill="#ffff80" points="7001 1264, 7026 1239, 7076 1239, 7101 1264, 7076 1289, 7026 1289, 7001 1264" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 1264, 7026 1239, 7076 1239, 7101 1264, 7076 1289, 7026 1289, 7001 1264" 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="7113" y="1264">CST_LOAD</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="7113" y="1264">CSP_LOAD</text>
<polygon fill="#ffff80" points="7001 1344, 7026 1319, 7076 1319, 7101 1344, 7076 1369, 7026 1369, 7001 1344" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 1344, 7026 1319, 7076 1319, 7101 1344, 7076 1369, 7026 1369, 7001 1344" 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="7113" y="1344">CST_U\D</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="7113" y="1344">CSP_U\D</text>
<polygon fill="#ffff80" points="7001 1174, 7026 1149, 7076 1149, 7101 1174, 7076 1199, 7026 1199, 7001 1174" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7001 1174, 7026 1149, 7076 1149, 7101 1174, 7076 1199, 7026 1199, 7001 1174" 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="7113" y="1174">CST_GATE_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="7113" y="1174">CSP_GATE_EN</text>
<line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4371" x2="4421" y1="2904" y2="2954"/> <line stroke="#000080" stroke-linecap="round" stroke-width="5" x1="4371" x2="4421" y1="2904" y2="2954"/>
...@@ -827,7 +827,7 @@ ...@@ -827,7 +827,7 @@
<polygon fill="#ffff80" points="6831 4254, 6806 4229, 6806 4179, 6831 4154, 6856 4179, 6856 4229, 6831 4254" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="6831 4254, 6806 4229, 6806 4179, 6831 4154, 6856 4179, 6856 4229, 6831 4254" 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" transform="rotate(-90 6831 4142)" x="6831" y="4142">ST_GATE_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" transform="rotate(-90 6831 4142)" x="6831" y="4142">SP_GATE_EN</text>
<polygon fill="#ffff80" points="6731 4254, 6706 4229, 6706 4179, 6731 4154, 6756 4179, 6756 4229, 6731 4254" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="6731 4254, 6706 4229, 6706 4179, 6731 4154, 6756 4179, 6756 4229, 6731 4254" stroke="#800000" stroke-width="1"/>
...@@ -839,7 +839,7 @@ ...@@ -839,7 +839,7 @@
<polygon fill="#ffff80" points="8431 3154, 8406 3129, 8356 3129, 8331 3154, 8356 3179, 8406 3179, 8431 3154" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="8431 3154, 8406 3129, 8356 3129, 8331 3154, 8356 3179, 8406 3179, 8431 3154" 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="8094" y="3154">ST_REG_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="8094" y="3154">SP_REG_EN</text>
<polygon fill="#ffff80" points="8431 3754, 8406 3729, 8356 3729, 8331 3754, 8356 3779, 8406 3779, 8431 3754" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="8431 3754, 8406 3729, 8356 3729, 8331 3754, 8356 3779, 8406 3779, 8431 3754" stroke="#800000" stroke-width="1"/>
...@@ -863,7 +863,7 @@ ...@@ -863,7 +863,7 @@
<polygon fill="#ffff80" points="7431 4254, 7406 4229, 7406 4179, 7431 4154, 7456 4179, 7456 4229, 7431 4254" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7431 4254, 7406 4229, 7406 4179, 7431 4154, 7456 4179, 7456 4229, 7431 4254" 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" transform="rotate(-90 7431 4132)" x="7431" y="4132">CST_GATE_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" transform="rotate(-90 7431 4132)" x="7431" y="4132">CSP_GATE_EN</text>
<polygon fill="#ffff80" points="7931 2854, 7906 2879, 7906 2929, 7931 2954, 7956 2929, 7956 2879, 7931 2854" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="7931 2854, 7906 2879, 7906 2929, 7931 2954, 7956 2929, 7956 2879, 7931 2854" stroke="#800000" stroke-width="1"/>
...@@ -903,7 +903,7 @@ ...@@ -903,7 +903,7 @@
<polygon fill="#ffff80" points="8431 3054, 8406 3029, 8356 3029, 8331 3054, 8356 3079, 8406 3079, 8431 3054" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="8431 3054, 8406 3029, 8356 3029, 8331 3054, 8356 3079, 8406 3079, 8431 3054" 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="8092" y="3054">CST_LOAD</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="8092" y="3054">CSP_LOAD</text>
<polygon fill="#ffff80" points="6031 3974, 6056 3949, 6106 3949, 6131 3974, 6106 3999, 6056 3999, 6031 3974" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="6031 3974, 6056 3949, 6106 3949, 6131 3974, 6106 3999, 6056 3999, 6031 3974" stroke="#800000" stroke-width="1"/>
...@@ -915,7 +915,7 @@ ...@@ -915,7 +915,7 @@
<polygon fill="#ffff80" points="8431 4054, 8406 4029, 8356 4029, 8331 4054, 8356 4079, 8406 4079, 8431 4054" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="8431 4054, 8406 4029, 8356 4029, 8331 4054, 8356 4079, 8406 4079, 8431 4054" 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="8102" y="4054">CST_U\D</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="8102" y="4054">CSP_U\D</text>
<polygon fill="#ffff80" points="6031 3874, 6056 3849, 6106 3849, 6131 3874, 6106 3899, 6056 3899, 6031 3874" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="6031 3874, 6056 3849, 6106 3849, 6131 3874, 6106 3899, 6056 3899, 6031 3874" stroke="#800000" stroke-width="1"/>
......
没有这种文件类型的预览
...@@ -1071,7 +1071,7 @@ ...@@ -1071,7 +1071,7 @@
<polygon fill="#ffff80" points="21 4445, 21 4420, 236 4420, 261 4445, 236 4470, 21 4470, 21 4445" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 4445, 21 4420, 236 4420, 261 4445, 236 4470, 21 4470, 21 4445" 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="4445">ST_GATE_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="21" y="4445">SP_GATE_EN</text>
<polygon fill="#ffff80" points="21 3845, 21 3820, 236 3820, 261 3845, 236 3870, 21 3870, 21 3845" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 3845, 21 3820, 236 3820, 261 3845, 236 3870, 21 3870, 21 3845" stroke="#800000" stroke-width="1"/>
...@@ -1095,7 +1095,7 @@ ...@@ -1095,7 +1095,7 @@
<polygon fill="#ffff80" points="21 4285, 21 4260, 236 4260, 261 4285, 236 4310, 21 4310, 21 4285" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 4285, 21 4260, 236 4260, 261 4285, 236 4310, 21 4310, 21 4285" 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="4285">ST_REG_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="21" y="4285">SP_REG_EN</text>
<polygon fill="#ffff80" points="21 3665, 21 3640, 236 3640, 261 3665, 236 3690, 21 3690, 21 3665" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 3665, 21 3640, 236 3640, 261 3665, 236 3690, 21 3690, 21 3665" stroke="#800000" stroke-width="1"/>
...@@ -1225,15 +1225,15 @@ ...@@ -1225,15 +1225,15 @@
<polygon fill="#ffff80" points="21 5015, 21 4990, 236 4990, 261 5015, 236 5040, 21 5040, 21 5015" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 5015, 21 4990, 236 4990, 261 5015, 236 5040, 21 5040, 21 5015" 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="5015">CST_U\D</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="21" y="5015">CSP_U\D</text>
<polygon fill="#ffff80" points="21 4945, 21 4920, 236 4920, 261 4945, 236 4970, 21 4970, 21 4945" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 4945, 21 4920, 236 4920, 261 4945, 236 4970, 21 4970, 21 4945" 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="4945">CST_LOAD</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="21" y="4945">CSP_LOAD</text>
<polygon fill="#ffff80" points="21 5165, 21 5140, 236 5140, 261 5165, 236 5190, 21 5190, 21 5165" stroke="#800000" stroke-width="1"/> <polygon fill="#ffff80" points="21 5165, 21 5140, 236 5140, 261 5165, 236 5190, 21 5190, 21 5165" 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="5165">CST_GATE_EN</text> <text alignment-baseline="central" fill="#800000" font-family="Times New Roman" font-size="25" font-weight="400" text-anchor="start" x="21" y="5165">CSP_GATE_EN</text>
<polyline fill="none" points="1761 5015, 1671 5015, 1671 5165, 271 5165, 261 5165" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/> <polyline fill="none" points="1761 5015, 1671 5015, 1671 5165, 271 5165, 261 5165" stroke="#0000ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
...@@ -1339,7 +1339,7 @@ ...@@ -1339,7 +1339,7 @@
<circle cx="1186" cy="5015" fill="none" r="5" stroke="#000000" stroke-width="5"/> <circle cx="1186" cy="5015" fill="none" r="5" stroke="#000000" stroke-width="5"/>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="45" font-weight="700" text-anchor="start" x="1191" y="4725">CST</text> <text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="45" font-weight="700" text-anchor="start" x="1191" y="4725">CSP</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1231" y="5125">HC8</text> <text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1231" y="5125">HC8</text>
...@@ -1963,7 +1963,7 @@ ...@@ -1963,7 +1963,7 @@
<circle cx="1806" cy="5015" fill="none" r="5" stroke="#000000" stroke-width="5"/> <circle cx="1806" cy="5015" 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="1821" y="4695">CST_gate</text> <text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1821" y="4695">CSP_gate</text>
<text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1811" y="5105">BUS_TRANS8</text> <text alignment-baseline="after-edge" fill="#000000" font-family="Arial" font-size="25" font-weight="700" text-anchor="start" x="1811" y="5105">BUS_TRANS8</text>
......
...@@ -63,7 +63,7 @@ const char* asr_register_keyword = "asr"; ...@@ -63,7 +63,7 @@ const char* asr_register_keyword = "asr";
const char* upc_register_keyword = "upc"; const char* upc_register_keyword = "upc";
// 堆栈计数器 // 堆栈计数器
const char* cst_counter_keyword = "cst"; const char* csp_counter_keyword = "csp";
// //
// alu 操作码 // alu 操作码
...@@ -187,15 +187,15 @@ struct PATH_INSTRUCTION_OPERAND_ENTRY path_operand_table[] = ...@@ -187,15 +187,15 @@ struct PATH_INSTRUCTION_OPERAND_ENTRY path_operand_table[] =
,{ &sp_register_keyword, &mar_register_keyword, 0xfff2f7ef } // path sp, mar ,{ &sp_register_keyword, &mar_register_keyword, 0xfff2f7ef } // path sp, mar
,{ &sp_register_keyword, &cst_counter_keyword, 0xff72ffef } // path sp, cst ,{ &sp_register_keyword, &csp_counter_keyword, 0xff72ffef } // path sp, csp
,{ &pc_main_memory_keyword, &ia_register_keyword, 0xfff97feb } // path [pc], ia 执行后pc应加1指向下一条指令 ,{ &pc_main_memory_keyword, &ia_register_keyword, 0xfff97feb } // path [pc], ia 执行后pc应加1指向下一条指令
,{ &pc_main_memory_keyword, &asr_register_keyword, 0xfff97def } // path [pc], asr ,{ &pc_main_memory_keyword, &asr_register_keyword, 0xfff97def } // path [pc], asr
,{ &cst_counter_keyword, &mar_register_keyword, 0xfff8f7ef } // path cst, mar ,{ &csp_counter_keyword, &mar_register_keyword, 0xfff8f7ef } // path csp, mar
,{ &cst_counter_keyword, &sp_register_keyword, 0xfff8feef } // path cst, sp ,{ &csp_counter_keyword, &sp_register_keyword, 0xfff8feef } // path csp, sp
,{ &sp_inc_keyword, &cst_counter_keyword, 0xffffffe7 } // path st_inc, cst ,{ &sp_inc_keyword, &csp_counter_keyword, 0xffffffe7 } // path sp_inc, csp
,{ &sp_dec_keyword, &cst_counter_keyword, 0xffffffef } // path st_dec, cst ,{ &sp_dec_keyword, &csp_counter_keyword, 0xffffffef } // path sp_dec, csp
,{ &pc_register_keyword, &mar_main_memory_keyword, 0xfff3fbed } // path pc, [mar] 将pc值写入mar指向的内存 ,{ &pc_register_keyword, &mar_main_memory_keyword, 0xfff3fbed } // path pc, [mar] 将pc值写入mar指向的内存
,{ &asr_register_keyword, &pc_register_keyword, 0xfff7efef } // path asr, pc ,{ &asr_register_keyword, &pc_register_keyword, 0xfff7efef } // path asr, pc
......
没有这种文件类型的预览
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
0303 0303
0304 ;mov sp, immediate 0304 ;mov sp, immediate
0305 4E0 FF FF FF FF inc pc 0305 4E0 FF FF FF FF inc pc
0306 4E4 EF 7E F9 FF path [pc], sp ;将 PC 指定存储单元的内容传送到栈指针寄存器 SP 中 0306 4E4 EF 7E F9 FF path [pc], sp ;将 PC 指定存储单元的内容传送到栈指针寄存器 SP 中
0307 4E8 FF FF FF FF inc pc 0307 4E8 FF FF FF FF inc pc
0308 4EC CF FF FF FF reset upc 0308 4EC CF FF FF FF reset upc
0309 0309
...@@ -353,12 +353,12 @@ ...@@ -353,12 +353,12 @@
0353 ; int immediate 0353 ; int immediate
0354 5C0 FF FF FF FF inc pc ;PC+1,指向指令中的立即数操作数,即中断号,准备读出 0354 5C0 FF FF FF FF inc pc ;PC+1,指向指令中的立即数操作数,即中断号,准备读出
0355 5C4 EB 7F F9 FF path [pc], ia ;将读出的中断号写入寄存器 IA 中,将来自于立即数的低3位中断号与IA寄存器的高5位中断向量起始地址组合,得到调用中断的中断向量 0355 5C4 EB 7F F9 FF path [pc], ia ;将读出的中断号写入寄存器 IA 中,将来自于立即数的低3位中断号与IA寄存器的高5位中断向量起始地址组合,得到调用中断的中断向量
0356 5C8 EF FF 72 FF path sp, cst ;堆栈指针寄存器的值传送到计数器CST 0356 5C8 EF FF 72 FF path sp, csp ;栈指针寄存器的值传送到计数器CSP
0357 5CC EF FF FF FF path sp_dec, cst ;CST计数器减1 0357 5CC EF FF FF FF path sp_dec, csp ;CSP计数器减1
0358 5D0 EF FE F8 FF path cst, sp ;将CST减1后的结果写入SP中,完成SP-1,入栈,更新栈顶 0358 5D0 EF FE F8 FF path csp, sp ;将CSP减1后的结果写入SP中,完成SP-1,入栈,更新栈顶
0359 5D4 EF F7 F2 FF path sp, mar ;将SP指针暂存到MAR 0359 5D4 EF F7 F2 FF path sp, mar ;将SP指针暂存到MAR
0360 5D8 FF FF FF FF inc pc ;PC+1,中断返回地址,指向下一条指令 0360 5D8 FF FF FF FF inc pc ;PC+1,中断返回地址,指向下一条指令
0361 5DC ED FB F3 FF path pc, [mar] ;将PC值写入MAR指定存储单元,在这里实现的功能是将中断返回地址(PC)写入栈指针(SP)指定的存储单元中 0361 5DC ED FB F3 FF path pc, [mar] ;将PC值写入MAR指定存储单元,在这里实现的功能是将中断返回地址(PC)写入栈指针(SP)指定的存储单元中
0362 5E0 EF F7 F1 FF path ia, mar ;将寄存器IA 的内容作为地址写入 MAR,在这里实现的功能是将调用中断的中断向量写入地址寄存器MAR中,准备读出中断向量指定单元的中断服务程序入口地址 0362 5E0 EF F7 F1 FF path ia, mar ;将寄存器IA 的内容作为地址写入 MAR,在这里实现的功能是将调用中断的中断向量写入地址寄存器MAR中,准备读出中断向量指定单元的中断服务程序入口地址
0363 5E4 EF EB F9 FF path [mar], pc ;将地址寄存器MAR指定单元的内容加载到PC中,在这里实现的功能是将调用中断的服务程序首地址加载到PC,使处理器转去执行中断服务程序 0363 5E4 EF EB F9 FF path [mar], pc ;将地址寄存器MAR指定单元的内容加载到PC中,在这里实现的功能是将调用中断的服务程序首地址加载到PC,使处理器转去执行中断服务程序
0364 5E8 CF FF FF FF reset upc 0364 5E8 CF FF FF FF reset upc
...@@ -371,10 +371,10 @@ ...@@ -371,10 +371,10 @@
0371 ;======================================================================= 0371 ;=======================================================================
0372 ;子程序调用返回指令 0372 ;子程序调用返回指令
0373 ; ret 0373 ; ret
0374 640 EF F7 F2 FF path sp, mar ;将栈指针(栈顶地址)传送到 MAR 0374 640 EF F7 F2 FF path sp, mar ;将栈指针(栈顶地址)传送到 MAR
0375 644 EF FF 72 FF path sp, cst ; 0375 644 EF FF 72 FF path sp, csp ;
0376 648 E7 FF FF FF path sp_inc, cst ; 0376 648 E7 FF FF FF path sp_inc, csp ;
0377 64C EF FE F8 FF path cst, sp ;SP = SP + 1,出栈,更新栈顶 0377 64C EF FE F8 FF path csp, sp ;SP = SP + 1,出栈,更新栈顶
0378 650 EF EB F9 FF path [mar], pc ;将调用返回地址加载到PC,转移到调用处的下一条指令继续执行 0378 650 EF EB F9 FF path [mar], pc ;将调用返回地址加载到PC,转移到调用处的下一条指令继续执行
0379 654 CF FF FF FF reset upc 0379 654 CF FF FF FF reset upc
0380 0380
...@@ -430,9 +430,9 @@ ...@@ -430,9 +430,9 @@
0430 ; call symbol 0430 ; call symbol
0431 740 FF FF FF FF inc pc ;PC+1 0431 740 FF FF FF FF inc pc ;PC+1
0432 744 EF 7D F9 FF path [pc], asr ;将PC指向存储单元内容写入辅助寄存器ASR中,也就是将被调用子程序的入口地址暂存到ASR中 0432 744 EF 7D F9 FF path [pc], asr ;将PC指向存储单元内容写入辅助寄存器ASR中,也就是将被调用子程序的入口地址暂存到ASR中
0433 748 EF FF 72 FF path sp, cst 0433 748 EF FF 72 FF path sp, csp
0434 74C EF FF FF FF path sp_dec, cst 0434 74C EF FF FF FF path sp_dec, csp
0435 750 EF FE F8 FF path cst, sp ;返回地址入栈前,先将SP-1,指向新的栈顶 0435 750 EF FE F8 FF path csp, sp ;返回地址入栈前,先将SP-1,指向新的栈顶
0436 754 EF F7 F2 FF path sp, mar 0436 754 EF F7 F2 FF path sp, mar
0437 758 FF FF FF FF inc pc ;PC+1,指向下一条指令,即返回地址 0437 758 FF FF FF FF inc pc ;PC+1,指向下一条指令,即返回地址
0438 75C ED FB F3 FF path pc, [mar] ;将PC(返回地址)入栈 0438 75C ED FB F3 FF path pc, [mar] ;将PC(返回地址)入栈
...@@ -448,9 +448,9 @@ ...@@ -448,9 +448,9 @@
0448 ;中断返回指令,可参照子程序调用返回指令,出栈 0448 ;中断返回指令,可参照子程序调用返回指令,出栈
0449 ; iret 0449 ; iret
0450 7C0 EF F7 F2 FF path sp, mar 0450 7C0 EF F7 F2 FF path sp, mar
0451 7C4 EF FF 72 FF path sp, cst 0451 7C4 EF FF 72 FF path sp, csp
0452 7C8 E7 FF FF FF path sp_inc, cst 0452 7C8 E7 FF FF FF path sp_inc, csp
0453 7CC EF FE F8 FF path cst, sp 0453 7CC EF FE F8 FF path csp, sp
0454 7D0 EF EB F9 FF path [mar], pc 0454 7D0 EF EB F9 FF path [mar], pc
0455 7D4 CF FF FF FF reset upc 0455 7D4 CF FF FF FF reset upc
0456 0456
......
...@@ -303,7 +303,7 @@ dup 4, null ...@@ -303,7 +303,7 @@ dup 4, null
;mov sp, immediate ;mov sp, immediate
inc pc inc pc
path [pc], sp ;将 PC 指定存储单元的内容传送到栈指针寄存器 SP 中 path [pc], sp ;将 PC 指定存储单元的内容传送到栈指针寄存器 SP 中
inc pc inc pc
reset upc reset upc
...@@ -353,12 +353,12 @@ dup 5, null ...@@ -353,12 +353,12 @@ dup 5, null
; int immediate ; int immediate
inc pc ;PC+1,指向指令中的立即数操作数,即中断号,准备读出 inc pc ;PC+1,指向指令中的立即数操作数,即中断号,准备读出
path [pc], ia ;将读出的中断号写入寄存器 IA 中,将来自于立即数的低3位中断号与IA寄存器的高5位中断向量起始地址组合,得到调用中断的中断向量 path [pc], ia ;将读出的中断号写入寄存器 IA 中,将来自于立即数的低3位中断号与IA寄存器的高5位中断向量起始地址组合,得到调用中断的中断向量
path sp, cst ;堆栈指针寄存器的值传送到计数器CST path sp, csp ;栈指针寄存器的值传送到计数器CSP
path sp_dec, cst ;CST计数器减1 path sp_dec, csp ;CSP计数器减1
path cst, sp ;将CST减1后的结果写入SP中,完成SP-1,入栈,更新栈顶 path csp, sp ;将CSP减1后的结果写入SP中,完成SP-1,入栈,更新栈顶
path sp, mar ;将SP指针暂存到MAR path sp, mar ;将SP指针暂存到MAR
inc pc ;PC+1,中断返回地址,指向下一条指令 inc pc ;PC+1,中断返回地址,指向下一条指令
path pc, [mar] ;将PC值写入MAR指定存储单元,在这里实现的功能是将中断返回地址(PC)写入栈指针(SP)指定的存储单元中 path pc, [mar] ;将PC值写入MAR指定存储单元,在这里实现的功能是将中断返回地址(PC)写入栈指针(SP)指定的存储单元中
path ia, mar ;将寄存器IA 的内容作为地址写入 MAR,在这里实现的功能是将调用中断的中断向量写入地址寄存器MAR中,准备读出中断向量指定单元的中断服务程序入口地址 path ia, mar ;将寄存器IA 的内容作为地址写入 MAR,在这里实现的功能是将调用中断的中断向量写入地址寄存器MAR中,准备读出中断向量指定单元的中断服务程序入口地址
path [mar], pc ;将地址寄存器MAR指定单元的内容加载到PC中,在这里实现的功能是将调用中断的服务程序首地址加载到PC,使处理器转去执行中断服务程序 path [mar], pc ;将地址寄存器MAR指定单元的内容加载到PC中,在这里实现的功能是将调用中断的服务程序首地址加载到PC,使处理器转去执行中断服务程序
reset upc reset upc
...@@ -371,10 +371,10 @@ dup 16, null ...@@ -371,10 +371,10 @@ dup 16, null
;======================================================================= ;=======================================================================
;子程序调用返回指令 ;子程序调用返回指令
; ret ; ret
path sp, mar ;将栈指针(栈顶地址)传送到 MAR path sp, mar ;将栈指针(栈顶地址)传送到 MAR
path sp, cst ; path sp, csp ;
path sp_inc, cst ; path sp_inc, csp ;
path cst, sp ;SP = SP + 1,出栈,更新栈顶 path csp, sp ;SP = SP + 1,出栈,更新栈顶
path [mar], pc ;将调用返回地址加载到PC,转移到调用处的下一条指令继续执行 path [mar], pc ;将调用返回地址加载到PC,转移到调用处的下一条指令继续执行
reset upc reset upc
...@@ -430,9 +430,9 @@ dup 5, null ...@@ -430,9 +430,9 @@ dup 5, null
; call symbol ; call symbol
inc pc ;PC+1 inc pc ;PC+1
path [pc], asr ;将PC指向存储单元内容写入辅助寄存器ASR中,也就是将被调用子程序的入口地址暂存到ASR中 path [pc], asr ;将PC指向存储单元内容写入辅助寄存器ASR中,也就是将被调用子程序的入口地址暂存到ASR中
path sp, cst path sp, csp
path sp_dec, cst path sp_dec, csp
path cst, sp ;返回地址入栈前,先将SP-1,指向新的栈顶 path csp, sp ;返回地址入栈前,先将SP-1,指向新的栈顶
path sp, mar path sp, mar
inc pc ;PC+1,指向下一条指令,即返回地址 inc pc ;PC+1,指向下一条指令,即返回地址
path pc, [mar] ;将PC(返回地址)入栈 path pc, [mar] ;将PC(返回地址)入栈
...@@ -448,9 +448,9 @@ dup 16, null ...@@ -448,9 +448,9 @@ dup 16, null
;中断返回指令,可参照子程序调用返回指令,出栈 ;中断返回指令,可参照子程序调用返回指令,出栈
; iret ; iret
path sp, mar path sp, mar
path sp, cst path sp, csp
path sp_inc, cst path sp_inc, csp
path cst, sp path csp, sp
path [mar], pc path [mar], pc
reset upc reset upc
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论