PC8080 more or less ready for some meat on the bones now
This commit is contained in:
parent
87d01130bd
commit
55b99c8a08
7 changed files with 374 additions and 349 deletions
|
|
@ -5,8 +5,8 @@
|
||||||
<control type="textarea" binding="print" width="100%" height="252px" pos="relative" style="resize:vertical;"/>
|
<control type="textarea" binding="print" width="100%" height="252px" pos="relative" style="resize:vertical;"/>
|
||||||
</control>
|
</control>
|
||||||
<control type="container" class="pcjs-registers" width="100%" padleft="8px">
|
<control type="container" class="pcjs-registers" width="100%" padleft="8px">
|
||||||
<control type="register" label="P" binding="PS" width="20px" padright="8px" padbottom="8px">00</control>
|
|
||||||
<control type="register" label="A" binding="A" width="20px" padright="8px" padbottom="8px">00</control>
|
<control type="register" label="A" binding="A" width="20px" padright="8px" padbottom="8px">00</control>
|
||||||
|
<control type="register" label="F" binding="F" width="20px" padright="8px" padbottom="8px">00</control>
|
||||||
<control type="register" label="B" binding="B" width="20px" padright="8px" padbottom="8px">00</control>
|
<control type="register" label="B" binding="B" width="20px" padright="8px" padbottom="8px">00</control>
|
||||||
<control type="register" label="C" binding="C" width="20px" padright="8px" padbottom="8px">00</control>
|
<control type="register" label="C" binding="C" width="20px" padright="8px" padbottom="8px">00</control>
|
||||||
<control type="register" label="D" binding="D" width="20px" padright="8px" padbottom="8px">00</control>
|
<control type="register" label="D" binding="D" width="20px" padright="8px" padbottom="8px">00</control>
|
||||||
|
|
|
||||||
|
|
@ -106,13 +106,13 @@
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
}
|
}
|
||||||
.pcjs-video-object {
|
.pcjs-screen {
|
||||||
clear: both;
|
clear: both;
|
||||||
height: auto;
|
height: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
}
|
}
|
||||||
.pcjs-video-object textarea {
|
.pcjs-screen textarea {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,7 @@
|
||||||
<xsl:when test="@width">
|
<xsl:when test="@width">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$left != '' or $top != ''">width:<xsl:value-of select="@width"/>;</xsl:when>
|
<xsl:when test="$left != '' or $top != ''">width:<xsl:value-of select="@width"/>;</xsl:when>
|
||||||
|
<xsl:when test="@pos = 'left' or @pos = 'right'">width:<xsl:value-of select="@width"/>;max-width:<xsl:value-of select="@width"/>;</xsl:when>
|
||||||
<xsl:otherwise>width:auto;max-width:<xsl:value-of select="@width"/>;</xsl:otherwise>
|
<xsl:otherwise>width:auto;max-width:<xsl:value-of select="@width"/>;</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
|
@ -217,8 +218,11 @@
|
||||||
<xsl:if test="$component != 'machine'">
|
<xsl:if test="$component != 'machine'">
|
||||||
<xsl:apply-templates select="menu" mode="component"/>
|
<xsl:apply-templates select="menu" mode="component"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
<xsl:variable name="objectClass">
|
||||||
|
<xsl:value-of select="$APPCLASS"/><xsl:text>-</xsl:text><xsl:value-of select="$class"/><xsl:text>-object</xsl:text><xsl:if test="$class = 'video'"><xsl:text> </xsl:text><xsl:value-of select="$CSSCLASS"/><xsl:text>-screen</xsl:text></xsl:if>
|
||||||
|
</xsl:variable>
|
||||||
<xsl:if test="$class != '' and $component != 'machine'">
|
<xsl:if test="$class != '' and $component != 'machine'">
|
||||||
<div class="{$APPCLASS}-{$class}-object" data-value="{{id:'{$id}',name:'{$name}'{$comment}{$parms}}}"> </div>
|
<div class="{$objectClass}" data-value="{{id:'{$id}',name:'{$name}'{$comment}{$parms}}}"> </div>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="control">
|
<xsl:if test="control">
|
||||||
<div class="{$CSSCLASS}-controls">
|
<div class="{$CSSCLASS}-controls">
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,18 @@ CPUDef.opLXIB = function()
|
||||||
this.nStepCycles -= 10;
|
this.nStepCycles -= 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* opTBD()
|
||||||
|
*
|
||||||
|
* @this {CPUSim}
|
||||||
|
*/
|
||||||
|
CPUDef.opTBD = function()
|
||||||
|
{
|
||||||
|
this.setPC(this.getPC() - 1);
|
||||||
|
this.printMessage("unimplemented opcode", true);
|
||||||
|
this.stopCPU();
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This 256-entry array of opcode functions is at the heart of the CPU engine: stepCPU(n).
|
* This 256-entry array of opcode functions is at the heart of the CPU engine: stepCPU(n).
|
||||||
*
|
*
|
||||||
|
|
@ -68,68 +80,68 @@ CPUDef.opLXIB = function()
|
||||||
* money on array lookup.
|
* money on array lookup.
|
||||||
*/
|
*/
|
||||||
CPUDef.aOps = [
|
CPUDef.aOps = [
|
||||||
/* 0x00-0x03 */ CPUDef.opNOP, CPUDef.opLXIB, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x00-0x03 */ CPUDef.opNOP, CPUDef.opLXIB, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x04-0x07 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x04-0x07 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x08-0x0B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x08-0x0B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x0C-0x0F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x0C-0x0F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x10-0x13 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x10-0x13 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x14-0x17 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x14-0x17 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x18-0x1B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x18-0x1B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x1C-0x1F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x1C-0x1F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x20-0x23 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x20-0x23 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x24-0x27 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x24-0x27 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x28-0x2B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x28-0x2B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x2C-0x2F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x2C-0x2F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x30-0x33 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x30-0x33 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x34-0x37 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x34-0x37 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x38-0x3B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x38-0x3B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x3C-0x3F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x3C-0x3F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x40-0x43 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x40-0x43 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x44-0x47 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x44-0x47 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x48-0x4B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x48-0x4B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x4C-0x4F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x4C-0x4F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x50-0x53 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x50-0x53 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x54-0x57 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x54-0x57 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x58-0x5B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x58-0x5B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x5C-0x5F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x5C-0x5F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x60-0x63 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x60-0x63 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x64-0x67 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x64-0x67 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x68-0x6B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x68-0x6B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x6C-0x6F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x6C-0x6F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x70-0x73 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x70-0x73 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x74-0x77 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x74-0x77 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x78-0x7B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x78-0x7B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x7C-0x7F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x7C-0x7F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x80-0x83 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x80-0x83 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x84-0x87 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x84-0x87 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x88-0x8B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x88-0x8B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x8C-0x8F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x8C-0x8F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x90-0x93 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x90-0x93 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x94-0x97 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x94-0x97 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x98-0x9B */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x98-0x9B */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0x9C-0x9F */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0x9C-0x9F */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xA0-0xA3 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xA0-0xA3 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xA4-0xA7 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xA4-0xA7 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xA8-0xAB */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xA8-0xAB */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xAC-0xAF */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xAC-0xAF */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xB0-0xB3 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xB0-0xB3 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xB4-0xB7 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xB4-0xB7 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xB8-0xBB */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xB8-0xBB */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xBC-0xBF */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xBC-0xBF */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xC0-0xC3 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xC0-0xC3 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xC4-0xC7 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xC4-0xC7 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xC8-0xCB */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xC8-0xCB */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xCC-0xCF */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xCC-0xCF */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xD0-0xD3 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xD0-0xD3 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xD4-0xD7 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xD4-0xD7 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xD8-0xDB */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xD8-0xDB */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xDC-0xDF */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xDC-0xDF */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xE0-0xE3 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xE0-0xE3 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xE4-0xE7 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xE4-0xE7 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xE8-0xEB */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xE8-0xEB */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xEC-0xEF */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xEC-0xEF */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xF0-0xF3 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xF0-0xF3 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xF4-0xF7 */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xF4-0xF7 */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xF8-0xFB */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP,
|
/* 0xF8-0xFB */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD,
|
||||||
/* 0xFC-0xFF */ CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP, CPUDef.opNOP
|
/* 0xFC-0xFF */ CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD, CPUDef.opTBD
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ CPUSim.prototype.removeMemCheck = function(addr, fWrite)
|
||||||
CPUSim.prototype.initProcessor = function()
|
CPUSim.prototype.initProcessor = function()
|
||||||
{
|
{
|
||||||
this.cycleCounts = CPUDef.CYCLES;
|
this.cycleCounts = CPUDef.CYCLES;
|
||||||
this.aOps = []; // CPUDef.aOps;
|
this.aOps = CPUDef.aOps;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -682,7 +682,7 @@ CPUSim.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
|
||||||
case "L":
|
case "L":
|
||||||
case "SP":
|
case "SP":
|
||||||
case "PC":
|
case "PC":
|
||||||
case "PS":
|
case "F":
|
||||||
case "C":
|
case "C":
|
||||||
case "P":
|
case "P":
|
||||||
case "A":
|
case "A":
|
||||||
|
|
@ -924,7 +924,7 @@ CPUSim.prototype.updateStatus = function(fForce)
|
||||||
this.updateReg("SP", this.getSP(), 4);
|
this.updateReg("SP", this.getSP(), 4);
|
||||||
this.updateReg("PC", this.getPC(), 4);
|
this.updateReg("PC", this.getPC(), 4);
|
||||||
var regPS = this.getPS();
|
var regPS = this.getPS();
|
||||||
this.updateReg("PS", regPS, 2);
|
this.updateReg("F", regPS, 2);
|
||||||
this.updateReg("S", (regPS & CPUDef.PS.SF), 1);
|
this.updateReg("S", (regPS & CPUDef.PS.SF), 1);
|
||||||
this.updateReg("Z", (regPS & CPUDef.PS.ZF), 1);
|
this.updateReg("Z", (regPS & CPUDef.PS.ZF), 1);
|
||||||
this.updateReg("A", (regPS & CPUDef.PS.AF), 1);
|
this.updateReg("A", (regPS & CPUDef.PS.AF), 1);
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,6 @@ if (DEBUGGER) {
|
||||||
Debugger.CPU_8080 = 0;
|
Debugger.CPU_8080 = 0;
|
||||||
Debugger.CPUS = [8080];
|
Debugger.CPUS = [8080];
|
||||||
|
|
||||||
Debugger.REG_A = 0x07;
|
|
||||||
Debugger.REG_B = 0x00;
|
Debugger.REG_B = 0x00;
|
||||||
Debugger.REG_C = 0x01;
|
Debugger.REG_C = 0x01;
|
||||||
Debugger.REG_D = 0x02;
|
Debugger.REG_D = 0x02;
|
||||||
|
|
@ -312,15 +311,17 @@ if (DEBUGGER) {
|
||||||
Debugger.REG_H = 0x04;
|
Debugger.REG_H = 0x04;
|
||||||
Debugger.REG_L = 0x05;
|
Debugger.REG_L = 0x05;
|
||||||
Debugger.REG_M = 0x06;
|
Debugger.REG_M = 0x06;
|
||||||
Debugger.REG_BC = 0x08;
|
Debugger.REG_A = 0x07;
|
||||||
|
Debugger.REG_F = 0x08; // the flags register ("F")
|
||||||
|
Debugger.REG_BC = 0x09;
|
||||||
Debugger.REG_DE = 0x0A;
|
Debugger.REG_DE = 0x0A;
|
||||||
Debugger.REG_HL = 0x0C;
|
Debugger.REG_HL = 0x0B;
|
||||||
|
Debugger.REG_PS = 0x0C; // aka PSW, which could also be called "AF", since A is the high byte and F is the low byte
|
||||||
Debugger.REG_SP = 0x0D;
|
Debugger.REG_SP = 0x0D;
|
||||||
Debugger.REG_PC = 0x0E;
|
Debugger.REG_PC = 0x0E;
|
||||||
Debugger.REG_PS = 0x0F;
|
|
||||||
|
|
||||||
Debugger.REGS = [
|
Debugger.REGS = [
|
||||||
"B", "C", "D", "E", "H", "L", "M", "A", "BC", null, "DE", null, "HL", "SP", "PC", "PS"
|
"B", "C", "D", "E", "H", "L", "M", "A", "F", "BC", "DE", "HL", "PSW", "SP", "PC"
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -362,9 +363,9 @@ if (DEBUGGER) {
|
||||||
Debugger.TYPE_BC = (Debugger.REG_BC << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_BC = (Debugger.REG_BC << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_DE = (Debugger.REG_DE << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_DE = (Debugger.REG_DE << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_HL = (Debugger.REG_HL << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_HL = (Debugger.REG_HL << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
|
Debugger.TYPE_PS = (Debugger.REG_PS << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_SP = (Debugger.REG_SP << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_SP = (Debugger.REG_SP << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_PC = (Debugger.REG_PC << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
Debugger.TYPE_PC = (Debugger.REG_PC << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
||||||
Debugger.TYPE_PS = (Debugger.REG_PS << 8 | Debugger.TYPE_REG | Debugger.TYPE_WORD);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TYPE_OTHER bit definitions
|
* TYPE_OTHER bit definitions
|
||||||
|
|
@ -391,7 +392,7 @@ if (DEBUGGER) {
|
||||||
*
|
*
|
||||||
* 1) If no TYPE_OTHER bits are specified for the first (destination) operand, TYPE_OUT is assumed;
|
* 1) If no TYPE_OTHER bits are specified for the first (destination) operand, TYPE_OUT is assumed;
|
||||||
* 2) If no TYPE_OTHER bits are specified for the second (source) operand, TYPE_IN is assumed;
|
* 2) If no TYPE_OTHER bits are specified for the second (source) operand, TYPE_IN is assumed;
|
||||||
* 3) If no size is specified for the second operand, the size of the first operand is assumed.
|
* 3) If no size is specified for the second operand, the size is assumed to match the first operand.
|
||||||
*/
|
*/
|
||||||
Debugger.aaOpDescs = [
|
Debugger.aaOpDescs = [
|
||||||
/* 0x00 */ [Debugger.INS.NOP],
|
/* 0x00 */ [Debugger.INS.NOP],
|
||||||
|
|
@ -428,7 +429,7 @@ if (DEBUGGER) {
|
||||||
/* 0x1F */ [Debugger.INS.RAR],
|
/* 0x1F */ [Debugger.INS.RAR],
|
||||||
/* 0x20 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
/* 0x20 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
||||||
/* 0x21 */ [Debugger.INS.LXI, Debugger.TYPE_HL, Debugger.TYPE_IMM],
|
/* 0x21 */ [Debugger.INS.LXI, Debugger.TYPE_HL, Debugger.TYPE_IMM],
|
||||||
/* 0x22 */ [Debugger.INS.SHLD, Debugger.TYPE_IMM | Debugger.TYPE_MEM],
|
/* 0x22 */ [Debugger.INS.SHLD, Debugger.TYPE_IMM | Debugger.TYPE_WORD | Debugger.TYPE_MEM],
|
||||||
/* 0x23 */ [Debugger.INS.INX, Debugger.TYPE_HL],
|
/* 0x23 */ [Debugger.INS.INX, Debugger.TYPE_HL],
|
||||||
/* 0x24 */ [Debugger.INS.INR, Debugger.TYPE_H],
|
/* 0x24 */ [Debugger.INS.INR, Debugger.TYPE_H],
|
||||||
/* 0x25 */ [Debugger.INS.DCR, Debugger.TYPE_H],
|
/* 0x25 */ [Debugger.INS.DCR, Debugger.TYPE_H],
|
||||||
|
|
@ -436,7 +437,7 @@ if (DEBUGGER) {
|
||||||
/* 0x27 */ [Debugger.INS.DAA],
|
/* 0x27 */ [Debugger.INS.DAA],
|
||||||
/* 0x28 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
/* 0x28 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
||||||
/* 0x29 */ [Debugger.INS.DAD, Debugger.TYPE_HL | Debugger.TYPE_IN], // REG_HL is the implied (unlisted) destination
|
/* 0x29 */ [Debugger.INS.DAD, Debugger.TYPE_HL | Debugger.TYPE_IN], // REG_HL is the implied (unlisted) destination
|
||||||
/* 0x2A */ [Debugger.INS.LHLD, Debugger.TYPE_IMM | Debugger.TYPE_MEM],
|
/* 0x2A */ [Debugger.INS.LHLD, Debugger.TYPE_IMM | Debugger.TYPE_WORD | Debugger.TYPE_MEM],
|
||||||
/* 0x2B */ [Debugger.INS.DCX, Debugger.TYPE_HL],
|
/* 0x2B */ [Debugger.INS.DCX, Debugger.TYPE_HL],
|
||||||
/* 0x2C */ [Debugger.INS.INR, Debugger.TYPE_L],
|
/* 0x2C */ [Debugger.INS.INR, Debugger.TYPE_L],
|
||||||
/* 0x2D */ [Debugger.INS.DCR, Debugger.TYPE_L],
|
/* 0x2D */ [Debugger.INS.DCR, Debugger.TYPE_L],
|
||||||
|
|
@ -444,7 +445,7 @@ if (DEBUGGER) {
|
||||||
/* 0x2F */ [Debugger.INS.CMA],
|
/* 0x2F */ [Debugger.INS.CMA],
|
||||||
/* 0x30 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
/* 0x30 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
||||||
/* 0x31 */ [Debugger.INS.LXI, Debugger.TYPE_SP, Debugger.TYPE_IMM],
|
/* 0x31 */ [Debugger.INS.LXI, Debugger.TYPE_SP, Debugger.TYPE_IMM],
|
||||||
/* 0x32 */ [Debugger.INS.STA, Debugger.TYPE_IMM | Debugger.TYPE_MEM],
|
/* 0x32 */ [Debugger.INS.STA, Debugger.TYPE_IMM | Debugger.TYPE_BYTE | Debugger.TYPE_MEM],
|
||||||
/* 0x33 */ [Debugger.INS.INX, Debugger.TYPE_SP],
|
/* 0x33 */ [Debugger.INS.INX, Debugger.TYPE_SP],
|
||||||
/* 0x34 */ [Debugger.INS.INR, Debugger.TYPE_M],
|
/* 0x34 */ [Debugger.INS.INR, Debugger.TYPE_M],
|
||||||
/* 0x35 */ [Debugger.INS.DCR, Debugger.TYPE_M],
|
/* 0x35 */ [Debugger.INS.DCR, Debugger.TYPE_M],
|
||||||
|
|
@ -452,7 +453,7 @@ if (DEBUGGER) {
|
||||||
/* 0x37 */ [Debugger.INS.STC],
|
/* 0x37 */ [Debugger.INS.STC],
|
||||||
/* 0x38 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
/* 0x38 */ [Debugger.INS.NOP, Debugger.TYPE_UNDOC],
|
||||||
/* 0x39 */ [Debugger.INS.DAD, Debugger.TYPE_SP | Debugger.TYPE_IN], // REG_HL is the implied (unlisted) destination
|
/* 0x39 */ [Debugger.INS.DAD, Debugger.TYPE_SP | Debugger.TYPE_IN], // REG_HL is the implied (unlisted) destination
|
||||||
/* 0x3A */ [Debugger.INS.LDA, Debugger.TYPE_IMM | Debugger.TYPE_MEM],
|
/* 0x3A */ [Debugger.INS.LDA, Debugger.TYPE_IMM | Debugger.TYPE_BYTE | Debugger.TYPE_MEM],
|
||||||
/* 0x3B */ [Debugger.INS.DCX, Debugger.TYPE_SP],
|
/* 0x3B */ [Debugger.INS.DCX, Debugger.TYPE_SP],
|
||||||
/* 0x3C */ [Debugger.INS.INR, Debugger.TYPE_A],
|
/* 0x3C */ [Debugger.INS.INR, Debugger.TYPE_A],
|
||||||
/* 0x3D */ [Debugger.INS.DCR, Debugger.TYPE_A],
|
/* 0x3D */ [Debugger.INS.DCR, Debugger.TYPE_A],
|
||||||
|
|
@ -588,69 +589,70 @@ if (DEBUGGER) {
|
||||||
/* 0xBF */ [Debugger.INS.CMP, Debugger.TYPE_A],
|
/* 0xBF */ [Debugger.INS.CMP, Debugger.TYPE_A],
|
||||||
/* 0xC0 */ [Debugger.INS.RNZ],
|
/* 0xC0 */ [Debugger.INS.RNZ],
|
||||||
/* 0xC1 */ [Debugger.INS.POP, Debugger.TYPE_BC],
|
/* 0xC1 */ [Debugger.INS.POP, Debugger.TYPE_BC],
|
||||||
/* 0xC2 */ [Debugger.INS.JNZ, Debugger.TYPE_IMM],
|
/* 0xC2 */ [Debugger.INS.JNZ, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xC3 */ [Debugger.INS.JMP, Debugger.TYPE_IMM],
|
/* 0xC3 */ [Debugger.INS.JMP, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xC4 */ [Debugger.INS.CNZ, Debugger.TYPE_IMM],
|
/* 0xC4 */ [Debugger.INS.CNZ, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xC5 */ [Debugger.INS.PUSH, Debugger.TYPE_BC],
|
/* 0xC5 */ [Debugger.INS.PUSH, Debugger.TYPE_BC],
|
||||||
/* 0xC6 */ [Debugger.INS.ADI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xC6 */ [Debugger.INS.ADI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xC7 */ [Debugger.INS.RST],
|
/* 0xC7 */ [Debugger.INS.RST],
|
||||||
/* 0xC8 */ [Debugger.INS.RZ],
|
/* 0xC8 */ [Debugger.INS.RZ],
|
||||||
/* 0xC9 */ [Debugger.INS.RET],
|
/* 0xC9 */ [Debugger.INS.RET],
|
||||||
/* 0xCA */ [Debugger.INS.JZ, Debugger.TYPE_IMM],
|
/* 0xCA */ [Debugger.INS.JZ, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xCB */ [Debugger.INS.JMP, Debugger.TYPE_IMM | Debugger.TYPE_UNDOC],
|
/* 0xCB */ [Debugger.INS.JMP, Debugger.TYPE_IMM | Debugger.TYPE_WORD | Debugger.TYPE_UNDOC],
|
||||||
/* 0xCC */ [Debugger.INS.CZ, Debugger.TYPE_IMM],
|
/* 0xCC */ [Debugger.INS.CZ, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xCD */ [Debugger.INS.CALL, Debugger.TYPE_IMM],
|
/* 0xCD */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xCE */ [Debugger.INS.ACI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xCE */ [Debugger.INS.ACI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xCF */ [Debugger.INS.RST],
|
/* 0xCF */ [Debugger.INS.RST],
|
||||||
/* 0xD0 */ [Debugger.INS.RNC],
|
/* 0xD0 */ [Debugger.INS.RNC],
|
||||||
/* 0xD1 */ [Debugger.INS.POP, Debugger.TYPE_DE],
|
/* 0xD1 */ [Debugger.INS.POP, Debugger.TYPE_DE],
|
||||||
/* 0xD2 */ [Debugger.INS.JNC, Debugger.TYPE_IMM],
|
/* 0xD2 */ [Debugger.INS.JNC, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xD3 */ [Debugger.INS.OUT, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xD3 */ [Debugger.INS.OUT, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xD4 */ [Debugger.INS.CNC, Debugger.TYPE_IMM],
|
/* 0xD4 */ [Debugger.INS.CNC, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xD5 */ [Debugger.INS.PUSH, Debugger.TYPE_DE],
|
/* 0xD5 */ [Debugger.INS.PUSH, Debugger.TYPE_DE],
|
||||||
/* 0xD6 */ [Debugger.INS.SUI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xD6 */ [Debugger.INS.SUI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xD7 */ [Debugger.INS.RST],
|
/* 0xD7 */ [Debugger.INS.RST],
|
||||||
/* 0xD8 */ [Debugger.INS.RC],
|
/* 0xD8 */ [Debugger.INS.RC],
|
||||||
/* 0xD9 */ [Debugger.INS.RET, Debugger.TYPE_UNDOC],
|
/* 0xD9 */ [Debugger.INS.RET, Debugger.TYPE_UNDOC],
|
||||||
/* 0xDA */ [Debugger.INS.JC, Debugger.TYPE_IMM],
|
/* 0xDA */ [Debugger.INS.JC, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xDB */ [Debugger.INS.IN, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xDB */ [Debugger.INS.IN, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xDC */ [Debugger.INS.CC, Debugger.TYPE_IMM],
|
/* 0xDC */ [Debugger.INS.CC, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xDD */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_UNDOC],
|
/* 0xDD */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_WORD | Debugger.TYPE_UNDOC],
|
||||||
/* 0xDE */ [Debugger.INS.SBI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xDE */ [Debugger.INS.SBI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xDF */ [Debugger.INS.RST],
|
/* 0xDF */ [Debugger.INS.RST],
|
||||||
/* 0xE0 */ [Debugger.INS.RPO],
|
/* 0xE0 */ [Debugger.INS.RPO],
|
||||||
/* 0xE1 */ [Debugger.INS.POP, Debugger.TYPE_HL],
|
/* 0xE1 */ [Debugger.INS.POP, Debugger.TYPE_HL],
|
||||||
/* 0xE2 */ [Debugger.INS.JPO, Debugger.TYPE_IMM],
|
/* 0xE2 */ [Debugger.INS.JPO, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xE3 */ [Debugger.INS.XTHL],
|
/* 0xE3 */ [Debugger.INS.XTHL],
|
||||||
/* 0xE4 */ [Debugger.INS.CPO, Debugger.TYPE_IMM],
|
/* 0xE4 */ [Debugger.INS.CPO, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xE5 */ [Debugger.INS.PUSH, Debugger.TYPE_HL],
|
/* 0xE5 */ [Debugger.INS.PUSH, Debugger.TYPE_HL],
|
||||||
/* 0xE6 */ [Debugger.INS.ANI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xE6 */ [Debugger.INS.ANI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xE7 */ [Debugger.INS.RST],
|
/* 0xE7 */ [Debugger.INS.RST],
|
||||||
/* 0xE8 */ [Debugger.INS.RPE],
|
/* 0xE8 */ [Debugger.INS.RPE],
|
||||||
/* 0xE9 */ [Debugger.INS.PCHL],
|
/* 0xE9 */ [Debugger.INS.PCHL],
|
||||||
/* 0xEA */ [Debugger.INS.JPE, Debugger.TYPE_IMM],
|
/* 0xEA */ [Debugger.INS.JPE, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xEB */ [Debugger.INS.XCHG],
|
/* 0xEB */ [Debugger.INS.XCHG],
|
||||||
/* 0xEC */ [Debugger.INS.CPE, Debugger.TYPE_IMM],
|
/* 0xEC */ [Debugger.INS.CPE, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xED */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_UNDOC],
|
/* 0xED */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_WORD | Debugger.TYPE_UNDOC],
|
||||||
/* 0xEE */ [Debugger.INS.XRI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xEE */ [Debugger.INS.XRI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xEF */ [Debugger.INS.RST],
|
/* 0xEF */ [Debugger.INS.RST],
|
||||||
/* 0xF0 */ [Debugger.INS.RP],
|
/* 0xF0 */ [Debugger.INS.RP],
|
||||||
/* 0xF1 */ [Debugger.INS.POP, Debugger.TYPE_PS],
|
/* 0xF1 */ [Debugger.INS.POP, Debugger.TYPE_PS],
|
||||||
/* 0xF2 */ [Debugger.INS.JP, Debugger.TYPE_IMM],
|
/* 0xF2 */ [Debugger.INS.JP, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xF3 */ [Debugger.INS.DI],
|
/* 0xF3 */ [Debugger.INS.DI],
|
||||||
/* 0xF4 */ [Debugger.INS.CP, Debugger.TYPE_IMM],
|
/* 0xF4 */ [Debugger.INS.CP, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xF5 */ [Debugger.INS.PUSH, Debugger.TYPE_PS],
|
/* 0xF5 */ [Debugger.INS.PUSH, Debugger.TYPE_PS],
|
||||||
/* 0xF6 */ [Debugger.INS.ORI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xF6 */ [Debugger.INS.ORI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xF7 */ [Debugger.INS.RST],
|
/* 0xF7 */ [Debugger.INS.RST],
|
||||||
/* 0xF8 */ [Debugger.INS.RM],
|
/* 0xF8 */ [Debugger.INS.RM],
|
||||||
/* 0xF9 */ [Debugger.INS.SPHL],
|
/* 0xF9 */ [Debugger.INS.SPHL],
|
||||||
/* 0xFA */ [Debugger.INS.JM, Debugger.TYPE_IMM],
|
/* 0xFA */ [Debugger.INS.JM, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xFB */ [Debugger.INS.EI],
|
/* 0xFB */ [Debugger.INS.EI],
|
||||||
/* 0xFC */ [Debugger.INS.CM, Debugger.TYPE_IMM],
|
/* 0xFC */ [Debugger.INS.CM, Debugger.TYPE_IMM | Debugger.TYPE_WORD],
|
||||||
/* 0xFD */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_UNDOC],
|
/* 0xFD */ [Debugger.INS.CALL, Debugger.TYPE_IMM | Debugger.TYPE_WORD | Debugger.TYPE_UNDOC],
|
||||||
/* 0xFE */ [Debugger.INS.CPI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
/* 0xFE */ [Debugger.INS.CPI, Debugger.TYPE_IMM | Debugger.TYPE_BYTE],
|
||||||
/* 0xFF */ [Debugger.INS.RST]
|
/* 0xFF */ [Debugger.INS.RST]
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Message categories supported by the messageEnabled() function and other assorted message
|
* Message categories supported by the messageEnabled() function and other assorted message
|
||||||
* functions. Each category has a corresponding bit value that can be combined (ie, OR'ed) as
|
* functions. Each category has a corresponding bit value that can be combined (ie, OR'ed) as
|
||||||
|
|
@ -1015,8 +1017,8 @@ if (DEBUGGER) {
|
||||||
Debugger.prototype.parseAddr = function(sAddr, fCode, fNoChecks, fPrint)
|
Debugger.prototype.parseAddr = function(sAddr, fCode, fNoChecks, fPrint)
|
||||||
{
|
{
|
||||||
var dbgAddr;
|
var dbgAddr;
|
||||||
var addr = null;
|
|
||||||
var dbgAddrNext = (fCode? this.dbgAddrNextCode : this.dbgAddrNextData);
|
var dbgAddrNext = (fCode? this.dbgAddrNextCode : this.dbgAddrNextData);
|
||||||
|
var addr = dbgAddrNext.addr;
|
||||||
if (sAddr !== undefined) {
|
if (sAddr !== undefined) {
|
||||||
sAddr = this.parseReference(sAddr);
|
sAddr = this.parseReference(sAddr);
|
||||||
dbgAddr = this.findSymbolAddr(sAddr);
|
dbgAddr = this.findSymbolAddr(sAddr);
|
||||||
|
|
@ -1069,7 +1071,7 @@ if (DEBUGGER) {
|
||||||
*/
|
*/
|
||||||
Debugger.prototype.toHexOffset = function(off)
|
Debugger.prototype.toHexOffset = function(off)
|
||||||
{
|
{
|
||||||
return str.toHex(off);
|
return str.toHex(off, 4);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1382,12 +1384,13 @@ if (DEBUGGER) {
|
||||||
case Debugger.REG_E:
|
case Debugger.REG_E:
|
||||||
case Debugger.REG_H:
|
case Debugger.REG_H:
|
||||||
case Debugger.REG_L:
|
case Debugger.REG_L:
|
||||||
case Debugger.REG_PS:
|
case Debugger.REG_F:
|
||||||
cch = 2;
|
cch = 2;
|
||||||
break;
|
break;
|
||||||
case Debugger.REG_BC:
|
case Debugger.REG_BC:
|
||||||
case Debugger.REG_DE:
|
case Debugger.REG_DE:
|
||||||
case Debugger.REG_HL:
|
case Debugger.REG_HL:
|
||||||
|
case Debugger.REG_PS:
|
||||||
case Debugger.REG_SP:
|
case Debugger.REG_SP:
|
||||||
case Debugger.REG_PC:
|
case Debugger.REG_PC:
|
||||||
cch = 4;
|
cch = 4;
|
||||||
|
|
@ -1413,6 +1416,9 @@ if (DEBUGGER) {
|
||||||
case Debugger.REG_A:
|
case Debugger.REG_A:
|
||||||
n = cpu.regA;
|
n = cpu.regA;
|
||||||
break;
|
break;
|
||||||
|
case Debugger.REG_F:
|
||||||
|
n = cpu.getPS() & 0xff;
|
||||||
|
break;
|
||||||
case Debugger.REG_B:
|
case Debugger.REG_B:
|
||||||
n = cpu.regB;
|
n = cpu.regB;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1440,15 +1446,15 @@ if (DEBUGGER) {
|
||||||
case Debugger.REG_HL:
|
case Debugger.REG_HL:
|
||||||
n = (cpu.regH << 8) | cpu.regL;
|
n = (cpu.regH << 8) | cpu.regL;
|
||||||
break;
|
break;
|
||||||
|
case Debugger.REG_PS:
|
||||||
|
n = (cpu.regA << 8) | (cpu.getPS() & 0xff);
|
||||||
|
break;
|
||||||
case Debugger.REG_SP:
|
case Debugger.REG_SP:
|
||||||
n = cpu.getSP();
|
n = cpu.getSP();
|
||||||
break;
|
break;
|
||||||
case Debugger.REG_PC:
|
case Debugger.REG_PC:
|
||||||
n = cpu.getPC();
|
n = cpu.getPC();
|
||||||
break;
|
break;
|
||||||
case Debugger.REG_PS:
|
|
||||||
n = cpu.getPS();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2423,11 +2429,10 @@ if (DEBUGGER) {
|
||||||
var aOpDesc = this.aaOpDescs[bOpcode];
|
var aOpDesc = this.aaOpDescs[bOpcode];
|
||||||
var iIns = aOpDesc[0];
|
var iIns = aOpDesc[0];
|
||||||
|
|
||||||
|
var sOperands = "";
|
||||||
|
var typeSizeDefault = null;
|
||||||
var sOpcode = asOpcodes[iIns];
|
var sOpcode = asOpcodes[iIns];
|
||||||
var cOperands = aOpDesc.length - 1;
|
var cOperands = aOpDesc.length - 1;
|
||||||
var sOperands = "";
|
|
||||||
|
|
||||||
var fComplete = true;
|
|
||||||
|
|
||||||
for (var iOperand = 1; iOperand <= cOperands; iOperand++) {
|
for (var iOperand = 1; iOperand <= cOperands; iOperand++) {
|
||||||
|
|
||||||
|
|
@ -2438,8 +2443,11 @@ if (DEBUGGER) {
|
||||||
|
|
||||||
var typeSize = type & Debugger.TYPE_SIZE;
|
var typeSize = type & Debugger.TYPE_SIZE;
|
||||||
if (typeSize == Debugger.TYPE_NONE) {
|
if (typeSize == Debugger.TYPE_NONE) {
|
||||||
continue;
|
if (typeSizeDefault == null) continue;
|
||||||
|
typeSize = typeSizeDefault;
|
||||||
}
|
}
|
||||||
|
typeSizeDefault = typeSize;
|
||||||
|
|
||||||
var typeMode = type & Debugger.TYPE_MODE;
|
var typeMode = type & Debugger.TYPE_MODE;
|
||||||
if (typeMode == Debugger.TYPE_IMM) {
|
if (typeMode == Debugger.TYPE_IMM) {
|
||||||
sOperand = this.getImmOperand(type, dbgAddr);
|
sOperand = this.getImmOperand(type, dbgAddr);
|
||||||
|
|
@ -2464,12 +2472,12 @@ if (DEBUGGER) {
|
||||||
} while (dbgAddrIns.addr != dbgAddr.addr);
|
} while (dbgAddrIns.addr != dbgAddr.addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
sLine += str.pad(sBytes, dbgAddrIns.fAddr32? 24 : 16);
|
sLine += str.pad(sBytes, 11);
|
||||||
sLine += str.pad(sOpcode, 8);
|
sLine += str.pad(sOpcode, 8);
|
||||||
if (sOperands) sLine += ' ' + sOperands;
|
if (sOperands) sLine += ' ' + sOperands;
|
||||||
|
|
||||||
if (sComment && fComplete) {
|
if (sComment) {
|
||||||
sLine = str.pad(sLine, dbgAddrIns.fAddr32? 74 : 56) + ';' + sComment;
|
sLine = str.pad(sLine, 56) + ';' + sComment;
|
||||||
if (!this.cpu.flags.fChecksum) {
|
if (!this.cpu.flags.fChecksum) {
|
||||||
sLine += (nSequence != null? '=' + nSequence.toString() : "");
|
sLine += (nSequence != null? '=' + nSequence.toString() : "");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2615,13 +2623,14 @@ if (DEBUGGER) {
|
||||||
{
|
{
|
||||||
var s;
|
var s;
|
||||||
s = this.getRegOutput(Debugger.REG_A) +
|
s = this.getRegOutput(Debugger.REG_A) +
|
||||||
|
this.getRegOutput(Debugger.REG_F) +
|
||||||
this.getRegOutput(Debugger.REG_B) +
|
this.getRegOutput(Debugger.REG_B) +
|
||||||
this.getRegOutput(Debugger.REG_C) +
|
this.getRegOutput(Debugger.REG_C) +
|
||||||
this.getRegOutput(Debugger.REG_D) +
|
this.getRegOutput(Debugger.REG_D) +
|
||||||
this.getRegOutput(Debugger.REG_E) +
|
this.getRegOutput(Debugger.REG_E) +
|
||||||
this.getRegOutput(Debugger.REG_H) +
|
this.getRegOutput(Debugger.REG_H) +
|
||||||
this.getRegOutput(Debugger.REG_L) +
|
this.getRegOutput(Debugger.REG_L) +
|
||||||
this.getRegOutput(Debugger.REG_PS) +
|
this.getRegOutput(Debugger.REG_SP) +
|
||||||
this.getFlagOutput('I') + this.getFlagOutput('S') + this.getFlagOutput('Z') +
|
this.getFlagOutput('I') + this.getFlagOutput('S') + this.getFlagOutput('Z') +
|
||||||
this.getFlagOutput('A') + this.getFlagOutput('P') + this.getFlagOutput('C');
|
this.getFlagOutput('A') + this.getFlagOutput('P') + this.getFlagOutput('C');
|
||||||
return s;
|
return s;
|
||||||
|
|
|
||||||
|
|
@ -2667,7 +2667,7 @@ if (DEBUGGER) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseAddrOptions(dbdAddr, sOptions)
|
* parseAddrOptions(dbgAddr, sOptions)
|
||||||
*
|
*
|
||||||
* @this {Debugger}
|
* @this {Debugger}
|
||||||
* @param {DbgAddr} dbgAddr
|
* @param {DbgAddr} dbgAddr
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue