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

1924 Commits

Author SHA1 Message Date
uz
3eed1bffbc Some more test and example code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4790 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-07 13:40:16 +00:00
uz
d645a797cb Improved info API.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4789 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-07 13:25:09 +00:00
uz
8c39874daa Some changes in debug info generation.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4788 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-07 12:46:12 +00:00
uz
1dbb84bcee Add some code that tries to skip unknown keywords that may have been added by
later version of the debug info.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4787 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-06 09:17:43 +00:00
uz
3d2cb567dc The stuff will not link with Watcom because of vsnprintf, but a makefile is
still useful for testing.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4786 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-05 21:16:07 +00:00
uz
1877af89cc Several fixes detected when using another C compiler.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4785 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-05 21:15:00 +00:00
uz
4b1c5e4157 First working version with complete API for line information.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4784 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-05 21:00:36 +00:00
uz
12e7cc010d Output version information into the debug file.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4783 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-05 20:41:27 +00:00
uz
0807da74bd Corrected indentation - no code change.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4782 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-05 19:34:25 +00:00
uz
b8e7feb788 Fix relocation of line infos.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4781 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-05 19:34:03 +00:00
uz
abda26a309 Don't output multiple code ranges per line, since this is harder to parse.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4780 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-03 19:00:14 +00:00
uz
54e22eb53c First version of a module that reads debug files generated by ld65.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4779 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-03 18:46:50 +00:00
uz
e046ecbcf2 Be sure to generate line info for all segments.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4778 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-01 13:52:06 +00:00
uz
83e5252785 Changed a comment
git-svn-id: svn://svn.cc65.org/cc65/trunk@4777 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-01 13:48:32 +00:00
uz
031ae666e3 Fixed an error in the macro version of HasObjData().
git-svn-id: svn://svn.cc65.org/cc65/trunk@4776 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-31 12:37:14 +00:00
uz
b2321ebdf7 Fixed an error: Some of the collections weren't initialized.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4775 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-31 09:44:25 +00:00
uz
23b867b7a4 Handle file position information for fragments differently: Instead of
handling them separately (which has historic reasons), generate real line info
information. This means that line info for the assembler source will be part
of the debug info file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4774 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-30 22:44:09 +00:00
uz
f308a3c4d1 Use collections in the object file structure instead of managing the items
manually.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4773 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-30 20:58:51 +00:00
uz
5bffbc98ff Added a new function CollGrow.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4772 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-30 20:58:09 +00:00
uz
7d506c84c9 Make .DEF, .REF and friends also work with cheap local symbols.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4767 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-26 17:28:34 +00:00
uz
477b77f528 Another minor improvement in compares.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4745 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-11 21:53:48 +00:00
uz
2bb2d97ab0 Fixed and improved the code for compares. Before, compares of chars to a
constant where sometimes passed down to the code generator in a way that
caused wrong code to be generated.

This change may go into 2.13 after some testing.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4743 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-11 16:11:45 +00:00
uz
a89231ece7 Fixed an error: A function wasn't converted to a void pointer automatically by
the compiler.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4741 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-10 20:48:05 +00:00
uz
abbfaef2aa A negative token count for .LEFT was incorrectly adjusted to 1, not to 0.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4738 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-10 12:32:05 +00:00
uz
125ab37c09 Added relative include path handling: The path of an input file is now pushed
onto the search path list, so include files will be searched relative to this
path first.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4676 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-30 13:31:09 +00:00
uz
b942fd0b56 Check for a size of zero in SB_CopyBuf to make the code somewhat faster.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4675 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-29 21:23:34 +00:00
uz
314893619a Don't ignore empty paths when adding the path of a file to the search path
list.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4674 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-29 21:20:48 +00:00
uz
02f5b5499e Changed search path logic: Include files are now search first in the directory
containing the file that had the #include statement. The path of the main file
will also added to the front of the search path list, so includes will not be
search in the current directory first, but in the directory that contains the
main file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4673 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-28 12:00:12 +00:00
uz
9a6f97cfe1 PushSearchPath will add the path only if it's not already there.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4672 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-28 11:56:01 +00:00
uz
ebd679dd57 New functions PushSearchPath and PopSearchPath.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4671 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-28 11:22:44 +00:00
uz
64b597017a Fix the check for constant static local data, which was wrong when the data
was an array. It should go into RODATA, not DATA.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4669 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-27 19:47:13 +00:00
uz
05f7296369 Restructured search path handling.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4662 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-09 10:54:15 +00:00
uz
d95bb2e600 New option --bin-include-dir which is passed to the assembler.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4661 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-04 20:19:54 +00:00
uz
d54ca88743 Added a new option --dep-target to the compiler. This option allows to set the
target in the generated dependency file. The cl65 utility will use this option
to override the depdendency target, if actual object files are to be generated
from C input. So the generated dependency will not have the intermediate .s
file as target, but the final .o file, which allows to use the dependency
files without further processing.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4660 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-02 09:56:40 +00:00
uz
e61bf7094c Restructured the code for better reada- and maintainability.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4659 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-02 09:32:42 +00:00
uz
0695f39611 Added --create-dep and --create-full-dep to the cl65 utility.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4655 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-01 14:47:09 +00:00
uz
39108e20b5 Rewrote the search path routines to use collections internally.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4654 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-01 14:44:14 +00:00
uz
3fd52eb57f Added dependency file generation to the assembler. This includes two new
options, --create-dep and --create-full-dep. The latter will include files
that are passed via debug info to the assembler.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4653 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-01 11:59:55 +00:00
uz
96cf7f6271 Changed generation of makefile dependencies:
* There are now two options, --create-dep and --create-full-dep. One
    will add system includes, the other not.
  * Both options require a file name. This is an incompatible change(!)
    but has the advantage that the user is in control of extension and
    path of the generated file.
  * Output will always include a phony target for the input files. This
    may not work with all make programs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4652 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-01 09:42:12 +00:00
