diff options
author | fishsoupisgood <github@madingley.org> | 2019-05-27 02:46:10 +0100 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2019-05-27 02:46:10 +0100 |
commit | 3e79d2f5d768fa7ac63fdad196a5e32fbaeffcaf (patch) | |
tree | e47bb0b5f2c41fb8df62b2be4f7bfb864ae474ee /master | |
download | asl-pq-3e79d2f5d768fa7ac63fdad196a5e32fbaeffcaf.tar.gz asl-pq-3e79d2f5d768fa7ac63fdad196a5e32fbaeffcaf.tar.bz2 asl-pq-3e79d2f5d768fa7ac63fdad196a5e32fbaeffcaf.zip |
first working version
Diffstat (limited to 'master')
-rw-r--r-- | master/endstop | 0 | ||||
-rw-r--r-- | master/fix-nls.patch | 13 | ||||
-rw-r--r-- | master/makefile.def.patch | 33 | ||||
-rw-r--r-- | master/series | 6 | ||||
-rw-r--r-- | master/set-default-org-for-timex.patch | 40 | ||||
-rw-r--r-- | master/timex-pseudo-instructions.patch | 404 | ||||
-rw-r--r-- | master/x86_64-support.patch | 37 |
7 files changed, 533 insertions, 0 deletions
diff --git a/master/endstop b/master/endstop new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/master/endstop diff --git a/master/fix-nls.patch b/master/fix-nls.patch new file mode 100644 index 0000000..bb0f7c3 --- /dev/null +++ b/master/fix-nls.patch @@ -0,0 +1,13 @@ +diff --git a/nls.c b/nls.c +index f377003..5701f52 100644 +--- a/nls.c ++++ b/nls.c +@@ -343,7 +343,7 @@ BEGIN + case 'S': FmtBuffer+=1; break; + case 'M': FmtBuffer+=2; break; + case 'H': FmtBuffer+=3; break; +- case 'T': fprintf(stderr, "\nwarning, detected non-ANSI time format specifier '%%T'"); ++ case 'T': //fprintf(stderr, "\nwarning, detected non-ANSI time format specifier '%%T'"); + run = "H:%M:%S"; break; + case 'R': fprintf(stderr, "\nwarning, detected non-ANSI time format specifier '%%R'"); + run = "H:%M"; break; diff --git a/master/makefile.def.patch b/master/makefile.def.patch new file mode 100644 index 0000000..94e6422 --- /dev/null +++ b/master/makefile.def.patch @@ -0,0 +1,33 @@ +diff --git a/Makefile.def b/Makefile.def +new file mode 100644 +index 0000000..e886530 +--- /dev/null ++++ b/Makefile.def +@@ -0,0 +1,27 @@ ++# ------------------------------------------------------------------------- ++# choose your compiler (must be ANSI-compliant!) and linker command, plus ++# any additionally needed flags ++ ++CC = gcc ++LD = gcc ++CFLAGS = ++LDFLAGS = ++# ^^^^^ ++# ||||| ++# adapt this to your target cpu (386/486 or higher) ++# ------------------------------------------------------------------------- ++# directories where binaries, includes, and manpages should go during ++# installation ++ ++BINDIR = /usr/local/bin ++INCDIR = /usr/local/include/asl ++MANDIR = /usr/local/man ++LIBDIR = /usr/local/lib/asl ++DOCDIR = /usr/local/doc/asl ++ ++# ------------------------------------------------------------------------- ++# character encoding to use (choose one of them) ++ ++CHARSET = CHARSET_ISO8859_1 ++# CHARSET = CHARSET_ASCII7 ++# CHARSET = CHARSET_IBM437 diff --git a/master/series b/master/series new file mode 100644 index 0000000..c117113 --- /dev/null +++ b/master/series @@ -0,0 +1,6 @@ +makefile.def.patch +x86_64-support.patch +fix-nls.patch +set-default-org-for-timex.patch +timex-pseudo-instructions.patch +endstop diff --git a/master/set-default-org-for-timex.patch b/master/set-default-org-for-timex.patch new file mode 100644 index 0000000..14abe6e --- /dev/null +++ b/master/set-default-org-for-timex.patch @@ -0,0 +1,40 @@ +diff --git a/code6805.c b/code6805.c +index 1da6c30..0a087af 100644 +--- a/code6805.c ++++ b/code6805.c +@@ -77,7 +77,7 @@ typedef struct + static ShortInt AdrMode,OpSize; + static Byte AdrVals[2]; + +-static CPUVar CPU6805,CPU6808; ++static CPUVar CPU6805,CPU6808,DATALINK; + + static BaseOrder *FixedOrders; + static BaseOrder *RelOrders; +@@ -779,8 +779,26 @@ BEGIN + SwitchFrom=SwitchFrom_6805; InitFields(); + END + ++ static void SwitchTo_DataLink(void) ++BEGIN ++ TurnWords=False; ConstMode=ConstModeMoto; SetIsOccupied=False; ++ ++ PCSymbol="*"; HeaderID=0x62; NOPCode=0x9d; ++ DivideChars=","; HasAttrs=False; ++ ++ ValidSegs=(1<<SegCode); ++ Grans[SegCode]=1; ListGrans[SegCode]=1; SegInits[SegCode]=0; ++ SegLimits[SegCode] = 0x1fff; ++ ++ MakeCode=MakeCode_6805; IsDef=IsDef_6805; ++ SwitchFrom=SwitchFrom_6805; InitFields(); ++ ++ PCs[SegCode]=0x110; ++END ++ + void code6805_init(void) + BEGIN + CPU6805=AddCPU("6805",SwitchTo_6805); ++ DATALINK=AddCPU("datalink",SwitchTo_DataLink); + CPU6808=AddCPU("68HC08",SwitchTo_6805); + END diff --git a/master/timex-pseudo-instructions.patch b/master/timex-pseudo-instructions.patch new file mode 100644 index 0000000..6e5ba04 --- /dev/null +++ b/master/timex-pseudo-instructions.patch @@ -0,0 +1,404 @@ +diff --git a/code6805.c b/code6805.c +index 0a087af..54a9e92 100644 +--- a/code6805.c ++++ b/code6805.c +@@ -392,6 +392,8 @@ BEGIN + + if (DecodePseudo()) return; + ++ if (DecodeTimexPseudo(True)) return; ++ + if (DecodeMotoPseudo(True)) return; + + /* Anweisungen ohne Argument */ +diff --git a/codepseudo.c b/codepseudo.c +index 8d474de..f655f3d 100644 +--- a/codepseudo.c ++++ b/codepseudo.c +@@ -761,6 +761,373 @@ BEGIN + return LookupInstTable(InstTable,OpPart); + END + ++ ++static unsigned char timex_translate(unsigned char c) ++{ ++ switch (c) ++ { ++ case '0': ++ case '1': ++ case '2': ++ case '3': ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ case '8': ++ case '9': ++ return c-'0'; ++ case 'a': ++ case 'A': ++ case 'b': ++ case 'B': ++ case 'c': ++ case 'C': ++ case 'd': ++ case 'D': ++ case 'e': ++ case 'E': ++ case 'f': ++ case 'F': ++ case 'g': ++ case 'G': ++ case 'h': ++ case 'H': ++ case 'i': ++ case 'I': ++ case 'j': ++ case 'J': ++ case 'k': ++ case 'K': ++ case 'l': ++ case 'L': ++ case 'm': ++ case 'M': ++ case 'n': ++ case 'N': ++ case 'o': ++ case 'O': ++ case 'p': ++ case 'P': ++ case 'q': ++ case 'Q': ++ case 'r': ++ case 'R': ++ case 's': ++ case 'S': ++ case 't': ++ case 'T': ++ case 'u': ++ case 'U': ++ case 'v': ++ case 'V': ++ case 'w': ++ case 'W': ++ case 'x': ++ case 'X': ++ case 'y': ++ case 'Y': ++ case 'z': ++ case 'Z': ++ c &= ~0x20; ++ return 0xa + c - 'A'; ++ case ' ': ++ return 0x24; ++ case '!': ++ return 0x25; ++ case '"': ++ return 0x26; ++ case '#': ++ return 0x27; ++ case '>': ++ return 0x28; ++ case '%': ++ return 0x29; ++ case '&': ++ return 0x2a; ++ case '\'': ++ return 0x2b; ++ case '(': ++ return 0x2c; ++ case ')': ++ return 0x2d; ++ case '*': ++ return 0x2e; ++ case '+': ++ return 0x2f; ++ case ',': ++ return 0x30; ++ case '-': ++ return 0x31; ++ case '.': ++ return 0x32; ++ case '/': ++ return 0x33; ++ case ':': ++ return 0x34; ++ case '\\': ++ return 0x35; ++ case '=': ++ return 0x37; ++ case '?': ++ return 0x39; ++ case '_': ++ return 0x3a; ++ default: ++ WrError(1320); ++ CodeLen=0; ++ fprintf (stderr, "Cannot encode %c in 'timex' encoding\n", c); ++ } ++} ++ ++ ++static void timex_translate_buf(unsigned char *c, size_t l) ++{ ++ for (;l;c++,l--) ++ *c = timex_translate(*c); ++} ++ ++ ++ static void DecodeTIMEX(Word Index) ++BEGIN ++ int z; ++ Boolean OK; ++ TempResult t; ++ LongInt Rep,z2; ++ ++ if (ArgCnt==0) WrError(1110); ++ else ++ BEGIN ++ z=1; OK=True; ++ do ++ BEGIN ++ KillBlanks(ArgStr[z]); ++ OK=CutRep(ArgStr[z],&Rep); ++ if (OK) ++ BEGIN ++ EvalExpression(ArgStr[z],&t); ++ switch (t.Typ) ++ BEGIN ++ case TempInt: ++ if (NOT RangeCheck(t.Contents.Int,Int8)) ++ BEGIN ++ WrError(1320); OK=False; ++ END ++ else if (CodeLen+Rep>MaxCodeLen) ++ BEGIN ++ WrError(1920); OK=False; ++ END ++ else ++ BEGIN ++ memset(BAsmCode+CodeLen,t.Contents.Int,Rep); ++ timex_translate_buf(BAsmCode+CodeLen,Rep); ++ CodeLen+=Rep; ++ END ++ break; ++ case TempFloat: ++ WrError(1135); OK=False; ++ break; ++ case TempString: ++ TranslateString(t.Contents.Ascii); ++ if (CodeLen+Rep*strlen(t.Contents.Ascii)>MaxCodeLen) ++ BEGIN ++ WrError(1920); OK=False; ++ END ++ else for (z2=0; z2<Rep; z2++) ++ BEGIN ++ memcpy(BAsmCode+CodeLen,t.Contents.Ascii,strlen(t.Contents.Ascii)); ++ timex_translate_buf(BAsmCode+CodeLen,strlen(t.Contents.Ascii)); ++ CodeLen+=strlen(t.Contents.Ascii); ++ END ++ break; ++ default: ++ OK=False; ++ break; ++ END ++ END ++ z++; ++ END ++ while ((z<=ArgCnt) AND (OK)); ++ if (NOT OK) CodeLen=0; ++ END ++END ++ ++ ++static unsigned char timex6_translate(unsigned char c) ++{ ++ switch(c) { ++ case '0': ++ case '1': ++ case '2': ++ case '3': ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ case '8': ++ case '9': ++ return c - '0'; ++ ++ ++ ++ case 'a': ++ case 'A': ++ case 'b': ++ case 'B': ++ case 'c': ++ case 'C': ++ case 'd': ++ case 'D': ++ case 'e': ++ case 'E': ++ case 'f': ++ case 'F': ++ case 'g': ++ case 'G': ++ case 'h': ++ case 'H': ++ c &= ~0x20; ++ return 0xa + c - 'A'; ++ ++ case 'i': ++ case 'I': ++ case ':': ++ return 0x12; ++ case 'l': ++ case 'L': ++ case 'm': ++ case 'M': ++ case 'n': ++ case 'N': ++ c &= ~0x20; ++ return 0x13 + c - 'L'; ++ case 'o': ++ case 'O': ++ return 0x0; ++ case 'p': ++ case 'P': ++ return 0x16; ++ case 'r': ++ return 0x1c; ++ case 'R': ++ return 0x17; ++ case 's': ++ case 'S': ++ return 0x5; ++ case 't': ++ case 'T': ++ case 'u': ++ case 'U': ++ return 0x18 + c - 'T'; ++ case 'w': ++ case 'W': ++ return 0x1a; ++ case 'y': ++ case 'Y': ++ return 0x1b; ++ case ' ': ++ return 0x1d; ++ case '-': ++ return 0x1e; ++ case '+': ++ return 0x1f; ++ default: ++ WrError(1320); ++ CodeLen=0; ++ fprintf (stderr, "Cannot encode %c in 'timex6' encoding\n", c); ++ } ++} ++ ++ ++static void timex6_translate_buf(unsigned char *c, size_t l) ++{ ++ for (;l;c++,l--) ++ *c = timex6_translate(*c); ++} ++ ++ ++ static void DecodeTIMEX6(Word Index) ++BEGIN ++ int z; ++ Boolean OK; ++ TempResult t; ++ LongInt Rep,z2; ++ ++ if (ArgCnt==0) WrError(1110); ++ else ++ BEGIN ++ z=1; OK=True; ++ do ++ BEGIN ++ KillBlanks(ArgStr[z]); ++ OK=CutRep(ArgStr[z],&Rep); ++ if (OK) ++ BEGIN ++ EvalExpression(ArgStr[z],&t); ++ switch (t.Typ) ++ BEGIN ++ case TempInt: ++ if (NOT RangeCheck(t.Contents.Int,Int8)) ++ BEGIN ++ WrError(1320); OK=False; ++ END ++ else if (CodeLen+Rep>MaxCodeLen) ++ BEGIN ++ WrError(1920); OK=False; ++ END ++ else ++ BEGIN ++ memset(BAsmCode+CodeLen,t.Contents.Int,Rep); ++ timex6_translate_buf(BAsmCode+CodeLen,Rep); ++ CodeLen+=Rep; ++ END ++ break; ++ case TempFloat: ++ WrError(1135); OK=False; ++ break; ++ case TempString: ++ TranslateString(t.Contents.Ascii); ++ if (CodeLen+Rep*strlen(t.Contents.Ascii)>MaxCodeLen) ++ BEGIN ++ WrError(1920); OK=False; ++ END ++ else for (z2=0; z2<Rep; z2++) ++ BEGIN ++ memcpy(BAsmCode+CodeLen,t.Contents.Ascii,strlen(t.Contents.Ascii)); ++ timex6_translate_buf(BAsmCode+CodeLen,strlen(t.Contents.Ascii)); ++ CodeLen+=strlen(t.Contents.Ascii); ++ END ++ break; ++ default: ++ OK=False; ++ break; ++ END ++ END ++ z++; ++ END ++ while ((z<=ArgCnt) AND (OK)); ++ if (NOT OK) CodeLen=0; ++ END ++END ++ ++ ++ Boolean DecodeTimexPseudo(Boolean Turn) ++BEGIN ++ static PInstTable InstTable=Nil; ++ ++ if (InstTable==Nil) ++ BEGIN ++ InstTable=CreateInstTable(17); ++ AddInstTable(InstTable,"DB",0,DecodeBYT); ++ AddInstTable(InstTable,"TIMEX",0,DecodeTIMEX); ++ AddInstTable(InstTable,"TIMEX6",0,DecodeTIMEX6); ++ END ++ ++ M16Turn=Turn; ++ return LookupInstTable(InstTable,OpPart); ++END ++ ++ + static void DigIns(char Ch, Byte Pos, Word *w) + BEGIN + Byte wpos=Pos>>2,bpos=(Pos&3)*4; +diff --git a/codepseudo.h b/codepseudo.h +index 0ffbfe8..fc164a7 100644 +--- a/codepseudo.h ++++ b/codepseudo.h +@@ -24,6 +24,8 @@ extern void ConvertDec(Double F, Word *w); + + extern Boolean DecodeIntelPseudo(Boolean Turn); + ++extern Boolean DecodeTimexPseudo(Boolean Turn); ++ + extern Boolean DecodeMotoPseudo(Boolean Turn); + + extern void AddMoto16PseudoONOFF(void); diff --git a/master/x86_64-support.patch b/master/x86_64-support.patch new file mode 100644 index 0000000..f4fc9c5 --- /dev/null +++ b/master/x86_64-support.patch @@ -0,0 +1,37 @@ +diff --git a/sysdefs.h b/sysdefs.h +index d145cd5..31b08b1 100644 +--- a/sysdefs.h ++++ b/sysdefs.h +@@ -526,6 +526,32 @@ typedef unsigned long Card64; + + #endif /* __alpha */ + ++ ++#ifdef __x86_64 ++#define ARCHPRNAME "x86_64" ++ ++#ifdef __linux__ ++#define ARCHSYSNAME "unknown-linux" ++#define DEFSMADE ++#define OPENRDMODE "r" ++#define OPENWRMODE "w" ++#define OPENUPMODE "r+" ++#define IEEEFLOAT ++typedef signed char Integ8; ++typedef unsigned char Card8; ++typedef signed short Integ16; ++typedef unsigned short Card16; ++#define HAS16 ++typedef signed int Integ32; ++typedef unsigned int Card32; ++typedef signed long Integ64; ++typedef unsigned long Card64; ++#define HAS64 ++#define LOCALE_NLS ++#endif ++ ++#endif /* __x86_64 */ ++ + /*===========================================================================*/ + /* Intel i386 platforms */ + |