1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-17 09:29:10 +00:00
Commit Graph

2045 Commits

Author SHA1 Message Date
uz
23c96f81c0 Some small format changes. Output name is input name + '.tch'.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4413 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-01 21:33:28 +00:00
uz
784c709f97 Wrote the actual conversion. Still untested.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4411 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-31 15:42:59 +00:00
uz
b8b3dcce74 Fixed a problem introduced with the last change.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4410 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-31 14:01:22 +00:00
uz
00a1121d8c Fixed a problem with OptJumpTarget3. In a loop over all elements of a
collection that may remove something from the collection, we may not use an
upcounting loop.
                


git-svn-id: svn://svn.cc65.org/cc65/trunk@4409 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-31 10:36:59 +00:00
uz
b86682d29d File reading, verification and comments.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4408 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-30 22:34:08 +00:00
uz
e60544452e Added the chrcvt vector font converter to the top level makefile.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4406 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-30 21:35:25 +00:00
uz
3a9d29d5e2 Created the skeleton of the vector font converter.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4405 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-30 21:34:40 +00:00
uz
07e629a342 Allow fully scoped labels and constants instead of normal ones. This breaks
the barrier between scopes: It is now possible to introduce symbols into a
foreign scope, provided that it's name is known.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4397 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-29 20:30:41 +00:00
uz
c437afd62b Added another optimization step.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4391 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-26 10:17:53 +00:00
uz
7687489a08 Fixed a bug in the last change. For variables that have no initializer, no
storage was allocated if -Cl (static locals) was in effect.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4390 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-26 10:17:17 +00:00
uz
f4b4a812ed Removed an unused table.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4389 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-24 19:37:57 +00:00
uz
bd45df7cad Rearranged/duplicated optimization steps to generate better code in a few
cases.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4387 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-23 10:03:46 +00:00
uz
814be2524b Restructured parts of locals.c. This will also fix a problem where arrays with
unspecified size but an initializer would cause an error when -Cl (static
locals) was in effect.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4385 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-23 09:22:17 +00:00
uz
96b46beee0 Fixed a problem with bit-fields: Values spanning more than a byte must always
be loaded as an int. This was not the case if the expression rhs was a char.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4382 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-20 08:21:12 +00:00
uz
4372d111a2 The CodeEntry buffer array was one entry to small.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4381 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 19:37:28 +00:00
uz
3b079c0947 Added another optimization step.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4380 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 19:12:50 +00:00
uz
f4acd3eb4f Added a makefile for cc65 for testing purposes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4379 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 18:02:40 +00:00
uz
388ccf4c4b Added missing definitions, fixed copy&paste errors. Formatting.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4378 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 18:00:25 +00:00
uz
1ccb6f916d Remove __CC65__ since it doesn't support all attributes gcc does.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4377 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 17:55:49 +00:00
uz
399c37273d Mark an unsed parameter as unused. __attribute__ also supported by cc65.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4376 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 17:25:43 +00:00
uz
548336a7bd Renamed attribute handling functions. Added SymHasAttr().
git-svn-id: svn://svn.cc65.org/cc65/trunk@4375 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-19 10:19:26 +00:00
uz
a5a9700d19 Changed handling of attributes to a more generic form (it's allowed in each
declaration now) and added a new attribute "unused" to flag unused parameters,
variables or functions that shouldn't be warned about.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4373 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-18 21:42:59 +00:00
uz
5a00b38aab Fixed the existing but unused attribute parsing code. Added
__attribute__((noexit)) that may be used to mark functions that won't return.
Added this attribute to the exit() function in stdlib.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4372 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-18 18:31:02 +00:00
uz
0ce362a69b Some cleanup in the code generator. Added a g_drop function. g_drop and
g_space can now handle sizes > 255 bytes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4370 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-15 21:08:03 +00:00
uz
1f92d6bfa2 Warn when structs are passed by value to a function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4369 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-15 19:18:34 +00:00
uz
1f489fd9e1 Extend handling for "long branch to RTS" to "long branch to jump leaving
function".


git-svn-id: svn://svn.cc65.org/cc65/trunk@4368 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-15 11:11:20 +00:00
uz
635fae97fb If a conditional branch as an unconditional jump as target, that doesn't jump
to a function-internal label, don't replace the jump target with the final
one, because this has no advantages and makes the code larger.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4367 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-15 10:21:50 +00:00
uz
d9753c2eb7 Allow switching warnings about unused pragmas on or off.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4366 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-14 13:04:38 +00:00
uz
62fdd55fee Fixed a problem with SB_GetSym.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4365 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-14 13:03:47 +00:00
uz
ed2767e65f Changed names of the pragmas to be identical to the corresponding command line
options. This should make use easier. The old names of the pragmas are still
available but will cause warnings.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4364 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-14 12:55:15 +00:00
uz
869a1369c4 Fixed an error in the SB_SkipMultiple macro.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4363 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-14 10:04:20 +00:00
uz
a1fb355a9a Rewrote most of the #pragma parsing code. I'm still not satisfied, but at
least, it's a bit better than before. #pragma warn (...) is now used to switch
single warnings instead of a global on/off switch.



git-svn-id: svn://svn.cc65.org/cc65/trunk@4362 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-13 21:24:32 +00:00
uz
583b9f8fcc Removed an unused function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4361 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-11 15:10:55 +00:00
uz
e623c87d63 New function SB_SkipMultiple().
git-svn-id: svn://svn.cc65.org/cc65/trunk@4358 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-10 20:51:52 +00:00
uz
f2d1ea10d9 Added a simulated console (memory mapped screen device, inpout device will
follow).


git-svn-id: svn://svn.cc65.org/cc65/trunk@4351 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 18:33:50 +00:00
uz
1122ddb05a Fixed a bug: Attribute numbers were not correctly read.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4350 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 17:54:23 +00:00
uz
07c25db768 Added the __STDC_HOSTED__ macro.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4349 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 15:00:25 +00:00
uz
b55419af59 Rewrote handling of the -W command line option. It is now used to enable or
disable warnings by name.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4348 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 13:29:35 +00:00
uz
58e8826da2 Fixed some sloopy StrBuf coding.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4347 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 12:11:51 +00:00
uz
b19a29f80b Use the new InvArg function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4346 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 11:35:34 +00:00
uz
45b469c786 Use the new InvArg() function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4345 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 11:34:36 +00:00
uz
b7c8c651f6 New function InvArg().
git-svn-id: svn://svn.cc65.org/cc65/trunk@4344 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 11:31:55 +00:00
uz
9971b645a5 Fixed some sloopy StrBuf coding.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4343 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 10:51:45 +00:00
uz
4b4a9b444b Make AUTO_STRBUF_INITIALIZER identical to STATIC_STRBUF_INITIALIZER.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4342 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 10:50:15 +00:00
uz
17d592352c Fixed an error with r4329: In case of a struct pointer the qualifiers of the
pointers had been used, not the qualifiers of the struct.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4340 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-08 09:54:46 +00:00
uz
b208b7e3b1 Merge calls to decsp. The implemented routine is not perfect and will miss
some pieces of code, but it's better than nothing.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4339 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-07 15:28:35 +00:00
uz
2ae20c3b61 Get rid of ldaconst/ldxconst/ldyconst in many places.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4338 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-07 15:27:26 +00:00
uz
3be976189b Bumped the version number
git-svn-id: svn://svn.cc65.org/cc65/trunk@4336 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-06 12:24:15 +00:00
uz
9c5224165f Fixed a bug: A similar problem as that with structs does also exist for
arrays. An array element has all qualifiers from itself and from the array
declaration.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4334 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-05 18:46:39 +00:00
uz
8dd3cc35dc When using GetQualifier, pass correct params :-)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4333 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-05 18:38:01 +00:00
uz
ea582a9d74 Use GetQualifier() instead of accessing the field directly.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4332 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-05 18:37:07 +00:00
uz
7992bfb74a Changed solution for r4329 so that it uses less memory.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4331 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-05 18:22:28 +00:00
uz
c69e2d9f0f Fixed a bug: Function designators are converted to rvalues of type "pointer to
function", so dereferencing a function is a legal operation. The result is
immediately converted back to "pointer to function" again. Note: Because of
performance considerations, cc65 does treat functions as "pointer to function"
internally, but nevertheless dereferencing a function must be possible.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4330 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-05 17:49:45 +00:00
uz
43c89d5fd0 Fixed a bug: A struct field has all qualifiers from its definition plus the
qualifiers of the struct.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4329 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-05 17:37:45 +00:00
uz
8348f62114 Must link libdl to use dynamic libraries.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4328 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-04 18:52:27 +00:00
uz
8b7c9fdc4f Added decimal mode (untested): http://www.6502.org/tutorials/decimal_mode.html
git-svn-id: svn://svn.cc65.org/cc65/trunk@4327 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-04 18:52:10 +00:00
uz
1efebb9024 Add .assert actions that aren't evaluated at assembly time.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4321 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-04 12:40:19 +00:00
uz
b75bdc65d3 Fixed problems that were introduced with r4287.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4298 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-01 21:53:55 +00:00
uz
8e35f0d9c8 The combined assignment operator (-=, +=, ...) did not check that the rhs is
actually an integer.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4297 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-01 19:41:40 +00:00
ol.sc
ba46bab009 Made stacksize user-adjustable on the cmdline.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4293 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-01 17:00:10 +00:00
uz
911355178d Added an additional precondition before replacing code in OptPushPop. Fixed a
few places where new code was inserted after existing code instead the other
way round.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4287 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-01 14:39:26 +00:00
uz
d42ce3b59e Lynx updates by Karri Kaksonen.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4285 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-01 14:09:19 +00:00
uz
9ba5252a01 Another small change in OptJumpTarget3.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4281 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-30 14:52:46 +00:00
uz
a532a52113 Added an additional precondition check to OptJumpTarget3.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4280 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-30 14:10:13 +00:00
uz
c2b03e0208 New optimization step
git-svn-id: svn://svn.cc65.org/cc65/trunk@4278 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-29 18:46:25 +00:00
uz
0b4c486a49 Replace tabs by spaces in file lists.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4275 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-29 13:32:09 +00:00
uz
3d1ee0f974 Fixes for the watcom makefiles:
* Increase the stack size to 64K (instead of 4096). This solves a
    memory overwrite problem with the DOS version.
  * Generate a mapfile, but set it to "ignored" in svn.
  * Be somewhat more specific in zap.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4273 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-29 13:08:23 +00:00
uz
4056e97587 Use "override" when appending to CFLAGS, so this works even when CFLAGS is
specified on the command line.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4271 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-29 13:06:35 +00:00
uz
16f05a78c2 Create the .inc files before creating the dependency file, so we avoid
problems with files that weren't found.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4269 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-29 11:59:10 +00:00
uz
7b847321a8 Move the version numbers from the interface of the version module into a new
implementation. Allow for release candidates to be specified and disinguished.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4260 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-28 20:10:01 +00:00
uz
85f96a7d6f Fixed warnings generated by clang (run by Per Olofsson).
git-svn-id: svn://svn.cc65.org/cc65/trunk@4255 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-28 15:59:18 +00:00
uz
4e1faa0b01 Makefile simplification by Greg King
git-svn-id: svn://svn.cc65.org/cc65/trunk@4253 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-28 15:30:10 +00:00
uz
2cc68784cc Make the watcom makefiles a bit more openwatcom compatible.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4248 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-27 18:40:00 +00:00
uz
93d161f877 Cast the (unused) result of CHECK and PRECONDITION to void to (hopefully) get
rid of a clang warning.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4238 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-26 18:55:00 +00:00
uz
e80cb24164 Comment out the RegVal function using #if to get rid of the compiler warning
about an unused function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4237 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-26 18:54:00 +00:00
uz
a16dcb549f Separate the linker config for the apple2enh target from the ones for the
apple2.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4235 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-26 16:12:02 +00:00
uz
7867bf2921 Fixed the config for the CBM510. Because of changes in the startup code, it
didn't work any longer.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4226 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-24 20:42:55 +00:00
uz
31f6f814af Since we have now builtin search paths, we need to be able to forget them,
otherwise we cannot build libraries with a customized version.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4222 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-24 17:24:52 +00:00
uz
b8e665e837 Change the makefiles so that CFLAGS that are special for the application are
appended after assigning the base value to CFLAGS. This allows to change
CFLAGS on the command line without too much hassle.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4219 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-24 15:07:11 +00:00
uz
c4d83d4cbf Use xmalloc.h and change the code slightly to get rid of two gcc warnings.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4218 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-24 15:05:48 +00:00
uz
6da6da78ae Added search paths similar to that of the linker and compiler.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4217 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-24 14:49:52 +00:00
uz
cb688729af Changed search paths to use subdirectories of CC65_HOME, remove CC65_LIB.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4209 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-22 11:49:53 +00:00
uz
a9e46e245a New function AddSubSearchPathFromEnv.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4208 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-22 11:29:13 +00:00
uz
feb212df62 New linker config for the VIC-20 with 32K cartridge by Stefan Haubenthal.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4205 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-22 09:33:49 +00:00
uz
20eb942ab9 Oliver added a comment to the Apple2 linker config.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4197 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-20 13:14:29 +00:00
uz
9d00253227 Additional linker configs for the Apple by Oliver Schmidt.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4195 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-19 16:14:46 +00:00
uz
08f176c5aa Removed the - now unused - empty builtin configuration (was used for the ace
target before).


git-svn-id: svn://svn.cc65.org/cc65/trunk@4194 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-18 19:13:59 +00:00
uz
9a4ec37b40 Change search paths for the linker.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4193 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-18 19:00:24 +00:00
uz
050c56211a Renamed some additional (not builtin) linker configs.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4188 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-18 17:06:26 +00:00
uz
dca7cfd249 Removed the (unused and probably non-working) config for OS/A65.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4187 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-18 17:04:20 +00:00
uz
b5db4cd5fa Added wide char literals, but treat them identical as normal strings.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4185 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-18 14:28:52 +00:00
uz
52a368adc1 Improved the code that checks for memory accesses. The old code didn't detect
certain accesses.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4174 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-14 22:02:48 +00:00
uz
29cea09e0d Removed debug output
git-svn-id: svn://svn.cc65.org/cc65/trunk@4171 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-14 19:56:47 +00:00
uz
d451248437 Fixed another problem with OptJumpTarget1, that was mostly prevented from
being triggered by other optimizations, which removed or changed the trigger
code.



git-svn-id: svn://svn.cc65.org/cc65/trunk@4170 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-14 19:54:50 +00:00
uz
254e1169f2 Fixed a problem with OptJumpTarget1: The inspected jump must not have a label
attached, because the effective code changes for code jumping to this label if
removals are applied.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4169 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-14 18:36:38 +00:00
uz
32e2eb3fad Fixed parsing a labeled-statement: A label is always part of a statement, it
is not itself one.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4166 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-13 14:36:16 +00:00
uz
e035323ab4 Added another condition that allows us to remove pha/pla.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4163 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-13 13:22:27 +00:00
uz
785d8ebb43 Removed the ace target. It didn't have a linker config and was untested for
~10 years


git-svn-id: svn://svn.cc65.org/cc65/trunk@4162 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-13 11:46:04 +00:00
uz
df22cbf925 Search config files also in the builtin search directory for libraries and in
the directory defined in the CC65_LIB environment variable.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4158 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-12 20:12:48 +00:00
uz
fa3a7930d7 Fixed a problem with load tracking in OptStackOps.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4147 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-11 16:36:17 +00:00
uz
079358c3c1 Fixed an error in OptPtrLoad16.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4139 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 21:10:19 +00:00
uz
e68332a10b Fixed several more problems like the one in Assignment() some time ago: An
expression that yields a constant value may have side effects, and the
expression code must not be removed in this case.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4138 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 20:29:12 +00:00
uz
2d3b0f1146 Fixed a problem similar to the one in Assignment() some time ago: An
expression that yields a constant value may have side effects, and the
expression code must not be removed in this case.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4137 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 20:08:21 +00:00
uz
84e288f21c Use the new function MarkedExprWithCheck.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4136 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 19:49:30 +00:00
uz
0c20177fce Allow to store start and end of generated code in the ExprDesc structure. New
function MarkedExprWithCheck.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4135 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 19:48:22 +00:00
uz
331803126f Fixed flexible array struct members.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4131 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-08 07:55:44 +00:00
uz
9f7ca16001 Added initialization of bit-fields.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4130 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-07 16:59:46 +00:00
uz
f5ca779b9b A constant right side does not necessarily mean that no code is generated for
the right side. The expression may have had side effects. This error is also
found in several other places.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4129 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-07 14:22:27 +00:00
uz
b2d30c3283 Remove stack pointer check in RemoveCodeRange - the calling function has to
take care about that.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4128 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-07 14:21:19 +00:00
uz
90c731d1e9 Changed a comment line.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4125 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-06 21:39:28 +00:00
uz
f50520dffe Use xsprintf instead of sprintf.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4124 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-06 19:07:18 +00:00
uz
94a2223443 Use SymIsTypeDef and SymIsBitField instead of accessing Sym->Flags directly.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4123 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-06 16:51:08 +00:00
uz
cc229ce7ba New function SymIsBitField.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4122 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-06 16:50:41 +00:00
uz
2402ef005e Fixed an error: When initializing unions, only the first member can be
initialized.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4121 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-06 16:44:16 +00:00
uz
38ff6818fc Fixed wrong code generation in g_leasp.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4118 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-04 20:57:23 +00:00
uz
fa2064ae3b Fix problem with OptPtrLoad1 - never insert before the deleted code, always
delete after! Otherwise labels will get wrong.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4117 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-04 20:16:18 +00:00
uz
18d865e609 Fixed another problem with OptStackOps: Load tracking will not work across
branches - if we find a label, just forget all information we had before.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4116 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-04 19:54:29 +00:00
uz
f6c589bf8e Fixed problems with OptPrecalc. It removed insns because it results were known
- but the insns generate a carry which may be needed later.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4115 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-04 15:44:48 +00:00
uz
67d64e67d5 Fixed a typo in a comment.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4114 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-04 15:42:36 +00:00
uz
e1832b2e57 Replace "lda (zp),y" by "lda (zp,x)" where possible and where it saves us
cycles and code bytes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4113 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-03 12:13:08 +00:00
uz
d85e6f9124 Replacement code for ule and ugt was wrong and did not cover values that were
equal.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4112 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-03 11:58:11 +00:00
uz
7cd92c82fa Added code replacements for several missing compare functions. Fixed a bug in
coptstop.c that popped up if transfer instructions were used to load a value
into X.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4111 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-01 20:57:39 +00:00
uz
7c613f7a83 Terminate after printing the version number when -V is used.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4110 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-01 14:41:37 +00:00
uz
e9eb9eb77c Improved code generation, better tracking.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4108 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-01 10:07:02 +00:00
uz
cdc3afa6ef Fixed a problem with OptCmp3 that was in there for a while but is now
triggered because of the new subtraction code sequence.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4107 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-01 10:06:39 +00:00
uz
7c4240fe69 Minor code improvement.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4106 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-01 09:15:19 +00:00
uz
944057238e Simplify code generated for the ?: operator when type conversion code for the
second operand is necessary. Instead of generating interleaved code with
several jumps, just move the code to the right place.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4105 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-01 08:57:36 +00:00
uz
84710f7227 Remember more function infos in the Function struct.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4104 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 20:37:54 +00:00
uz
0c08f65872 Fixed a bug in Opt_tosaddax.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4103 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 19:36:06 +00:00
uz
c942568af9 Simplify the code somewhat.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4102 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 18:18:50 +00:00
uz
30f25ae12d Make the AddOpLow and AddOpHigh functions usable with both, lhs and rhs
operands.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4101 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 18:02:44 +00:00
uz
b829bda8cb Print the SVN version number when -V or --version is used.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4100 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 17:17:18 +00:00
uz
b3f3b21f80 Fixed a few C99isms that prevented the sources to compile with Watcom-C.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4099 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 17:15:59 +00:00
uz
514775cbdf Fixed a copy&paste error in a comment.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4098 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 16:48:45 +00:00
uz
7983009e06 Improved code for bit fields.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4097 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 15:11:32 +00:00
uz
dc678e8dcb Improved the code generated for bit-fields.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4096 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 14:59:49 +00:00
uz
0a9c7484ad Add a warning if a function returning something does not contain a return
statement.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4095 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 13:18:49 +00:00
uz
7064aafab9 Added info about changed leaa0sp and leaaxsp. Rewrote g_leasp to cope with 16
stack offsets, because it's rather easy in this case.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4093 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-31 12:41:38 +00:00
uz
45d4771584 For bit fields contained within single bytes, try to do character operations
instead of word sized ops.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4089 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-30 09:01:04 +00:00
uz
0b0353de13 Use CHAR_BITS instead of a hardcoded 8 bits/byte.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4088 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-30 08:37:21 +00:00
uz
03e206a44f Make the SIZEOF_XXX constants resolve to unsigned values.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4087 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-30 08:36:56 +00:00
uz
2ddeb069eb Any field without a name is legal but useless in a union.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4086 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-30 08:30:55 +00:00
uz
a09c71b3ff Separate the functions that parse unions and structs, because they became too
different.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4085 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-30 08:28:16 +00:00
uz
8d5999c3a4 Added even more subroutines to the "harmless calls" list.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4083 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 23:19:01 +00:00
uz
b098d8045e Code improvements
git-svn-id: svn://svn.cc65.org/cc65/trunk@4081 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 21:58:06 +00:00
uz
6b4fe90928 First implementation of bit fields.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4079 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 21:20:13 +00:00
uz
7c6ee79ea9 Added more harmless functions to the list, so the stuff gets applied in more
cases.
      


git-svn-id: svn://svn.cc65.org/cc65/trunk@4078 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 21:17:28 +00:00
uz
b0a89ff421 Improved code for shifts.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4077 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 20:16:52 +00:00
uz
b4855e017b The shift long by 4 functions do also destroy Y.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4076 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 20:14:20 +00:00
uz
ddeb171617 Info for long shift functions was missing or wrong.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4075 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 20:04:18 +00:00
uz
d0c4f85e51 Fix wrong check for typedef which caused non allocation of storage for structs
after the latest changes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4074 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 19:05:01 +00:00
uz
7ced0a2ceb Rename Width to BitWidth.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4073 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 19:04:21 +00:00
uz
bd872a6324 Added code to parse bit fields and enter them into the symbol table. They're
not supported in code generation until now.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4072 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 17:38:53 +00:00
uz
82919fa2f8 Another tiny code improvement for integer compares.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4071 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 11:31:28 +00:00
uz
c741f06ac1 Fixed a problem with local variables (stack offset for RHS was not corrected).
git-svn-id: svn://svn.cc65.org/cc65/trunk@4070 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 11:31:06 +00:00
uz
53372ae1c1 Just comment and formatting changes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4069 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-29 10:54:59 +00:00
uz
5918306fe2 Change mode constants for ParseDecl to an enum.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4068 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 21:34:28 +00:00
uz
73e2a72a2a Reorder optimimization steps to get better results.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4067 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 21:03:17 +00:00
uz
a9f540fb27 Added more code to improve compares.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4066 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 19:34:35 +00:00
uz
cd568ef898 Fixed a bug introduced by recent changes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4065 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 17:38:24 +00:00
uz
f66cd4a13f Changed code generated for compares. Fixed bugs in OptStackOps. Still
generates wrong code in at least one place.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4063 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 16:32:58 +00:00
uz
1b2e0f66cc Change code generated for compares for special cases.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4062 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 13:44:03 +00:00
uz
7f143d77d1 Added -u as an alias for --force-import. Updated command line option infos in
the cl65 and ld65 docs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4061 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 10:23:19 +00:00
uz
e0643a9f77 Relax the precondition for OPtStackOps somewhat.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4060 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-28 09:29:11 +00:00
uz
c214fa6395 When preprocessing, all compares evaluate to constants, so don't print a
warning in this case.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4059 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 22:09:46 +00:00
uz
08d6d96264 Added better code to replace tossubax.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4058 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 22:07:28 +00:00
uz
d65928829f Added a warning if the result of a compare operation is constant. This should
protect against missing parenthesis like in (si & 0x7F == 0). Hopefully
without too many false positives.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4057 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 22:00:18 +00:00
uz
55e8f67640 Try to generate more predicable code. clc always before adc or sbc.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4056 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 16:59:26 +00:00
uz
1b4e2111c3 Check for usage of Y instead of reloading it. The latter will destroy the
flags from load of A.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4055 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 16:38:27 +00:00
uz
7c55f30627 Fixed a problem with OptPtrLoad6 (must correct stack pointer).
git-svn-id: svn://svn.cc65.org/cc65/trunk@4054 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 16:13:17 +00:00
uz
1b40f00573 Added the --force-import option also to the cl65 utility.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4053 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 15:30:52 +00:00
uz
ee6028993e Added a new "--force-import" command line option to the linker.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4052 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 14:43:44 +00:00
uz
2b15f40424 Use the new AddrSizeFromStr function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4051 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 14:19:47 +00:00
uz
6f39a15eff Added an AddrSizeFromStr function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4050 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 14:11:07 +00:00
uz
8fa42540c1 Disable handling of tossubax since it won't work as implemented in many cases.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4047 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-20 21:01:01 +00:00
uz
f63964e23c Added several constraints to the optimizer functions to avoid breaking code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4046 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-20 16:06:20 +00:00
uz
4a93f188a0 Fixed a bug reported by Greg King: Initialized data for constant arrays was
not placed in the RODATA but in the DATA segment.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4044 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-20 10:55:38 +00:00
uz
b9c0d6ac85 Also handle ldaxysp as a valid load insn before a push.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4042 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-19 13:36:26 +00:00
uz
8a0d80bbf0 Inline the left shift routines.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4041 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-19 13:20:28 +00:00
uz
57ef34f041 Apply OptTransfers3 again in a later step, so it gets another chance.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4040 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-19 12:47:30 +00:00
uz
f3b639f835 Generate more predictable code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4039 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-19 10:17:10 +00:00
uz
2e8d62cf88 Add an additional precondition check for safety.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4038 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-19 10:14:14 +00:00
uz
824ab8b137 Serval improvements, handling of tossubax.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4037 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-18 15:10:15 +00:00
uz
45aa228489 Change order of insns in generated sequence in OptPtrLoad17.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4034 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-17 16:25:54 +00:00
uz
430c13f658 Added/corrected code info.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4033 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-17 16:23:29 +00:00
uz
97c0e45c9f Rewrite of the main function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4032 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-17 12:52:50 +00:00
uz
548dfd3060 Change order, so that the forced imports for main() go into the global
segments and not the one for main().


