Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
39d0eae
Write a simple entrypoint
bahmanm Dec 10, 2024
20b43d5
Mark INTERPRET as bypassing NEXT mechanism
bahmanm Dec 10, 2024
65d02e2
Leave NIP to be filled by words. Use jumpTo()
bahmanm Dec 10, 2024
6d058b2
Simplify QUIT
bahmanm Dec 10, 2024
3c18e96
Make Stack add and remove from the head of the list
bahmanm Dec 10, 2024
c6ed0fe
Merge remote-tracking branch 'origin/master' into implement-main-loop
bahmanm Dec 11, 2024
6fd222c
Mark as bypassing NEXT mechanism.
bahmanm Dec 11, 2024
e23f2ea
Call DOCOL at the start
bahmanm Dec 11, 2024
b31f083
Cosmetic
bahmanm Dec 11, 2024
2aebc46
Use static imports
bahmanm Dec 11, 2024
a348056
Mark as immediate
bahmanm Dec 11, 2024
b30c138
Call DOCOL at the start
bahmanm Dec 11, 2024
9e1ea68
Implement a debugging primitive
bahmanm Dec 12, 2024
df58c80
Spotless
bahmanm Dec 12, 2024
a83c63d
Use jumpTo in favour of manually tweaking IP
bahmanm Dec 12, 2024
ca0fdc4
Implement a native DOCLO as a method in Machine
bahmanm Dec 13, 2024
a794c42
Remove the primitive DOCOL and use Machine#DOCOL()
bahmanm Dec 13, 2024
a3483fe
Use threadedCodeStack to advance IP
bahmanm Dec 14, 2024
f05f3a2
Exit the threadedCode
bahmanm Dec 14, 2024
98bb906
Enter the threadedCode
bahmanm Dec 14, 2024
d7a13fd
Merge branch 'experiment-with-native-DOCOL' into implement-main-loop
bahmanm Dec 14, 2024
da90d21
Fix tests RE NIP
bahmanm Dec 14, 2024
69d600a
Fix tests RE NIP
bahmanm Dec 14, 2024
3328c0f
Fix tests RE NIP
bahmanm Dec 14, 2024
7b92050
Fix tests RE NIP
bahmanm Dec 14, 2024
b7b7bb6
Fix tests RE NIP
bahmanm Dec 14, 2024
7a124fa
Fix tests RE NIP
bahmanm Dec 14, 2024
7bde993
Fix tests RE NIP
bahmanm Dec 14, 2024
0103ea6
Fix tests RE NIP
bahmanm Dec 14, 2024
93d266d
Fix tests RE NIP
bahmanm Dec 14, 2024
ebe6de4
Fix tests RE NIP
bahmanm Dec 14, 2024
6cedb39
Fix tests RE NIP
bahmanm Dec 14, 2024
6454f88
Fix tests RE NIP
bahmanm Dec 14, 2024
ba27cd9
Fix tests RE NIP
bahmanm Dec 14, 2024
c41a6d3
Fix tests RE NIP
bahmanm Dec 14, 2024
cd1e5be
Fix tests RE NIP
bahmanm Dec 14, 2024
17f59b9
Spotless
bahmanm Dec 14, 2024
11e7bdf
Fix tests RE NIP
bahmanm Dec 14, 2024
4908080
Fix tests RE NIP
bahmanm Dec 14, 2024
90faf58
Fix tests RE NIP
bahmanm Dec 14, 2024
dceade6
Fix tests RE NIP
bahmanm Dec 14, 2024
8ea0899
Fix tests RE NIP
bahmanm Dec 14, 2024
ba49673
Fix tests RE NIP
bahmanm Dec 14, 2024
911b4a4
Fix tests RE NIP
bahmanm Dec 14, 2024
361ecc4
Fix tests RE NIP
bahmanm Dec 14, 2024
c7b1a94
Fix tests RE NIP
bahmanm Dec 14, 2024
d950107
Fix tests RE NIP
bahmanm Dec 14, 2024
6899ddf
Fix tests RE NIP
bahmanm Dec 14, 2024
4020270
Fix tests RE NIP
bahmanm Dec 14, 2024
6a9846b
Fix tests RE NIP
bahmanm Dec 14, 2024
7fd19c7
Fix tests RE NIP
bahmanm Dec 14, 2024
110f402
Fix tests RE NIP
bahmanm Dec 14, 2024
c35cfe1
Fix tests RE NIP
bahmanm Dec 14, 2024
7fc6b90
Fix tests RE NIP
bahmanm Dec 14, 2024
c917e02
Fix tests RE NIP
bahmanm Dec 14, 2024
cf11bd1
Fix tests RE NIP
bahmanm Dec 14, 2024
ad0fa5a
Fix tests RE NIP
bahmanm Dec 14, 2024
0abc130
Fix tests RE NIP
bahmanm Dec 14, 2024
dcd4c0a
Fix tests RE NIP
bahmanm Dec 14, 2024
164a12d
Fix tests RE NIP
bahmanm Dec 14, 2024
316f7c7
Fix tests RE NIP
bahmanm Dec 14, 2024
b3ec803
Fix tests RE NIP
bahmanm Dec 14, 2024
f2cbed5
Fix tests RE NIP
bahmanm Dec 14, 2024
62e6512
Fix tests RE NIP
bahmanm Dec 14, 2024
b0b3c94
Fix tests RE NIP
bahmanm Dec 14, 2024
627cf87
Fix tests RE NIP
bahmanm Dec 14, 2024
abcfbf3
Fix tests RE NIP
bahmanm Dec 14, 2024
7387a42
Fix tests RE NIP
bahmanm Dec 14, 2024
bab6509
Fix tests RE NIP
bahmanm Dec 14, 2024
403101e
Fix tests RE NIP
bahmanm Dec 14, 2024
8ad9572
Fix tests RE NIP
bahmanm Dec 14, 2024
ff4df63
Fix tests RE NIP
bahmanm Dec 14, 2024
699c9cc
Fix tests RE NIP
bahmanm Dec 14, 2024
4bd4fb9
Fix tests RE NIP
bahmanm Dec 14, 2024
b309231
Fix tests RE NIP
bahmanm Dec 14, 2024
c7b20bb
Fix tests RE NIP
bahmanm Dec 14, 2024
a19dc33
Fix tests RE NIP
bahmanm Dec 14, 2024
d813208
Fix tests RE NIP
bahmanm Dec 14, 2024
5d0dbcd
Fix tests RE NIP
bahmanm Dec 14, 2024
4212274
Fix tests RE NIP
bahmanm Dec 14, 2024
995a91b
Fix tests RE NIP
bahmanm Dec 14, 2024
3a60927
Fix tests RE NIP
bahmanm Dec 14, 2024
afdea93
Fix tests RE NIP
bahmanm Dec 14, 2024
bf4b87d
Fix tests RE NIP
bahmanm Dec 14, 2024
d6dd03d
Fix tests RE NIP
bahmanm Dec 14, 2024
05758a9
Fix tests RE NIP
bahmanm Dec 14, 2024
2d41ad6
Fix tests RE NIP
bahmanm Dec 14, 2024
38a3ee5
Fix tests RE NIP
bahmanm Dec 14, 2024
e4bd999
Fix tests RE NIP
bahmanm Dec 14, 2024
a313adb
Fix tests RE NIP
bahmanm Dec 14, 2024
c311a56
Fix tests RE NIP
bahmanm Dec 14, 2024
db61556
Fix tests RE NIP
bahmanm Dec 14, 2024
a984a4b
Fix tests RE NIP
bahmanm Dec 14, 2024
d70a41a
Fix tests RE NIP
bahmanm Dec 14, 2024
b41d979
Fix tests RE NIP
bahmanm Dec 14, 2024
cff1d4d
Fix tests RE NIP
bahmanm Dec 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 48 additions & 7 deletions bjforth/src/main/java/bjforth/machine/Machine.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,49 @@ public void jumpTo(Integer address) {
state.setInstructionPointer(address);
}

/**
* Executes exactly ONE memory cell and stops.
*
* <p>To be used for debugging/testing purposes.
*/
public void DOCOL(Boolean calledByPrimitive) {
pushToReturnStack(getNextInstructionPointer());
if (!calledByPrimitive) {
setNextInstructionPointer(getInstrcutionPointer() + 1);
}
}

private Integer threadedCodeDepth = 0;

public void enterThreadedCode() {
threadedCodeDepth += 1;
}

public void exitThreadedCode() {
if (threadedCodeDepth == 0) {
throw new MachineException("Invalid threadedCode depth.");
} else {
threadedCodeDepth -= 1;
}
}

private void applyThreadedCode(Integer IP) {
if (threadedCodeDepth > 0) {
setNextInstructionPointer(IP + 1);
}
}

/** Executes exactly ONE memory cell and stops. */
public void step() {
var IP = state.getInstructionPointer();
var content = getMemoryAt(IP);
if (content instanceof NativeSubroutine nativeSubroutine) {
nativeSubroutine.call(this);
} else if (content instanceof Integer address) {
state.setInstructionPointer(address);
jumpTo(address);
applyThreadedCode(IP);
} else if (content instanceof String s && "DOCOL".equals(s)) {
enterThreadedCode();
DOCOL(false);
jumpTo(getInstrcutionPointer() + 1);
} else {
throw new MachineException("don't know how to execute *(%d)".formatted(IP));
// throw new MachineException("don't know how to execute *(%d)".formatted(IP));
jumpTo(getInstrcutionPointer() + 1);
}
}

