Build .deb package, try to fix endianness issues
diff --git a/as/CMakeLists.txt b/as/CMakeLists.txt
index 7a7b6a5..f5e3989 100644
--- a/as/CMakeLists.txt
+++ b/as/CMakeLists.txt
@@ -14,3 +14,5 @@
 
 
 add_executable(6502-as main.c as.h as.c map.h map.c hash.c hash.c)
+
+install(TARGETS 6502-as)
diff --git a/as/as.c b/as/as.c
index 1d72d97..989b83c 100644
--- a/as/as.c
+++ b/as/as.c
@@ -21,6 +21,7 @@
 };
 
 #define ERR "\033[31m"
+#define GREEN "\033[32m"
 #define RESET "\033[0m"
 #define MAX_LEN (0xFFFF - 0x600)
 #define MAX_INSTS (MAX_LEN / 2)
@@ -534,7 +535,8 @@
 			if ((no_argument && (_mn == AM_IMP || _mn == AM_ACC))		\
 				 || (mnemonic == _mn && parse_arg(line, am, arg)))		\
 			{															\
-				printf("AM_ succeeded: %s\n", #am);						\
+				printf(GREEN "AM_ succeeded: %s at pc=$%x\n" RESET,		\
+					   #am, pc);										\
 				arg->opcode = op;										\
 				pc += len;												\
 				print_inst(arg);										\
@@ -599,21 +601,21 @@
 			}
 			curr_pc += 2;
 			int16_t diff = lbl - curr_pc;
-			printf("ARG_REL, pc (after) == %x, diff = %d\n", curr_pc, diff);
+			printf("ARG_REL, pc (after) == %x, diff = %hx\n", curr_pc, (uint8_t) diff);
 			if ((diff < 0 ? -diff : diff) > 0xFF)
 			{
 				printf(ERR "Error on line %d: label '%s' is too far away for a relative jump" RESET "\n", insts[i]->line, insts[i]->label);
 				printf("pc == %hx, label is at %hx\n", curr_pc, lbl);
 				goto cleanup;
 			}
-			putshort((uint8_t) diff, out);
+			putc((uint8_t) diff, out);
 			break;
 		}
 		default:
 			curr_pc++;
 		}
 	}
-	
+
 cleanup:
 	printf("-----\n");
 	printf("At end, there are %d instructions\n", num_insts);
diff --git a/as/test/disco.s b/as/test/disco.s
new file mode 100644
index 0000000..7b0e00d
--- /dev/null
+++ b/as/test/disco.s
@@ -0,0 +1,22 @@
+; Taken from 6502asm.com
+
+
+start:
+	inx							; 600
+	txa							; 601
+	sta $200, y					; 602
+	sta $300, y					; 605
+	sta $400, y					; 608
+	sta $500, y					; 60b
+	iny							; 60e
+	tya							; 60f
+	cmp 16						; 610
+	bne do						; 612
+	iny							; 614
+	jmp start					; 615
+do:
+	iny							; 618
+	iny							; 619
+	iny							; 61a
+	iny							; 61b
+	jmp start					; 61c