git-svn-id: svn://svn.cc65.org/cc65/trunk@4031 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-16 23:37:09 +00:00
uz
1bd4abdc67 Use correct adddressing mode for "asl a".
git-svn-id: svn://svn.cc65.org/cc65/trunk@4030 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-16 21:01:16 +00:00
uz
cbf4884f13 Some more pattern replacements.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4029 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-16 20:56:33 +00:00
uz
e646d35db0 Output an apropriate error message when a floating point type is encountered
(instead of an internal compiler error).


git-svn-id: svn://svn.cc65.org/cc65/trunk@4028 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-16 19:23:07 +00:00
uz
3aa4d74b18 Added more function info
git-svn-id: svn://svn.cc65.org/cc65/trunk@4026 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-16 16:38:25 +00:00
uz
582506b7fc Check also sreg in OptSize1. Added information about shortcut functions for
longs that clear the high word of the right operand on entry.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4024 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 21:00:27 +00:00
uz
d0f9a0d6a7 Fixed wrong insertion order that caused problems with labels.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4022 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 16:49:46 +00:00
uz
14b00447a8 Fixed wrong insertion order that caused problems with labels.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4021 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 16:45:02 +00:00
uz
b4fda62df9 clc should always be the insn before adc.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4020 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 16:00:30 +00:00
uz
15c420fd39 Some branch improvements.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4019 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 15:58:21 +00:00
uz
3381311674 Inline some forms of aslax1
git-svn-id: svn://svn.cc65.org/cc65/trunk@4018 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 15:27:43 +00:00
uz
f495a9edc3 Fixed an error
git-svn-id: svn://svn.cc65.org/cc65/trunk@4017 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 14:43:59 +00:00
uz
61195d914e Replace ldaxidx by inline code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4016 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 14:20:26 +00:00
uz
33f6c85753 Add more function to the "harmless calls" list.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4015 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 14:18:00 +00:00
uz
b391929acb Minor improvement in last change
git-svn-id: svn://svn.cc65.org/cc65/trunk@4014 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 13:42:40 +00:00
uz
3717443f3b Try to generate more predictable code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4013 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 13:25:40 +00:00
uz
fbe009a182 Remove even more transfer instructions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4012 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 13:16:56 +00:00
uz
14f213cadb Remove unnecessary transfer instructions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4011 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 12:49:15 +00:00
uz
b68db83a2b Remove more push/pop sequences.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4010 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 10:27:41 +00:00
uz
d27664036d Change order of replacement code in OptPtrLoad10 to allow detection in other
steps.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4009 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-15 10:14:04 +00:00
uz
0c4144c586 Don't generate inlined codes for integers shifts. If necessary the optimizer
can do that. 


git-svn-id: svn://svn.cc65.org/cc65/trunk@4007 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 22:17:47 +00:00
uz
0b7b9354dc Don't generate short code for the tosxxx functions when X is zero or similar.
Let the optimizer do it. This reduces the number of possible patterns that
must be detected by the optimizer. Add tosicmp0 as a shortcut function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4006 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 22:10:04 +00:00
uz
fdfa1678d4 Tell the compiler more about the runtime library functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4004 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 20:21:47 +00:00
uz
4a5ceb13c7 Removed debug code
git-svn-id: svn://svn.cc65.org/cc65/trunk@4003 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 18:32:11 +00:00
uz
50b410eb32 Do size improvements always if they have no impact on speed.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4002 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 18:23:29 +00:00
uz
f374e746af Improvements in array index code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4001 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 17:28:32 +00:00
uz
a9b2226956 Moved part of codeopt into coptptrload for better modularization.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4000 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-14 17:09:24 +00:00
uz
cb1870de74 Fixed an off-by-one error (reported by Greg King - thanks).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3996 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-05 14:29:30 +00:00
cpg
9cafacaf6d introduce STARTUP segment to Atari platform
git-svn-id: svn://svn.cc65.org/cc65/trunk@3995 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-04 20:04:41 +00:00
uz
3ce7717bd2 Don't allow to call subroutines that aren't actual functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3994 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-04 19:23:15 +00:00
uz
70d2d9e50f Fixed an off-by-one bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@3993 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-04 19:22:15 +00:00
uz
ca73116a03 New function IsLocalLabelName.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3992 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-04 19:12:34 +00:00
uz
3d95c9453f There's no longer a need to link in the startup file, it's done my magic
instead.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3991 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-31 13:39:07 +00:00
uz
8216bf1d6a Force an import of the special symbol __STARTUP__ in the C compiler when
main() is encountered. Define this symbol in the startup code. This will
automatically force linking of the startup code which can then reside inside
the standard library as any other object file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3988 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-31 12:05:42 +00:00
uz
66391bfc25 Inline shifts in g_asl as is already the case in g_scale.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3987 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-30 19:41:25 +00:00
uz
a3eed9016f Fix problem with R3904: Chars on the lhs of opeq must still be accessed as
such.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3985 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-30 15:15:13 +00:00
uz
37157a31a8 Fixed problems with R3977: While the solution was correct, the generated code
is bad, since information is lost when converting functions and arrays to
pointers and cannot be regained easily. So I've reverted the change and fixed
the problem in a less general manner.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3984 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-30 14:45:50 +00:00
uz
a4a1c729c8 Allow registers in sweet16 mode also to be specified as constant numbers
instead of Rx. Suggestion and sample code by Gabriele Galeotti.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3983 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-30 13:05:41 +00:00
uz
e1866ed9f8 Correct sweet16 addressing bug with SUB instr. Patch by Gabriele Galeotti.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3982 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-29 14:37:58 +00:00
uz
f62b7a564e The "inc" target needed for the snapshot build script seems to have been lost.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3981 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-28 19:40:23 +00:00
uz
778f79c436 Add a dummy return to fix a Watcom warning.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3980 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-28 19:36:44 +00:00
uz
5ee49abd12 Fixed a compatibility problem in TypeCmp: Subtracting pointers with different
signedness is not allowed.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3979 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-28 19:29:11 +00:00
uz
fb9c097981 Fixed a problem with function pointer conversion.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3978 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-28 19:21:38 +00:00
uz
32348f5778 Fixed an error: If an expression is loaded into the primary, a function must
be converted to pointer-to-function and an array to pointer-to-member resp.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3977 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-28 18:56:16 +00:00
uz
dff0e86458 Prepared the code for referencing a symbol that forces the startup code to get
linked in.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3976 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-28 18:55:23 +00:00
uz
5b0323771a Add some code that avoids outputing a forward label in the same line as a
normal label. It works but looks bad.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3971 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-06 20:33:06 +00:00
uz
8e8993de7e Support for the .BANKBYTES, .LOBYTES and .HIBYTES pseudo functions contributed
by Kevin Schuetz <scrapdog@runbox.com>.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3965 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-05-18 16:11:34 +00:00
uz
ffa8e7be82 New functions LIWarning and LIError.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3961 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-03-08 14:54:53 +00:00
uz
b607a61866 "S" is a keyword in 65816 mode only.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3958 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-03-06 09:56:22 +00:00
uz
60f525346f Fixed asm code to source line relation in switch statements. The switch code
was incorrectly attributed to the line following the switch statement.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3957 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-23 22:19:23 +00:00
uz
81a30cc888 Fixed source output in generated assembly when -T is used.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3956 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-23 22:11:18 +00:00
uz
82b998117a Added a separate output module that is used to manage the output file.
Fixed the -E switch: Output was always sent to stdout and an empty assembler
output file was generated. Now the output is sent to either <inputstem>.i or
the file named in the -o option.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3955 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-23 21:25:59 +00:00
uz
bf810bf001 When generating forward references to functions, use the default code address
size.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3948 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-22 16:38:07 +00:00
uz
4dd9c523e7 Check for division by/modulo by zero when parsing the /= and %= operators.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3937 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-17 21:09:59 +00:00
uz
c4dac550a8 Small change to avoid endless error loops (aborted by the maximum error count)
if an unexpected token is encountered in Primary().