Expand All @@ -136,4 +165,16 @@ public void loop() {
step();
}
}

public static void main(String[] args) {
System.out.println("bjForth <https://github.com/bahmanm/bjforth>");
System.out.println("⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯");

var state = new MachineState(0, 0, new Memory(), new Dictionary(), new Stack(), new Stack());
var machine = new Machine(state); // Bootstraps the components like memory and dictionary
var QUITaddr = machine.getDictionaryItem("QUIT").get().getAddress();
machine.setNextInstructionPointer(machine.getDictionaryItem("INTERPRET").get().getAddress());
machine.jumpTo(QUITaddr);
machine.loop();
}
}
4 changes: 2 additions & 2 deletions bjforth/src/main/java/bjforth/machine/Stack.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class Stack {
}

public Object pop() {
return data.removeLast();
return data.removeFirst();
}

public void push(Object item) {
data.addLast(item);
data.addFirst(item);
}

public Object peek() {
Expand Down
4 changes: 2 additions & 2 deletions bjforth/src/main/java/bjforth/primitives/COLON.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
public class COLON implements Primitive {
@Override
public void execute(Machine machine) {
machine.DOCOL(true);
WORD().execute(machine);
CREATE().execute(machine);

var LATESTvalue = (Integer) machine.getMemoryAt(Variables.get("LATEST").getAddress());
var DOCOLaddr = machine.getDictionaryItem("DOCOL").get().getAddress();
machine.setMemoryAt(LATESTvalue, DOCOLaddr);
machine.setMemoryAt(LATESTvalue, "DOCOL");
machine.setMemoryAt(Variables.get("HERE").getAddress(), LATESTvalue + 1);
machine.pushToParameterStack(LATESTvalue);
HIDDEN().execute(machine);
Expand Down
1 change: 1 addition & 0 deletions bjforth/src/main/java/bjforth/primitives/EXIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void execute(Machine machine) {
try {
var value = (Integer) machine.popFromReturnStack();
machine.setNextInstructionPointer(value);
machine.exitThreadedCode();
} catch (NoSuchElementException _ex) {
throw new MachineException("Return stack empty.");
}
Expand Down
14 changes: 11 additions & 3 deletions bjforth/src/main/java/bjforth/primitives/INTERPRET.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/
package bjforth.primitives;

import static bjforth.primitives.PrimitiveFactory.FIND;
import static bjforth.primitives.PrimitiveFactory.WORD;

import bjforth.machine.Machine;
import bjforth.machine.MachineException;
import bjforth.variables.Variables;
Expand All @@ -29,13 +32,13 @@ public void execute(Machine machine) {
var HEREaddr = Variables.get("HERE").getAddress();
var HEREvalue = (Integer) machine.getMemoryAt(HEREaddr);

PrimitiveFactory.WORD().execute(machine);
WORD().execute(machine);
var obj = machine.peekIntoParameterStack();
try {
PrimitiveFactory.FIND().execute(machine);
FIND().execute(machine);
var dictItem = machine.getDictionaryItem((Integer) machine.popFromParameterStack()).get();
if (STATE == 0 || dictItem.getIsImmediate()) {
machine.setNextInstructionPointer(dictItem.getAddress());
machine.jumpTo(dictItem.getAddress());
} else {
machine.setMemoryAt(HEREvalue, dictItem.getAddress());
machine.setMemoryAt(HEREaddr, (Integer) machine.getMemoryAt(HEREaddr) + 1);
Expand All @@ -62,4 +65,9 @@ public void execute(Machine machine) {
}
}
}

@Override
public Boolean isBypassNextInstructionPointer() {
return true;
}
}
5 changes: 2 additions & 3 deletions bjforth/src/main/java/bjforth/primitives/Primitive.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public interface Primitive extends NativeSubroutine {
default void call(Machine machine) {
execute(machine);
if (!isBypassNextInstructionPointer()) {
var nextWordAddr = machine.getNextInstructionPointer();
machine.setNextInstructionPointer(nextWordAddr + 1);
machine.jumpTo(nextWordAddr);
var NIP = machine.getNextInstructionPointer();
machine.jumpTo(NIP);
}
}

Expand Down
14 changes: 7 additions & 7 deletions bjforth/src/main/java/bjforth/primitives/PrimitiveFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ static Primitive DIV() {
return containerDIV.get();
}

private static PrimitiveContainer containerDOCOL = new PrimitiveContainer(DOCOL::new);

static Primitive DOCOL() {
return containerDOCOL.get();
}

private static PrimitiveContainer containerDROP = new PrimitiveContainer(DROP::new);

static Primitive DROP() {
Expand Down Expand Up @@ -395,6 +389,12 @@ static Primitive TOR() {
return containerTOR.get();
}

private static PrimitiveContainer containerTOSTRING = new PrimitiveContainer(TOSTRING::new);

static Primitive TOSTRING() {
return containerTOSTRING.get();
}

private static PrimitiveContainer containerTWODROP = new PrimitiveContainer(TWODROP::new);

static Primitive TWODROP() {
Expand Down Expand Up @@ -477,7 +477,6 @@ static Primitive ZNEQU() {
containerDECR4,
containerDFA,
containerDIV,
containerDOCOL,
containerDROP,
containerDSPFETCH,
containerDSPSTORE,
Expand Down Expand Up @@ -525,6 +524,7 @@ static Primitive ZNEQU() {
containerSWAP,
containerTELL,
containerTOR,
containerTOSTRING,
containerTWODROP,
containerTWODUP,
containerTWOSWAP,
Expand Down
5 changes: 2 additions & 3 deletions bjforth/src/main/java/bjforth/primitives/QUIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ public class QUIT implements Primitive {

@Override
public void execute(Machine machine) {
machine.DOCOL(true);
try {
while (true) {
machine.popFromReturnStack();
}
} catch (NoSuchElementException _ex) { // Return stack is empty
}
var nip = machine.getNextInstructionPointer();
PrimitiveFactory.INTERPRET().execute(machine);
machine.setNextInstructionPointer(nip);
machine.setNextInstructionPointer(machine.getDictionaryItem("QUIT").get().getAddress());
machine.jumpTo(machine.getDictionaryItem("INTERPRET").get().getAddress());
}

Expand Down
8 changes: 3 additions & 5 deletions bjforth/src/main/java/bjforth/primitives/SEMICOLON.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
public class SEMICOLON implements Primitive {
@Override
public void execute(Machine machine) {
machine.DOCOL(true);
machine.enterThreadedCode(); // TODO TO be removed.
var HEREvalue = (Integer) machine.getMemoryAt(Variables.get("HERE").getAddress());
machine.setMemoryAt(HEREvalue, machine.getDictionaryItem("EXIT").get().getAddress());
machine.setMemoryAt(Variables.get("HERE").getAddress(), HEREvalue + 1);
var LATESTvalue = (Integer) machine.getMemoryAt(Variables.get("LATEST").getAddress());
machine.pushToParameterStack(LATESTvalue);
HIDDEN().execute(machine);
Expand All @@ -44,9 +47,4 @@ public Boolean isImmediate() {
public String getName() {
return ";";
}

@Override
public Boolean isBypassNextInstructionPointer() {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Bahman Movaqar
* Copyright 2024 Bahman Movaqar
*
* This file is part of bjForth.
*
Expand All @@ -20,11 +20,10 @@

import bjforth.machine.Machine;

class DOCOL implements Primitive {

public class TOSTRING implements Primitive {
@Override
public void execute(Machine machine) {
machine.pushToReturnStack(machine.getNextInstructionPointer());
machine.setNextInstructionPointer(machine.getInstrcutionPointer() + 1);
var obj = machine.peekIntoParameterStack();
System.out.println(obj.toString());
}
}
9 changes: 1 addition & 8 deletions bjforth/src/test/java/bjforth/primitives/ADDSTORETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
package bjforth.primitives;

import static bjforth.machine.BootstrapUtils.getPrimitiveAddress;
import static bjforth.machine.InstructionPointerBuilder.anInstructionPointer;
import static bjforth.machine.MachineAssertions.*;
import static bjforth.machine.MachineBuilder.aMachine;
import static bjforth.machine.MachineStateBuilder.aMachineState;
import static bjforth.machine.MemoryBuilder.aMemory;
import static bjforth.machine.NextInstructionPointerBuilder.aNextInstructionPointer;
import static bjforth.machine.ParameterStackBuilder.aParameterStack;
import static org.assertj.core.api.Assertions.*;

Expand Down Expand Up @@ -59,17 +57,12 @@ void worksOk() {

// THEN
assertThat(actualState)
.hasInstructionPointerEqualTo(anInstructionPointer().with(referenceState).plus(1).build())
.hasNextInstructionPointerEqualTo(
aNextInstructionPointer().with(referenceState).plus(1).build())
.hasDictionaryEqualTo(referenceState)
.hasMemoryEqualTo(
aMemory()
.with(referenceState)
.with(parameterAddress, parameterValue + increment)
.build())
.hasParameterStackEqualTo(aParameterStack().build())
.hasReturnStackEqualTo(referenceState);
.hasParameterStackEqualTo(aParameterStack().build());
}

@DisplayName("should throw if parameter stack top is not a number.")
Expand Down
10 changes: 1 addition & 9 deletions bjforth/src/test/java/bjforth/primitives/ADDTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
package bjforth.primitives;

import static bjforth.machine.BootstrapUtils.getPrimitiveAddress;
import static bjforth.machine.InstructionPointerBuilder.anInstructionPointer;
import static bjforth.machine.MachineAssertions.*;
import static bjforth.machine.MachineBuilder.aMachine;
import static bjforth.machine.MachineStateBuilder.aMachineState;
import static bjforth.machine.MemoryBuilder.aMemory;
import static bjforth.machine.NextInstructionPointerBuilder.aNextInstructionPointer;
import static bjforth.machine.ParameterStackBuilder.aParameterStack;
import static org.assertj.core.api.Assertions.*;

Expand Down Expand Up @@ -75,13 +73,7 @@ void worksOkWithNumbers(

// THEN
assertThat(actualState)
.hasInstructionPointerEqualTo(anInstructionPointer().with(referenceState).plus(1).build())
.hasNextInstructionPointerEqualTo(
aNextInstructionPointer().with(referenceState).plus(1).build())
.hasDictionaryEqualTo(referenceState)
.hasMemoryEqualTo(referenceState)
.hasParameterStackEqualTo(aParameterStack().with(expectedResult).build())
.hasReturnStackEqualTo(referenceState);
.hasParameterStackEqualTo(aParameterStack().with(expectedResult).build());
}

@DisplayName("should throw if any of parameter stack top is not a number.")
Expand Down
13 changes: 2 additions & 11 deletions bjforth/src/test/java/bjforth/primitives/BASETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
package bjforth.primitives;

import static bjforth.machine.BootstrapUtils.getPrimitiveAddress;
import static bjforth.machine.InstructionPointerBuilder.anInstructionPointer;
import static bjforth.machine.MachineAssertions.assertThat;
import static bjforth.machine.MachineBuilder.aMachine;
import static bjforth.machine.MachineStateBuilder.aMachineState;
import static bjforth.machine.MemoryBuilder.aMemory;
import static bjforth.machine.NextInstructionPointerBuilder.aNextInstructionPointer;
import static bjforth.machine.ParameterStackBuilder.aParameterStack;

import bjforth.variables.Variables;
Expand All @@ -33,7 +31,7 @@

class BASETest {
@Test
@DisplayName("Push the value of HERE to parameter stack.")
@DisplayName("Push the value of BASE to parameter stack.")
public void worksOk() {
// GIVEN
var BASEaddr = getPrimitiveAddress("BASE");
Expand All @@ -52,13 +50,6 @@ public void worksOk() {
machine.step();

// THEN
assertThat(actualState)
.hasInstructionPointerEqualTo(anInstructionPointer().with(referenceState).plus(1).build())
.hasNextInstructionPointerEqualTo(
aNextInstructionPointer().with(referenceState).plus(1).build())
.hasDictionaryEqualTo(referenceState)
.hasMemoryEqualTo(referenceState)
.hasParameterStackEqualTo(aParameterStack().with(10).build())
.hasReturnStackEqualTo(referenceState);
assertThat(actualState).hasParameterStackEqualTo(aParameterStack().with(10).build());
}
}
2 changes: 1 addition & 1 deletion bjforth/src/test/java/bjforth/primitives/BRANCHTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void worksOk() {
assertThat(actualState)
.hasInstructionPointerEqualTo(anInstructionPointer().with(nip).plus(offset).build())
.hasNextInstructionPointerEqualTo(
aNextInstructionPointer().with(referenceState).plus(offset).plus(1).build())
aNextInstructionPointer().with(referenceState).plus(offset).build())
.hasMemoryEqualTo(referenceState)
.hasParameterStackEqualTo(aParameterStack().build())
.hasReturnStackEqualTo(referenceState);
Expand Down
10 changes: 1 addition & 9 deletions bjforth/src/test/java/bjforth/primitives/CFATest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
package bjforth.primitives;

import static bjforth.machine.BootstrapUtils.getPrimitiveAddress;
import static bjforth.machine.InstructionPointerBuilder.anInstructionPointer;
import static bjforth.machine.MachineAssertions.assertThat;
import static bjforth.machine.MachineBuilder.aMachine;
import static bjforth.machine.MachineStateBuilder.aMachineState;
import static bjforth.machine.MemoryBuilder.aMemory;
import static bjforth.machine.NextInstructionPointerBuilder.aNextInstructionPointer;
import static bjforth.machine.ParameterStackBuilder.aParameterStack;
import static org.apache.commons.lang3.RandomUtils.nextInt;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down Expand Up @@ -55,13 +53,7 @@ public void worksOk() {
machine.step();

// THEN
assertThat(actualState)
.hasInstructionPointerEqualTo(anInstructionPointer().with(referenceState).plus(1).build())
.hasNextInstructionPointerEqualTo(
aNextInstructionPointer().with(referenceState).plus(1).build())
.hasMemoryEqualTo(referenceState)
.hasParameterStackEqualTo(aParameterStack().build())
.hasReturnStackEqualTo(referenceState);
assertThat(actualState).hasParameterStackEqualTo(aParameterStack().build());
}

@Test
Expand Down
Loading