aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cpu/Registers.kt
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2018-06-27 21:56:05 +0100
committerJames Barnett <noreply@jamesbarnett.xyz>2018-06-27 21:56:05 +0100
commit6f87feb0c835589adcd566323e058a9158860071 (patch)
tree2ccfd21db561892d6b1ec1d3209f0dc72a00151b /src/main/kotlin/cpu/Registers.kt
parent155c200400ac80be1113e35df6637e2f77296d1a (diff)
downloadKGB-6f87feb0c835589adcd566323e058a9158860071.tar.xz
KGB-6f87feb0c835589adcd566323e058a9158860071.zip
Add 16-Bit pop commands
Diffstat (limited to 'src/main/kotlin/cpu/Registers.kt')
-rw-r--r--src/main/kotlin/cpu/Registers.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/kotlin/cpu/Registers.kt b/src/main/kotlin/cpu/Registers.kt
index 5f45e87..70c7f06 100644
--- a/src/main/kotlin/cpu/Registers.kt
+++ b/src/main/kotlin/cpu/Registers.kt
@@ -123,4 +123,12 @@ class Registers {
}
}
+ fun getAndIncrementSP(): Int {
+ val currentSP = SP
+ if(SP < 0xFFFF) {
+ SP++
+ }
+ return currentSP
+ }
+
} \ No newline at end of file