⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opcodemovx.java

📁 這是一個8051的模擬器 以java寫成
💻 JAVA
字号:
/** * Projet de langage JAVA IFITEP 3 2005 - Simulateur 8051  * <p>  * D閒inition de l'instruction MOVX. * Cf.: *  - documentation technique 8051 *  - Ouvrage "Microcontroleur 8051 et 8052", edition Dunod *   * @author Matthieu SIMON * @version 1.0 du 14/06/05 */public class OpcodeMOVX extends Opcode {	public void execute(CORE_CPU8051 cpu) throws OpcodeException {		int dest, src;		if((dest = decodeAddressingMode(cpu.getCurrentLine().getOperand(1))) == Integer.MAX_VALUE)			throw new OpcodeException(this, "Bad Addressing Mode");		if((src = decodeAddressingMode(cpu.getCurrentLine().getOperand(2))) == Integer.MAX_VALUE)			throw new OpcodeException(this, "Bad Addressing Mode");				if(src >= CORE_CPU8051.externalDataMem.length || dest >= CORE_CPU8051.externalDataMem.length)			throw new OpcodeException(this, "Adressing is away from External Memory which is about " + 					(CORE_CPU8051.externalDataMem.length/1024) + "kbytes");				if(cpu.getCurrentLine().getOperand(1).equals("a")) // lecture externe			CORE_CPU8051.internalDataMem[CORE_CPU8051.ACC] = CORE_CPU8051.externalDataMem[src];		else if(cpu.getCurrentLine().getOperand(2).equals("a")) // ecriture externe			CORE_CPU8051.externalDataMem[dest] = CORE_CPU8051.internalDataMem[CORE_CPU8051.ACC];		else			throw new OpcodeException(this, "Bad Register Addressing");		cpu.incCyclesCount(2);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -