diff lwdisasm/main.c @ 409:cba03436c720

Checkpoint disassembler
author lost@l-w.ca
date Mon, 02 Aug 2010 18:07:04 -0600
parents 2a94b2e64621
children
line wrap: on
line diff
--- a/lwdisasm/main.c	Mon Aug 02 13:24:07 2010 -0600
+++ b/lwdisasm/main.c	Mon Aug 02 18:07:04 2010 -0600
@@ -76,6 +76,7 @@
 			exit(1);
 		}
 		// register the range as data
+		register_range(as, rangelow, rangehigh, type_data);
 		break;
 		
 	case 0x102: // code range
@@ -92,6 +93,7 @@
 			exit(1);
 		}
 		// register the range as code
+		register_range(as, rangelow, rangehigh, type_code);
 		break;
 	
 	case 0x103: // entry
@@ -182,6 +184,8 @@
 disassembler on the first file
 */
 
+void do_disasm_raw(disasmstate_t *as);
+
 int main(int argc, char **argv)
 {
 	disasmstate_t as = { 0 };
@@ -215,5 +219,38 @@
 
 	fclose(fp);
 
+	switch (as.target)
+	{
+	case TARGET_6309:
+		as.page0 = page0_6309;
+		as.page1 = page1_6309;
+		as.page2 = page2_6309;
+		break;
+		
+	case TARGET_6809:
+		as.page0 = page0_6809;
+		as.page1 = page1_6809;
+		as.page2 = page2_6809;
+		break;
+		
+	default:
+		as.page0 = page0_6809;
+		as.page1 = page1_6809;
+		as.page2 = page2_6809;
+		break;
+		
+	}
+
+	switch (as.input_type)
+	{
+	case INPUT_RAW:
+		do_disasm_raw(&as);
+		break;
+		
+	default:
+		fprintf(stderr, "Input type is not currently implemented\n");
+		exit(1);
+	}
+
 	exit(0);
 }