提出一种基于CPU仿真器的汇编语言学习系统设计模型和实现方法。该系统利用JavaBean组件技术实现CPU的仿真;结合多线程技术和锁机制实现组件的数据触发式调度机制,有效地解决了具有复杂关系的组件之间的调度运行问题,保证了微命令的有序执行;基于脉冲信号的事件触发机制,实现了微指令的单步调试;基于所设计的CPU仿真器指令系统,采用现代编译技术设计了一种汇编器,实现了CPU仿真器上汇编指令到机器指令的快速编译。与已有的汇编语言学习系统相比,本系统不仅在通用性、交互性等方面都有较大提高,而且能形象直观地展示虚拟寄存器等各个虚拟芯片的实时状态,记录对应的微指令流,从而更精确地监视汇编指令在CPU仿真器中的执行过程。
An assembly language learning system(ASMLL),which is based on the CPU simulator,was presented.ASMLL simulated CPU with the JavaBean component technology.By using multi-thread technology and lock mechanism,ASMLL realized a scheduling mechanism based on component data triggered,which is an effective solution to deal with the scheduling problems of these components with complex relationship between each other,and can ensure micro-orders to run in an orderly implementation.Pulse signal based event triggered mechanism can implement the single-step debugging of enables microinstruction.Based on the instruction system of CPU simulator,a kind of assembler with modern compiler technology was designed,which can translate assembly instructions to machine instructions quickly on the CPU Simulator.ASMLL can display the status of virtual register and other virtual chips in real-time,record the corresponding microinstruction flow to monitor the implementation process of compiler command on CPU simulator.