-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Branching and Clear Instructions
- Loading branch information
Showing
16 changed files
with
430 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Apollo.Virtual.AGC.Base; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Apollo.Virtual.AGC.Instructions | ||
{ | ||
/// <summary> | ||
/// BZMF - EX 0110 | ||
/// | ||
/// Jumps to a fixed memory location if the accumulator is 0 or negative | ||
/// </summary> | ||
class BranchZeroOrMinusToFixed : IInstruction | ||
{ | ||
public ushort Code | ||
{ | ||
get { return 0x06; } | ||
} | ||
|
||
public Processor CPU { get; set; } | ||
|
||
public void Execute(ushort K) | ||
{ | ||
var value = CPU.A.Read(); | ||
|
||
// if +0 or negative, jump | ||
if (value == 0 || (value & 0x8000) > 0) | ||
CPU.Z.Write(K); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Apollo.Virtual.AGC.Base; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Apollo.Virtual.AGC.Instructions | ||
{ | ||
/// <summary> | ||
/// CA - 0011 | ||
/// | ||
/// Moves the contents of memory at location K into the accumulator | ||
/// </summary> | ||
class ClearAndAdd : IInstruction | ||
{ | ||
public ushort Code | ||
{ | ||
get { return 0x3; } | ||
} | ||
|
||
public Processor CPU { get; set; } | ||
|
||
public void Execute(ushort K) | ||
{ | ||
var value = CPU.Memory[K]; | ||
|
||
// set value in accumulator | ||
CPU.A.Write(value); | ||
|
||
// value in K is re-written | ||
CPU.Memory[K] = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.