More 8080 opcodes
This commit is contained in:
parent
eba9428fbf
commit
ccc71d4508
4 changed files with 469 additions and 237 deletions
|
|
@ -777,6 +777,47 @@ CPUSim.prototype.addByteCarry = function(dst, src)
|
|||
return (this.resultZeroCarry = this.resultParitySign = dst + src + ((this.resultZeroCarry & 0x100)? 1 : 0)) & 0xff;
|
||||
};
|
||||
|
||||
/**
|
||||
* subByte(dst, src)
|
||||
*
|
||||
* @this {CPUSim}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
* @return {number} dst - src
|
||||
*/
|
||||
CPUSim.prototype.subByte = function(dst, src)
|
||||
{
|
||||
this.resultAuxOverflow = dst ^ src;
|
||||
return (this.resultZeroCarry = this.resultParitySign = dst - src) & 0xff;
|
||||
};
|
||||
|
||||
/**
|
||||
* subByteBorrow(dst, src)
|
||||
*
|
||||
* @this {CPUSim}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
* @return {number} dst - src - carry
|
||||
*/
|
||||
CPUSim.prototype.subByteBorrow = function(dst, src)
|
||||
{
|
||||
this.resultAuxOverflow = dst ^ src;
|
||||
return (this.resultZeroCarry = this.resultParitySign = dst - src - ((this.resultZeroCarry & 0x100)? 1 : 0)) & 0xff;
|
||||
};
|
||||
|
||||
/**
|
||||
* andByte(dst, src)
|
||||
*
|
||||
* @this {CPUSim}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
* @return {number} dst & src
|
||||
*/
|
||||
CPUSim.prototype.andByte = function(dst, src)
|
||||
{
|
||||
return this.resultZeroCarry = this.resultParitySign = this.resultAuxOverflow = dst & src;
|
||||
};
|
||||
|
||||
/**
|
||||
* getByte(addr)
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue