opcodeinc.java

来自「這是一個8051的模擬器 以java寫成」· Java 代码 · 共 29 行

JAVA
29
字号
/** * Projet de langage JAVA IFITEP 3 2005 - Simulateur 8051  * <p>  * D閒inition de l'instruction INC. * Cf.: *  - documentation technique 8051 *  - Ouvrage "Microcontroleur 8051 et 8052", edition Dunod *   * @author Matthieu SIMON * @version 1.0 du 14/06/05 */public class OpcodeINC extends Opcode {		public void execute(CORE_CPU8051 cpu) throws OpcodeException {		int tmp;		if((tmp = decodeAddressingMode(cpu.getCurrentLine().getOperand(1))) == Integer.MAX_VALUE)			throw new OpcodeException(this, "Bad Addressing Mode");				if(tmp == CORE_CPU8051.DPTR) {						int a = ((CORE_CPU8051.internalDataMem[CORE_CPU8051.DPH]<<8)&0xFF00) | (CORE_CPU8051.internalDataMem[CORE_CPU8051.DPL]&0xFF) + 1;			CORE_CPU8051.internalDataMem[CORE_CPU8051.DPH] = ((a>>8)&0xFF);			CORE_CPU8051.internalDataMem[CORE_CPU8051.DPL] = ( a    &0xFF);			cpu.incCyclesCount(1);		}		else			CORE_CPU8051.internalDataMem[tmp] = (byte)(CORE_CPU8051.internalDataMem[tmp] + 1);				cpu.incCyclesCount(1);	}}

⌨️ 快捷键说明

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