uz
54740da820 More preparations for an extension of the calling conventions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4650 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-29 20:30:49 +00:00
uz
77bfcc1ff0 Change the OptStackOps function so that it adjusts the instruction pointer
after changing code. Without this correction, the insn pointer may be wrong
after one of the subfunctions has changed code, which may cause a valid
sequence not to be detected. This change (when proven good) may also go into
2.13.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4649 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-25 21:51:59 +00:00
uz
2e6d218801 Remember the type of the input file. This may be used later to create more
variants of dependency files.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4645 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-22 19:40:50 +00:00
uz
bfd8f4e108 Implemented new .PUSHCPU and .POPCPU commands.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4644 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-18 18:47:16 +00:00
uz
922cbf08eb Added several functions to the intstack module.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4643 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-18 18:40:59 +00:00
uz
48c647b6bd Added while loop inversion.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4642 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-17 15:19:35 +00:00
uz
6b3e515573 Reverted part of change 4108 that prevented an optimization step to find
proper replacements. Some other rearrangements for slightly better code.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4640 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-10 11:23:39 +00:00
uz
4299e2db05 Added the cdecl keyword
git-svn-id: svn://svn.cc65.org/cc65/trunk@4639 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-09 19:47:33 +00:00
uz
ca9170cd20 More strcmp inlining.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4638 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-23 21:47:12 +00:00
uz
8e26fef105 Fixed the size of the RAM segment for the CBM610. The routine that does
cross-bank calls is located at $FECB and the stack grows downwards from 
there.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4637 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-23 19:40:48 +00:00
uz
e192edd021 Inline some occurances of strcmp.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4635 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-22 22:28:45 +00:00
uz
3d06780f6d For the CBM 510, the stack is not part of RAM. And, because of the cross-bacnk
routine, it is smaller than the number used before.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4634 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-21 21:39:44 +00:00
ol.sc
4b689107a4 - No more HEAP segment
- RAM reduced by __STACKSIZE__
- Unified formatting

git-svn-id: svn://svn.cc65.org/cc65/trunk@4633 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-21 17:10:17 +00:00
uz
0e60a60c3e Fixed an optimizer problem.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4632 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-21 14:08:46 +00:00
uz
1a4e2edede Reenable compile time evaluation of strlen for string literals.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4631 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-20 18:51:59 +00:00
uz
15f95d7623 Changed the size of available RAM so that the last used address is $7FFF.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4630 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-20 18:08:27 +00:00
uz
7450c25404 Allow escape sequences prefixed by '%' in strings. '%%' denotes a single
percent sign, %O is the name of the output file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4628 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-20 17:48:15 +00:00
uz
b759e753e4 Changed the type of CfgSVal to a string buffer and removed the upper limit for
the length.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4627 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-20 17:23:51 +00:00
uz
af27ae6d79 Fixed two issues with macros:
* A newline between the macro name and the argument list of a function like
  macro was not accepted.
