182 Commits

Author SHA1 Message Date
Serge Vakulenko
f39a1429bf Merge pull request #21 from RetroBSD/cc-use-smallerc
/bin/cc command modified to use SmallerC compiler by default (not LCC).
2014-05-05 11:16:06 -07:00
Alexey Frunze
06d027b4c5 Merge remote-tracking branch 'upstream/master' 2014-05-04 01:23:36 -07:00
Sergey
6f47acb2ae Fixed bug in assembler, introduced by previos patch.
(Negative offsets in LW/SW not recognized)
Also, modified stdlib.h for compatibility with SmallerC.
2014-05-03 23:56:57 -07:00
Alexey Frunze
a2bc88bdb6 fixes, improvements, __interrupt
Fixes/workarounds:
- octal escape sequence is to be terminated no later than after three
octal digits:
"\1011" is now parsed equivalently to "A1"
- workaround truncation of immediate operands to 16 bits in MIPS
instructions addi[u], subi[u], slti[u], andi, ori, xori in RetroBSD's as
(disabled since as is being fixed).

Improvements:
- warn on string literal truncation when initializing array of char
- generate trap/break-less form of MIPS div[u]

New:
- experimental support for __interrupt functions (x86/huge only)
2014-05-03 18:55:18 -07:00
Sergey
e0ba612250 Range check fixed in assembler. 2014-05-03 17:33:56 -07:00
Sergey
babef284ae Assembler: mode ".set at" required to enable wide immediates in 2-red macros. 2014-05-03 16:55:40 -07:00
Sergey
51a8fd3313 Assembler: added support for large constants for 2-reg variants (macros)
of 3-reg instructions (add, addu, and, or, slt, sltu, sub, subu, xor).
When mode ".set at" enabled, an additional LI instruction is inserted
sing $1 as a scratch register.
2014-05-03 16:34:19 -07:00
Sergey
f67b9db8b5 Merge branch 'master' into cc-use-smallerc 2014-05-03 01:31:06 -07:00
Sergey
777ad1471b Smlrc: option -v moved to target-dependent part.
Fixed bug in simulator: read from incorrect file descriptor when
the second SD card not configured.
2014-05-03 01:28:48 -07:00
Sergey
aff46df8dd Merge branch 'master' into cc-use-smallerc. 2014-05-03 00:37:37 -07:00
Serge Vakulenko
6f15f0ba23 Merge branch 'exec-elf' of https://github.com/RetroBSD/retrobsd 2014-05-02 22:04:16 -07:00
Serge Vakulenko
6f8e71c1b8 Include files modified for compatibility with SmallerC.
Fixed bug in C preprocessor: buffer size reduced to avoid allocation failure.
Added option -v for smlrc.
New example stdarg.c: a demo of function with variable arguments.
2014-05-02 22:00:30 -07:00
Serge Vakulenko
f105cb5bbd /bin/cc command modified to use SmallerC compiler by default (not LCC).
For LCC, please use /bin/lcc instead.

I believe SmallerC is mature enough to try to use it as a primary compiler.
System include files might need some changes (ifdefs) to adapt.
2014-05-01 10:41:41 -07:00
Alexey Frunze
b652f52cb6 Smaller C: Improve pointer initialization
The following global/static pointer initialization should now work:

static char* p1 = "abc" + 1;
static char* p2 = "abc" - 1;
static char* p3 = 1 + "abc";
static int a333[3][3][3];
static int* pa333_111 = &a333[1][1][1];

Other seemingly (and in fact actually) functionality preserving changes
are only to reduce code size when self compiling for DOS using -seg16.
Improvements and fixes require space, sigh.
2014-04-26 15:53:41 -07:00
Serge Vakulenko
b98de3368e *.mk configuration files modified for compatibility with latest version
of Mentor Sourcery CodeBench Lite toolchain
(https://sourcery.mentor.com/GNUToolchain/release2641).
All detected issues fixed.
2014-04-24 21:06:37 -07:00
Serge Vakulenko
1b15bcff49 Fixed bug in assembler: incorrect offset in LUI instruction. 2014-04-24 11:56:01 -07:00
Serge Vakulenko
3a38f291a7 Merged kernel support for ELF executable format from karolina.lindqvist.
Now kernel can directly run executables generated by gcc.
2014-04-23 21:43:09 -07:00
Serge Vakulenko
3942e87cd1 Compiled atc game. Fixed include file for curses library. 2014-04-23 20:02:02 -07:00
Alexey Frunze
bc98f62608 Fix a benign typo 2014-04-22 02:57:42 -07:00
Alexey Frunze
fd04710c23 Fix initialization
In the following
typedef struct S0 { char ac[4]; } T1;
int v26 = (int)&((T1*)0)->ac[3];
int v27 = &((T1*)0)->ac[3];
v27 should be initialized to 3 just as v26.
2014-04-21 01:08:49 -07:00
Alexey Frunze
a0a4e242e6 Improve variable initialization in Smaller C
Improvements:
- support initialization of multidimensional arrays
- support initialization of structures
- support initialization of structures and arrays inside functions
- support static inside functions

Notes:
- Only fully-bracketed (sic) initialization of arrays is supported.
- && and || have been partially replaced with & and | to slightly reduce
code size when self compiling for DOS using -seg16.
2014-04-20 20:59:47 -07:00
Matt Jenkins
a7d0838ea8 Created global version variable 2014-04-20 20:24:18 +01:00
Matt Jenkins
b5a8255248 Changed %2 to %s in string format 2014-04-19 13:37:42 +01:00
Matt Jenkins
22c2f77d84 Added "create" flag to AR commands 2014-04-19 11:46:17 +01:00
Matt Jenkins
ad74c37318 Disabled verbose execution 2014-04-19 11:39:55 +01:00
Matt Jenkins
7205bb7ef2 Switched from mktemp to mkstemp 2014-04-19 11:36:18 +01:00
Sergey
d404fca13a Fixed bug in assembler: incorrect offset of far symbols in LUI instruction.
Added .gitignore files for most subdirs.
2014-04-18 01:12:49 -07:00
Matt Jenkins
4a83f1ab98 Merge branch 'master' of https://github.com/igor-m/retrobsd-1 2014-04-11 11:57:30 +01:00
igor-m
f3d7970ac1 Mods to ZMODEM, rz works a little bit smoother now 2014-04-11 11:55:28 +02:00
Alexey Frunze
75eebef473 Fix compilation warnings/errors in smux, tip, virus
Fix compilation warnings/errors primarily due to unused variables.
2014-04-11 01:26:45 -07:00
Matt Jenkins
0c86462977 Fixed for git repo compilation 2014-04-09 15:07:21 +01:00
Matt Jenkins
895f96d2f7 Initial Import from SVN 2014-04-09 14:27:18 +01:00