aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/ram/Ram.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/ram/Ram.kt')
-rw-r--r--src/main/kotlin/ram/Ram.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/kotlin/ram/Ram.kt b/src/main/kotlin/ram/Ram.kt
new file mode 100644
index 0000000..93336a7
--- /dev/null
+++ b/src/main/kotlin/ram/Ram.kt
@@ -0,0 +1,16 @@
+package ram
+
+class Ram {
+
+ // 64K memory area
+ var ram = IntArray(0xFFFF)
+
+ fun readByte(address: Int) : Int {
+ return ram[address]
+ }
+
+ fun writeByte(address: Int, data: Int) {
+ ram[address] = data
+ }
+
+} \ No newline at end of file