aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Isom <kyle@tyrfingr.is>2014-01-29 10:19:49 -0700
committerKyle Isom <kyle@tyrfingr.is>2014-01-29 10:19:49 -0700
commit364a3934b37f4a52168cda4523f6b1235b99e13d (patch)
tree6f8d2fcb452686f38d81f15e2eae94b6c1d47dc6
parent6bd13035db4c61bf09b993dff932a58e7afcf900 (diff)
downloadk6502-364a3934b37f4a52168cda4523f6b1235b99e13d.tar.gz
k6502-364a3934b37f4a52168cda4523f6b1235b99e13d.tar.bz2
k6502-364a3934b37f4a52168cda4523f6b1235b99e13d.zip
Add indirect indexed addressing example
-rw-r--r--src/easy6502.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/easy6502.cc b/src/easy6502.cc
index 2f55224..9b8a64c 100644
--- a/src/easy6502.cc
+++ b/src/easy6502.cc
@@ -31,6 +31,7 @@ void test3(void);
void test4(void);
void test5(void);
void test6(void);
+void test7(void);
static void
@@ -156,6 +157,21 @@ test6()
}
+void
+test7()
+{
+ std::cerr << "\nStarting test 7\n";
+ std::cerr << "\t(Indirect indexed addressing)\n";
+
+ unsigned char program[] = {
+ 0xa0, 0x01, 0xa9, 0x03, 0x85, 0x01, 0xa9, 0x01,
+ 0x85, 0x02, 0xa2, 0x0a, 0x8e, 0x04, 0x01, 0xb1,
+ 0x01, 0x00
+ };
+ run(program, 18, false);
+}
+
+
int
main(void)
{
@@ -165,4 +181,5 @@ main(void)
test4();
test5();
test6();
+ test7();
}