git-svn-id: svn://svn.cc65.org/cc65/trunk@3936 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-17 20:56:13 +00:00
uz
c94e82f8b2 Check for and flag address size modifiers that are invalid for the choosen CPU.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3927 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-10 21:10:50 +00:00
uz
823d0b7636 Makefile cleanup. Among other things, allow use of the --as-needed linker flag
by rearranging arguments for the linker.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3922 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-02-08 17:19:45 +00:00
uz
a3aca2ab67 Added special error messages for Groepaz.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3919 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-30 16:30:27 +00:00
uz
ab74b7bfd8 Another fix for the SB_SetIndex macro.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3916 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-26 08:28:29 +00:00
uz
f45e73164d Fixed an error in the SB_SetIndex macro.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3915 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-26 08:08:28 +00:00
uz
1a54f34a84 Fixed a problem with recursive macro expansions. They didn't work if the same
macro was involved more than one time.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3911 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-24 16:31:18 +00:00
uz
dd5e5c43d8 Added a new SetIndex() function/macro.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3910 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-24 16:26:48 +00:00
uz
b4ced298b1 Rewrite va_copy.h - the check for a C89 compiler wasn't a really good idea,
since many compilers are broken in this respect.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3909 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-24 16:26:32 +00:00
uz
30f88d2646 Avoid spurious subsequent errors if an include file wasn't found.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3908 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-18 15:07:55 +00:00
uz
df341b6551 Fixed an optimizer problem: A branch into a list of at least two branches
pointing to themselves caused the optimizer to loop forever.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3907 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-01-12 19:48:28 +00:00
uz
308ceeacf9 Fixed problems with casts, where larger values weren't truncated when casting
down to char size.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3904 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-12-28 16:25:03 +00:00
uz
a1fbb4fe32 Add new --tabsize option to usage/help output.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3903 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-11-11 21:23:15 +00:00
uz
d6d807c3db New option --tabsize.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3902 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-11-11 21:21:10 +00:00
uz
d66d72bf95 Be more tolerant with dos/windows line endings.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3901 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-11-11 21:16:51 +00:00
uz
17ac0cb4fa Fixed the macro versions of several inline functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3900 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-31 18:31:18 +00:00
uz
1e46bc16e4 More changes to support address size qualifiers.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3899 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-31 18:24:33 +00:00
uz
63943c3f44 Test for pointer must use IsTypePtr not a direct compare. The later may (and
does) fail because of qualifiers.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3898 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-31 18:23:58 +00:00
uz
cc36f8a93a Moved the fascall and near/far flags from the function desriptor into the
type. Started to add general handling of address size flags in types.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3891 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-24 17:33:30 +00:00
uz
5d4790a137 Enable use of new C like comments only if the new feature "c_comments" is
enabled.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3889 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-21 19:35:39 +00:00
uz
9f7fc6f4c8 Added C like /* */ comments.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3888 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-19 21:26:23 +00:00
uz
0b4f6426e2 Some more floating point support.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3886 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-11 17:51:00 +00:00
uz
0b60ac4716 Use GlobalModeFlags() if apropriate.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3885 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-09 20:33:11 +00:00
uz
1b29b536f3 Fixed a bug: Structure assignment was broken.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3884 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-08 16:47:43 +00:00
uz
1e672a3169 Fixed a bug: The op= operators (+=, -=, etc.) worked on const qualified
objects.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3883 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-07 22:22:58 +00:00
uz
66b3f9d974 Fixed a bug: It was possible to increment or decrement const qualified
objects.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3882 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-07 22:18:12 +00:00
uz
5cd0b86a1a Indexing a string by an expression which was not a simple variable didn't
work:  "abcd"[atoi("2")];
                         


git-svn-id: svn://svn.cc65.org/cc65/trunk@3880 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 21:20:42 +00:00
uz
9127774a4d Pass a complete ExprDesc and not just the Flags field to GlobalModeFlags to
allow for better debugging (output) in case of problems.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3879 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 21:11:26 +00:00
uz
ac895ef921 DoneStrBuf -> SB_Done (Stefan Haubenthal).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3878 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 20:56:35 +00:00
uz
dbb9a31fd9 Fixed wrong code generation for
((unsigned char *)(&shadow))[reg & 0x0f] = value;


