implemented PC (#11)
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
package de.darkress.pic16f84sim;
|
||||
|
||||
import de.darkress.pic16f84sim.commands.Command;
|
||||
import de.darkress.pic16f84sim.decoder.CommandDecoder;
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.registers.Stack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import de.darkress.pic16f84sim.microcontroller.Stack;
|
||||
|
||||
class Main
|
||||
{
|
||||
@@ -17,6 +12,7 @@ class Main
|
||||
program.get(0).execute();
|
||||
*/
|
||||
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
Stack.push(i);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
|
||||
public class Addlw extends CommandUtils implements Command
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
|
||||
public class Andlw extends CommandUtils implements Command
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
|
||||
public class CommandUtils
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
|
||||
public class Iorlw extends CommandUtils implements Command
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
|
||||
public class Movlw extends CommandUtils implements Command
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package de.darkress.pic16f84sim.commands;
|
||||
|
||||
import de.darkress.pic16f84sim.registers.Memory;
|
||||
import de.darkress.pic16f84sim.microcontroller.Memory;
|
||||
|
||||
public class Sublw extends CommandUtils implements Command
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.darkress.pic16f84sim.registers;
|
||||
package de.darkress.pic16f84sim.microcontroller;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
18
de/darkress/pic16f84sim/microcontroller/ProgramCounter.java
Normal file
18
de/darkress/pic16f84sim/microcontroller/ProgramCounter.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package de.darkress.pic16f84sim.microcontroller;
|
||||
|
||||
public class ProgramCounter
|
||||
|
||||
//This class is not actual part of the µC. It is a storage for the current value of the PC
|
||||
{
|
||||
private static int PC = 0;
|
||||
|
||||
public static int getPC()
|
||||
{
|
||||
return PC;
|
||||
}
|
||||
|
||||
public static void setPC(int PC)
|
||||
{
|
||||
ProgramCounter.PC = PC;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.darkress.pic16f84sim.registers;
|
||||
package de.darkress.pic16f84sim.microcontroller;
|
||||
|
||||
|
||||
public class Stack
|
||||
Reference in New Issue
Block a user