* An unterminated macro argument list was not always detected.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4621 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-14 17:46:02 +00:00
uz
61b69316c5 Added builtin .min() and .max() pseudo functions to the assembler.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4583 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-02-11 18:54:08 +00:00
uz
5477e62e3a Fixed open mode for second try in DoIncBin (Greg King).
git-svn-id: svn://svn.cc65.org/cc65/trunk@4563 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-01-31 20:49:40 +00:00
uz
79820fe4ec Added a separate include search path for binary includes. These aren't
searched any longer in the standard include path.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4558 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-01-25 20:33:01 +00:00
uz
5175f95341 Fixed a problem in the optimizer function that rewrites ops that use the
stack. Useless instructions (duplicate loads or transfers) within the sequence
are left intact and may cause problems because the interfere with the
replacement code. A run of OptRemoveUnusedLoads and friends should fix the
problem, bit this step may be disabled, so the routine has to check for this
condition and avoid it (by not doing the replacement).


git-svn-id: svn://svn.cc65.org/cc65/trunk@4551 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-01-20 19:47:44 +00:00
ol.sc
3d5d3ef76a Define HEADER memory area for the EXEHDR segment for consistency reasons with the other targets with an EXEHDR segment (apple2[enh], atari, lynx, cbm[5|6]10).
git-svn-id: svn://svn.cc65.org/cc65/trunk@4550 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-01-17 21:47:03 +00:00
uz
41f7757204 Ignore unknown preprocessor directives in an #if group that is excluded.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4534 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-30 11:20:09 +00:00
uz
60bc009991 * Moved the BASIC stub that calls the compiled program into it's own segment
named EXEHDR.
* Renamed BASICHDR to EXEHDR for the PET-II machines.
* Moved the call to CHRCH in front of the code that saves the zero page, since
  open files are sometimes remembered in the zero page, so we need to close
  them before we grab a copy.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4507 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-09 12:42:24 +00:00
uz
1fae13274e An assignment for the ZPSAVE segment was missing in the linker config for the
32K memory config of the VIC20. Hint from Robert Hurst.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4505 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-08 20:41:43 +00:00
uz
7d94dc50a1 New option and #pragma --local-strings that causes string literals to be
output immediately.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4504 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-08 20:35:24 +00:00
uz
a467095216 Relax header checking somewhat, so second source fonts are accepted.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4502 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-06 12:24:59 +00:00
uz
3976746735 Rewrote literal handling. Literals are now saved together with other function
data, and at the end of compilation merged if possible. Literals for unused
functions are removed together with the function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4501 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-05 22:39:45 +00:00
uz
9b7c16ec4c Fixed problem with last change. Wide string constants were not handled
correctly.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4500 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-05 15:14:11 +00:00
uz
50ff6d0768 Create one literal pool per function, so that literal pool data is removed
together with a function, if it is not used. Literal storage can now be
controlled by #pragma writable-strings on a per function basis.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4499 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-04 14:12:25 +00:00
uz
1f90ec93a0 Move global segment creation to a better place in source.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4498 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-04 13:04:40 +00:00
uz
ff4eeebec2 Makefile patch contributed by Greg King:
I added the "MAKEOPTS=" to the top-level "gcc.mak" that he wants, and I
changed the tool source tree's top-level make-file so that it supports
parallel building.  (I added a rule that builds the common library before
building anything else.)


git-svn-id: svn://svn.cc65.org/cc65/trunk@4497 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-02 15:21:22 +00:00
uz
ce931b85be In case of parse errors for structs, don't just set the type of the result to
"int", return a valid lvalue instead.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4483 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-24 23:02:58 +00:00
uz
3fb0c660dc Fix a problem with error handling: The E_HAVE_MARKS flag must not be removed
from an expression in case of an error.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4482 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-24 22:56:56 +00:00
uz
327c989d8b Support for the HuC6280 (CPU of the PC Engine) contributed by Tobias Gunkel.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4481 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-24 20:04:27 +00:00
uz
884aff9191 Prepare for reading keypresses from the X server.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4461 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-12 11:19:44 +00:00
uz
6078953baa Do not use a separate byte for an END opcode, instead place the bit into the
previous opcode. This saves one byte per character with the exception of
characters without a vector representation, where we loose one byte, because
we need to add a dummy vector just to apply our END bit.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4433 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-02 22:31:32 +00:00
uz
0787e45aee Added macros for jumps after unsigned compares to the "generic" macro package.
Removed BGE/BLT as native instructions for the 65816.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4427 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-02 16:26:46 +00:00
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