git-svn-id: svn://svn.cc65.org/cc65/trunk@3875 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 19:47:57 +00:00
uz
d10f8525db Fixed a comment.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3872 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-05 15:52:25 +00:00
uz
a1d7fed128 Fixed several problems with old style (K&R) declarations and a mix of old and
new style decls.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3869 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 20:55:36 +00:00
uz
3482a9e7ce Fixed a comment
git-svn-id: svn://svn.cc65.org/cc65/trunk@3868 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 20:09:03 +00:00
uz
24c6e1ce5b Move some storage class handling and checking for implicit into from locals.c
and compile.c into ParseDecl() (declare.c).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3867 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 18:20:12 +00:00
uz
841ea0e686 Transfer the storage class flags from struct DeclSpec into struct Declaration.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3866 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 18:00:05 +00:00
uz
c76a8657b3 Fixed handling of function definitions with an empty parameter list. According
to the standard, an empty parameter list in a function declarator that is not
a definition means that the function may have any number of parameters. In a
function definition, it means that there are no parameters (as if the function
were declared with a "void" parameter list).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3865 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 15:30:03 +00:00
uz
4812feb44b git-svn-id: svn://svn.cc65.org/cc65/trunk@3863 b7a2c559-68d2-44c3-8de9-860c34a00d81 2008-08-02 22:02:54 +00:00
cuz
6ecca264e4 In an old style function definition, print a diagnostic if a type is assigned
twice to a parameter.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3861 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-01 21:40:07 +00:00
cuz
357118697d A label must always be followed by a statement. Check for this.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3860 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-01 20:00:23 +00:00
cuz
64ec376140 Switch statement may now contain arbitrary code as the standard requires. The
compiler will now accept stuff like Duffs device.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3859 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-01 19:44:01 +00:00
cuz
22d89f558e Added several type checks, especially for functions. Moved check for implicit
int return type.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3858 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-31 18:31:15 +00:00
cuz
52c0c284da Calling an undefined function is an error in C99.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3857 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-31 18:30:33 +00:00
cuz
b5511acf6f Fixed an error
git-svn-id: svn://svn.cc65.org/cc65/trunk@3856 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-26 22:19:01 +00:00
cuz
258a8e7d4c Move zpsave into its own segment to decrease the executable size.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3852 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-15 18:34:20 +00:00
cpg
254b252167 add "define=yes" for ZPSAVE segment, since it's needed by crt0.s
git-svn-id: svn://svn.cc65.org/cc65/trunk@3850 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-04 17:31:14 +00:00
cuz
f257b2ee81 Moved the data that keeps a copy of the used zero page locations in its own
segment to reduce the executable size.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3849 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-03 19:39:14 +00:00
cuz
c7aae0d3d8 Fixed an error in .out
git-svn-id: svn://svn.cc65.org/cc65/trunk@3846 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-06-29 20:13:37 +00:00
cuz
9dcd19eac9 Bumped the version number
git-svn-id: svn://svn.cc65.org/cc65/trunk@3840 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-04-21 20:14:29 +00:00
cuz
a623013e66 Bumped the version number
git-svn-id: svn://svn.cc65.org/cc65/trunk@3839 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-04-21 20:11:14 +00:00
cuz
225e1ca58e More fixes for Watcom C / C89.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3829 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 21:28:50 +00:00
cuz
11e0421fa7 Fixed another problem with the macros.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3828 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 21:23:10 +00:00
cuz
e5782fdc20 Allow an optional '+' sign before an exponent of a floating point constant.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3827 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 21:17:27 +00:00
cuz
3f44e21b12 Fixed bugs in the macro versions of the GetStringId inline functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3826 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 21:13:10 +00:00
cuz
9174f65e54 Make much more usage of dynamic strings (StrBufs) instead of char* and
friends. Since names and other strings are now StrBufs in many places, code
for output had to be changed.
Added support for string literals to StrBuf.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3825 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 20:54:45 +00:00
cuz
6a7e844500 The conversion specifier to output a StrBuf had to be changed, because gcc
emits a warning for each such unknown conversion specifier.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3824 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 20:51:31 +00:00
cuz
46286ccffa Fixed an error in the type comparison code. Function declarators were not
considered equal, if the functions defined different local structs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3822 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-29 12:17:32 +00:00
cuz
e917645145 New functions SB_ToLower and SB_ToUpper.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3821 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-27 13:40:38 +00:00
cuz
feae688346 Oliver Schmidt updated the graphics drivers and part of the C library for the
Apple machines.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3816 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-16 09:37:22 +00:00
cuz
a21bf773e1 Fixed a bug in the optimizer. Loads of X and Y from memory were sometimes
replaced by loads of A with an immediate value (which is stored in said memory
location).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3813 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-02-27 20:37:02 +00:00
cuz
f1ea61581f Patch for ca65html by Greg King:
The "ca65html.sgml" patch:
1) Removes text that says that the colorize option is non-standard.
2) Corrects the information about what is put on the index page.

