@@ 4,13 4,19 @@ rm ./lin6
clang-format -i lin6.c
+# Gnu/Linux
cc -std=c89 -DDEBUG -Wall -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined lin6.c -o lin6
+# Rpi
# tcc -Wall lin6.c -o lin6
+# Plan9
+# pcc lin6.c -o lin6
+
./lin6
./lin6 -?
./lin6 -v
./lin6 source.asm
./lin6 -i source.asm
-./lin6 -i -d source.asm>
\ No newline at end of file
+./lin6 -i -d source.asm
+
@@ 1,5 1,5 @@
/* Lin6
- Version 1.1
+ Version 1.2
https://wiki.xxiivv.com/lin6
*/
@@ 24,14 24,15 @@
*/
#include <ctype.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define VERSION "1.1"
+#define VERSION "1.2"
#define BUFLEN 512
+typedef enum { false, true } bool;
+
char *OPCODES[] = {"ADC", "AND", "ASL", "BCC", "BCS", "BEQ", "BIT", "BMI",
"BNE", "BPL", "BRK", "BVC", "BVS", "CLC", "CLD", "CLI",
"CLV", "CMP", "CPX", "CPY", "DEC", "DEX", "DEY", "EOR",
@@ 285,7 286,6 @@ void lint(char *filepath, char *output, bool do_debug) {
strcat(output, "\n");
}
if (has_comment(line)) {
- fillstr(key, 30, ' ');
strcat(output, key);
strcat(output, " ");
strcat(output, comment);
@@ 400,9 400,9 @@ void lint(char *filepath, char *output, bool do_debug) {
fclose(fr);
}
-void show_version() { puts("Lin6 " VERSION); }
+void show_version(void) { puts("Lin6 " VERSION); }
-void show_help() {
+void show_help(void) {
show_version();
puts("");
puts("A tool to format 6502 assembly code.\n");
@@ 447,4 447,4 @@ int main(int argc, char *argv[]) {
}
}
return 0;
-}
+}<
\ No newline at end of file