提交 6f4cccaf 创建 作者: 李川's avatar 李川

Merge branch 'hdr' into 'master'

将计数器CST名称修改为CSP See merge request !4
...@@ -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_add, cst ,{ &sp_inc_keyword, &csp_counter_keyword, 0xffffffe7 } // path sp_add, csp
,{ &sp_dec_keyword, &cst_counter_keyword, 0xffffffef } // path st_minus, cst ,{ &sp_dec_keyword, &csp_counter_keyword, 0xffffffef } // path sp_minus, 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
......
没有这种文件类型的预览
...@@ -407,9 +407,9 @@ ...@@ -407,9 +407,9 @@
0407 ; int immediate 0407 ; int immediate
0408 5C0 FF FF FF FF inc pc 0408 5C0 FF FF FF FF inc pc
0409 5C4 EB 7F F9 FF path [pc], ia 0409 5C4 EB 7F F9 FF path [pc], ia
0410 5C8 EF FF 72 FF path sp, cst 0410 5C8 EF FF 72 FF path sp, csp
0411 5CC E7 FF FF FF path sp_inc, cst 0411 5CC E7 FF FF FF path sp_inc, csp
0412 5D0 EF FE F8 FF path cst, sp 0412 5D0 EF FE F8 FF path csp, sp
0413 5D4 EF F7 F2 FF path sp, mar 0413 5D4 EF F7 F2 FF path sp, mar
0414 5D8 FF FF FF FF inc pc 0414 5D8 FF FF FF FF inc pc
0415 5DC ED FB F3 FF path pc, [mar] 0415 5DC ED FB F3 FF path pc, [mar]
...@@ -426,9 +426,9 @@ ...@@ -426,9 +426,9 @@
0426 ;子程序调用返回指令 0426 ;子程序调用返回指令
0427 ; ret 0427 ; ret
0428 640 EF F7 F2 FF path sp, mar ;将堆栈指针(栈顶地址)传送到 MAR 0428 640 EF F7 F2 FF path sp, mar ;将堆栈指针(栈顶地址)传送到 MAR
0429 644 EF FF 72 FF path sp, cst ; 0429 644 EF FF 72 FF path sp, csp ;
0430 648 E7 FF FF FF path sp_inc, cst ; 0430 648 E7 FF FF FF path sp_inc, csp ;
0431 64C EF FE F8 FF path cst, sp ;SP = SP + 1,出栈,更新栈顶 0431 64C EF FE F8 FF path csp, sp ;SP = SP + 1,出栈,更新栈顶
0432 650 EF EB F9 FF path [mar], pc ;将调用返回地址加载到PC,转移到调用处的下一条指令继续执行 0432 650 EF EB F9 FF path [mar], pc ;将调用返回地址加载到PC,转移到调用处的下一条指令继续执行
0433 654 CF FF FF FF reset upc 0433 654 CF FF FF FF reset upc
0434 0434
...@@ -487,9 +487,9 @@ ...@@ -487,9 +487,9 @@
0487 ; call symbol 0487 ; call symbol
0488 740 FF FF FF FF inc pc 0488 740 FF FF FF FF inc pc
0489 744 EF 7D F9 FF path [pc], asr 0489 744 EF 7D F9 FF path [pc], asr
0490 748 EF FF 72 FF path sp, cst 0490 748 EF FF 72 FF path sp, csp
0491 74C EF FF FF FF path sp_dec, cst 0491 74C EF FF FF FF path sp_dec, csp
0492 750 EF FE F8 FF path cst, sp 0492 750 EF FE F8 FF path csp, sp
0493 754 EF F7 F2 FF path sp, mar 0493 754 EF F7 F2 FF path sp, mar
0494 758 FF FF FF FF inc pc 0494 758 FF FF FF FF inc pc
0495 75C ED FB F3 FF path pc, [mar] 0495 75C ED FB F3 FF path pc, [mar]
...@@ -503,9 +503,9 @@ ...@@ -503,9 +503,9 @@
0503 ; 硬中断处理微指令程序。 0503 ; 硬中断处理微指令程序。
0504 ;硬中断处理就是入栈过程,将下一条指令的地址(中断返回地址)入栈,入栈过程就是将返回地址写入sp加1后指向的存储单元中 0504 ;硬中断处理就是入栈过程,将下一条指令的地址(中断返回地址)入栈,入栈过程就是将返回地址写入sp加1后指向的存储单元中
0505 ;然后将硬中断服务程序入口地址加载到PC,转去执行服务程序。 0505 ;然后将硬中断服务程序入口地址加载到PC,转去执行服务程序。
0506 780 EF FF 72 FF path sp, cst ;将堆栈指针寄存器sp的值传送到cst计数器 0506 780 EF FF 72 FF path sp, csp ;将堆栈指针寄存器sp的值传送到cst计数器
0507 784 EF FF FF FF path sp_dec, cst ;计数器cst减1 0507 784 EF FF FF FF path sp_dec, csp ;计数器cst减1
0508 788 EF FE F8 FF path cst, sp ;将减计数结果写回sp,完成堆栈指针sp-1操作,为返回地址入栈做准备 0508 788 EF FE F8 FF path csp, sp ;将减计数结果写回sp,完成堆栈指针sp-1操作,为返回地址入栈做准备
0509 78C EF F7 F2 FF path sp, mar ;sp堆栈指针寄存器内容传送到地址寄存器mar 0509 78C EF F7 F2 FF path sp, mar ;sp堆栈指针寄存器内容传送到地址寄存器mar
0510 790 ED FB F3 FF path pc, [mar] ;将返回地址PC入栈 0510 790 ED FB F3 FF path pc, [mar] ;将返回地址PC入栈
0511 0511
...@@ -526,9 +526,9 @@ ...@@ -526,9 +526,9 @@
0526 ;与此同时,sp加1,指向新的栈顶 0526 ;与此同时,sp加1,指向新的栈顶
0527 ; iret 0527 ; iret
0528 7C0 EF F7 F2 FF path sp, mar ;将栈顶指针SP传入地址寄存器MAR,也就是将中断返回地址传入mar 0528 7C0 EF F7 F2 FF path sp, mar ;将栈顶指针SP传入地址寄存器MAR,也就是将中断返回地址传入mar
0529 7C4 EF FF 72 FF path sp, cst ;sp传入cst计数器 0529 7C4 EF FF 72 FF path sp, csp ;sp传入cst计数器
0530 7C8 E7 FF FF FF path sp_inc, cst ;cst计数器加1 0530 7C8 E7 FF FF FF path sp_inc, csp ;cst计数器加1
0531 7CC EF FE F8 FF path cst, sp ;将cst减1后的结果写入sp,也就是出栈后,sp减1,指向新的栈顶 0531 7CC EF FE F8 FF path csp, sp ;将cst减1后的结果写入sp,也就是出栈后,sp减1,指向新的栈顶
0532 7D0 EF EB F9 FF path [mar], pc ;将mar寄存器指向存储单元的内容作为地址传入PC,实现中断返回 0532 7D0 EF EB F9 FF path [mar], pc ;将mar寄存器指向存储单元的内容作为地址传入PC,实现中断返回
0533 7D4 EF FF FD FF eoi ;清除已经服务完的硬中断标志 0533 7D4 EF FF FD FF eoi ;清除已经服务完的硬中断标志
0534 7D8 CF FF FF FF reset upc 0534 7D8 CF FF FF FF reset upc
......
...@@ -407,9 +407,9 @@ dup 4, null ...@@ -407,9 +407,9 @@ dup 4, null
; int immediate ; int immediate
inc pc inc pc
path [pc], ia path [pc], ia
path sp, cst path sp, csp
path sp_inc, cst path sp_inc, csp
path cst, sp path csp, sp
path sp, mar path sp, mar
inc pc inc pc
path pc, [mar] path pc, [mar]
...@@ -426,9 +426,9 @@ dup 16, null ...@@ -426,9 +426,9 @@ 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
...@@ -487,9 +487,9 @@ dup 4, null ...@@ -487,9 +487,9 @@ dup 4, null
; call symbol ; call symbol
inc pc inc pc
path [pc], asr path [pc], asr
path sp, cst path sp, csp
path sp_dec, cst path sp_dec, csp
path cst, sp path csp, sp
path sp, mar path sp, mar
inc pc inc pc
path pc, [mar] path pc, [mar]
...@@ -503,9 +503,9 @@ dup 5, null ...@@ -503,9 +503,9 @@ dup 5, null
; 硬中断处理微指令程序。 ; 硬中断处理微指令程序。
;硬中断处理就是入栈过程,将下一条指令的地址(中断返回地址)入栈,入栈过程就是将返回地址写入sp加1后指向的存储单元中 ;硬中断处理就是入栈过程,将下一条指令的地址(中断返回地址)入栈,入栈过程就是将返回地址写入sp加1后指向的存储单元中
;然后将硬中断服务程序入口地址加载到PC,转去执行服务程序。 ;然后将硬中断服务程序入口地址加载到PC,转去执行服务程序。
path sp, cst ;将堆栈指针寄存器sp的值传送到cst计数器 path sp, csp ;将堆栈指针寄存器sp的值传送到cst计数器
path sp_dec, cst ;计数器cst减1 path sp_dec, csp ;计数器cst减1
path cst, sp ;将减计数结果写回sp,完成堆栈指针sp-1操作,为返回地址入栈做准备 path csp, sp ;将减计数结果写回sp,完成堆栈指针sp-1操作,为返回地址入栈做准备
path sp, mar ;sp堆栈指针寄存器内容传送到地址寄存器mar path sp, mar ;sp堆栈指针寄存器内容传送到地址寄存器mar
path pc, [mar] ;将返回地址PC入栈 path pc, [mar] ;将返回地址PC入栈
...@@ -526,9 +526,9 @@ dup 6, null ...@@ -526,9 +526,9 @@ dup 6, null
;与此同时,sp加1,指向新的栈顶 ;与此同时,sp加1,指向新的栈顶
; iret ; iret
path sp, mar ;将栈顶指针SP传入地址寄存器MAR,也就是将中断返回地址传入mar path sp, mar ;将栈顶指针SP传入地址寄存器MAR,也就是将中断返回地址传入mar
path sp, cst ;sp传入cst计数器 path sp, csp ;sp传入cst计数器
path sp_inc, cst ;cst计数器加1 path sp_inc, csp ;cst计数器加1
path cst, sp ;将cst减1后的结果写入sp,也就是出栈后,sp减1,指向新的栈顶 path csp, sp ;将cst减1后的结果写入sp,也就是出栈后,sp减1,指向新的栈顶
path [mar], pc ;将mar寄存器指向存储单元的内容作为地址传入PC,实现中断返回 path [mar], pc ;将mar寄存器指向存储单元的内容作为地址传入PC,实现中断返回
eoi ;清除已经服务完的硬中断标志 eoi ;清除已经服务完的硬中断标志
reset upc reset upc
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论