The "ca65html" patch:
1) Looks for "?" and "@" at the front of cheap local labels.
2) Handles label assignment statements.
3) Parses many more ca65 dot-directives.
4) Handles every official op-code mnemonic that ca65 knows.
5) Recognizes both upper- and lower-case directives and mnemonics.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3810 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-02-20 17:27:19 +00:00
cuz
94f3a578a5 Allow optional assignments in .export and .exportzp statements.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3809 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-02-19 21:01:07 +00:00
cuz
a4b43370e7 More segment support stuff.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3806 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-09-02 19:49:12 +00:00
cuz
8db6dcd414 Started to add support for segments.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3805 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-31 20:27:53 +00:00
cuz
10efd998e0 Move code to a subroutine.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3804 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-31 20:23:37 +00:00
cuz
e8b90752d9 Preprocess the remainder of the line in a #include preprocessor directive.
This allows use of macros in the file spec and is a requirement of the C
standard.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3803 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-31 16:02:03 +00:00
cuz
47860910e0 Renamed the Val field to IVal to allow values of other types later.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3802 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-30 20:24:16 +00:00
cuz
3894b074a6 Move more stuff from scanner.c into the new module token.c.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3801 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-28 21:14:21 +00:00
cuz
79a89299b9 Added #warning (suggestion by Rudolf Schubert).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3799 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-28 12:53:43 +00:00
cuz
0b4a94a65e Preparation for introducing token sources.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3798 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-27 20:39:02 +00:00
cuz
10c949062b Fixed a bug: The compiler evaluated constant expressions internally always
using signed integers as data types. This led to wrong results for mod, div
and compares.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3797 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-26 18:53:46 +00:00
cuz
a7358314a0 New .FEATURE org_per_seg. If enabled, .org/.reloc do only influence the
current segment. Idea by Peter Wendrich <pwsoft@syntiac.com>.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3794 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-23 19:48:43 +00:00
cuz
24709a67d7 Applied Magervalps colorization changes with some minor modifications.
Colorization is now done by using CSS style sheets, so even colorized pages
are valid HTML.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3788 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-19 12:54:45 +00:00
cuz
363ff21b9c Fixed umlauts
git-svn-id: svn://svn.cc65.org/cc65/trunk@3787 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-08-19 12:23:24 +00:00
cuz
57c2e0cc0b Fixed an error handling SC_EXTERN.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3785 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-07-03 16:02:04 +00:00
cuz
fd7e66f24c Fixed an error.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3784 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-07-03 16:01:51 +00:00
cuz
7e44cdbd5f Fixed an error
git-svn-id: svn://svn.cc65.org/cc65/trunk@3783 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-06-28 10:28:34 +00:00
cuz
d1e184f93b Fixed wrong spelling of ".dbyt".
git-svn-id: svn://svn.cc65.org/cc65/trunk@3781 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-06-12 15:51:48 +00:00
cuz
519730612e Fixed hangs on certain info files. PC was not incremented when DataByteLine
is called.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3780 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-06-12 07:29:25 +00:00
cuz
fe52694b61 Fixed a problem with MagerValps changes.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3778 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-05-21 20:51:55 +00:00
cuz
80a4c8c02b Fix type of "&array" - it will actually generate pointer to array, not pointer
to element. This will make some valid code work but emits now errors for
questionable code.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3775 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-03-18 19:15:35 +00:00
cuz
030ce6ad28 Using typdefs, it is possible to construct types that have qualifiers
attached to an array (not the elementtype). Fix these problems by tranfering
the qualifiers to the elements.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3774 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-03-18 18:26:00 +00:00
cuz
cfe263ea42 Fixed a bug introduced with the last patch
git-svn-id: svn://svn.cc65.org/cc65/trunk@3772 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-02-10 18:22:43 +00:00
cuz
6a9a5eeafc Fixed an error in SB_Slice.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3770 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-02-07 14:25:51 +00:00
cuz
bcd13b2dca MagerValp: I adjusted some of the regexps in ca65html again, to better detect
labels, and to eliminate false positives where labels start with three
characters matching an opcode.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3769 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-02-03 18:26:16 +00:00
cuz
9601baf6ec Fixed internal compiler error on invalid input code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3768 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-02-03 18:11:37 +00:00
cuz
4846c27c77 Replace the fixed buffer in the Find() routine by a dynamically allocated
string using a StrBuf. This works around problems with Watcom C where
FILENAME_MAX was just 80.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3765 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-08-22 20:27:59 +00:00
cuz
eb745b3d1b Fixed a problem with undefined identifiers in #if expressions: If the
identifier is not the last token on the line, the compiler will run into
an error.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3744 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-05-29 20:38:44 +00:00
cuz
b7255ed8fa Terminate the line containing the #if expression before passing it to the
parser.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3743 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-05-29 20:36:21 +00:00
cuz
b6cb833560 Don't check for open .IF clauses when reaching the end of pushed input data.
This will allow to write macros that contain open .IFs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3740 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-05-21 11:23:22 +00:00
cuz
49719b0bd2 Removed a C99 construct
git-svn-id: svn://svn.cc65.org/cc65/trunk@3734 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-24 23:45:44 +00:00
cuz
e81d5ec00a Added another optimization step
git-svn-id: svn://svn.cc65.org/cc65/trunk@3732 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-16 21:35:36 +00:00
cuz
7736aac1e2 Added more info about internal (builtin) functions
git-svn-id: svn://svn.cc65.org/cc65/trunk@3731 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-16 21:35:24 +00:00
cuz
21af43a800 Comment fix
git-svn-id: svn://svn.cc65.org/cc65/trunk@3730 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-16 20:32:09 +00:00
cuz
585791a789 Repeatedly call OptStore1 after OptJumpTarget because it is able to do some
more work in case of for loops.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3729 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-15 20:46:05 +00:00
cuz
1ac3cbe420 ldaxysp doesn't return flags any more.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3728 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-15 20:45:35 +00:00
cuz
c156b20738 Added some code rewriting (may enable optimizations in a few cases).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3727 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-15 20:31:43 +00:00
cuz
d82d94ecc1 Optimize decaxn
git-svn-id: svn://svn.cc65.org/cc65/trunk@3726 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-15 19:28:45 +00:00
cuz
c13f40a9f1 Emit warnings for symbols that were used suboptimal because of forward
definitions. For example a zero page symbol that is used as absolute because
it was undefined when encountered.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3724 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-09 10:56:23 +00:00
cuz
44405a0bb5 New function xdup.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3723 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-09 10:04:50 +00:00
cuz
155dc9c653 Corrected some runtime function info
git-svn-id: svn://svn.cc65.org/cc65/trunk@3721 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-07 08:38:30 +00:00
cuz
f507124733 Added lots of runtime function info.
Fixed a problem with wrong info for the incaxn functions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3715 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-03 19:31:31 +00:00
cuz
c73c31c496 Added info for the staxspidx runtime function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3714 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-04-02 15:32:16 +00:00
cuz
4c0720709b Fixed a few errors in the macros used by the Watcom compiler.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3712 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-03-30 19:49:03 +00:00
cuz
d187424389 Fixed a problem of the optimizer. Unknown internal functions are marked as
using just EAX as input, and destroy all registers. This did cause the
optimizer to remove loads to zero page locations needed in the routines or
later.
Print a warning for unknown internal functions when in debug mode.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3711 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-03-24 15:24:34 +00:00
cuz
f196e7c5c9 Cleanup. Added a few general purpose functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3710 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-19 15:53:11 +00:00
cuz
de3a20a898 Changed the low level type representation from a strung of unsigned short
elements to a string of structs, each representing one type element. This
should fix problems on unusual architectures, since it is no longer necessary
to embedd pointers and other data converted to numbers in the string of
unsigned shorts.
Increased the TypeCode length to unsigned long to make room for more type
bits.
Inline more functions in datatype.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3709 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-19 12:29:37 +00:00
cuz
1375c85405 Removed an unneeded struct forward
git-svn-id: svn://svn.cc65.org/cc65/trunk@3708 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-18 12:23:07 +00:00
cuz
31d99b4a9f Added the inline keyword
git-svn-id: svn://svn.cc65.org/cc65/trunk@3707 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-17 20:27:51 +00:00
cuz
64921852dd Parse the C99 "restrict" keyword correctly (but ignore it otherwise).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3706 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-17 20:19:35 +00:00
cuz
32164ea8e5 Allow type qualifiers before a storage class spec.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3705 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-17 19:42:40 +00:00