aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Isom <kyle@tyrfingr.is>2014-01-29 13:56:56 -0700
committerKyle Isom <kyle@tyrfingr.is>2014-01-29 13:56:56 -0700
commit8e4a7fab6904a33371393f0fd5fbde9570f8ee57 (patch)
treee9a8d96684b61b4767815ca965bae9d7f356f859
parent0c2a35d8a6d9759efd274581a88dec8c9c84618f (diff)
downloadk6502-8e4a7fab6904a33371393f0fd5fbde9570f8ee57.tar.gz
k6502-8e4a7fab6904a33371393f0fd5fbde9570f8ee57.tar.bz2
k6502-8e4a7fab6904a33371393f0fd5fbde9570f8ee57.zip
fix short program load
program is 20, not 12, bytes
-rw-r--r--src/easy6502.cc36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/easy6502.cc b/src/easy6502.cc
index 3de5b75..3f93c53 100644
--- a/src/easy6502.cc
+++ b/src/easy6502.cc
@@ -33,6 +33,8 @@ void test5(void);
void test6(void);
void test7(void);
void test8(void);
+void test9(void);
+void test10(void);
static void
@@ -179,7 +181,6 @@ test8()
std::cerr << "\nStarting test 8\n";
std::cerr << "\t(Stack manipulation 1)\n";
-
unsigned char program[] = {
0xa2, 0x00, 0xa0, 0x00, 0x8a, 0x99, 0x00, 0x02,
0x48, 0xe8, 0xc8, 0xc0, 0x10, 0xd0, 0xf5, 0x68,
@@ -190,6 +191,35 @@ test8()
}
+void
+test9()
+{
+ std::cerr << "\nStarting test 9\n";
+ std::cerr << "\t(jump)\n";
+
+ unsigned char program[] = {
+ 0xa9, 0x03, 0x4c, 0x08, 0x03, 0x00, 0x00, 0x00,
+ 0x8d, 0x00, 0x02, 0x00
+ };
+ run(program, 12, false);
+}
+
+
+void
+test10()
+{
+ std::cerr << "\nStarting test 10\n";
+ std::cerr << "\t(JSR/RTS)\n";
+
+ unsigned char program[] = {
+ 0x20, 0x09, 0x03, 0x20, 0x0c, 0x03, 0x20, 0x12,
+ 0x03, 0xa2, 0x00, 0x60, 0xe8, 0xe0, 0x05, 0xd0,
+ 0xfb, 0x60, 0x00, 0x00
+ };
+ run(program, 20, false);
+}
+
+
int
main(void)
{
@@ -200,5 +230,7 @@ main(void)
// test5();
// test6();
// test7();
- test8();
+ // test8();
+ // test9();
+ test10();
}