1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-27 19:55:09 +00:00
Commit Graph

2953 Commits

Author SHA1 Message Date
Greg King
d13d068e71 Fixed the generation of the opcode byte when BRK is given an operand, in 65816 CPU mode.
The bug was created by commit 7e8bb7b700.
2018-08-16 23:51:04 -04:00
Patrick Pelletier
5cdaa96e4c sim65: Fix "$2C: BIT abs" to access the correct address.
Bug is documented here:
http://forum.6502.org/viewtopic.php?f=2&t=5242
2018-08-10 12:58:48 -07:00
Greg King
ad6c2dbe7b Added code to make the 65816's MVN and MVP instructions handle both immediate (bank) and far-address operands. 2018-07-29 03:50:02 -04:00
Greg King
eeb1b927ce Fixed the order in which the 65816's block-move instructions' operands are written and assembled.
The source bank number is written first; but, assembled second.
The destination bank is written second; but, assembled first.
2018-07-05 10:58:59 -04:00
AIDA Shinra
31fdec2e2e Style fix 2018-06-25 23:50:46 +09:00
AIDA Shinra
fd67284b4d Followed the discussions in the Pull request #682.
* Fixed a misspelling
* Fixed styles
* Added sample codes
2018-06-14 02:02:16 +09:00
AIDA Shinra
2b25329423 Support for preprocessing info file via cpp or m4. 2018-06-14 02:02:16 +09:00
AIDA Shinra
75c4972021 Style and alignment fixes. 2018-06-13 21:24:34 +09:00
AIDA Shinra
03bb2f6a48 Followed discussions in the Pull reequest #681.
In particular, renamed "virtual operands" to "inline parameters".
2018-06-12 00:18:11 +09:00
AIDA Shinra
9283e9ca98 Support for "virtual operands" of subroutines like this:
jsr	SomeProc
.byte	$00, $01 ; argument to SomeProc
; return here from SomeProc
bit	$3F
2018-06-10 18:09:11 +09:00
Oliver Schmidt
b74ab9de89 Allow spaces in path names.
The Microsoft C Library needs to have spawnvp() parameters with spaces quoted manually. We do this only if actually necessary to limit issues with parameters already containing double quotes.
2018-06-08 19:16:18 +02:00
Oliver Schmidt
d861be8ad5 Escape spaces in target path.
cc65 escapes spaces in paths it writes to dependency files (see WriteEscaped() in cc65/input.c). Given that the output of OptPrintTargetPath() is supposed to be used in Makefiles in pretty much the same way it is appropriate to escape spaces here too.
2018-06-07 17:10:33 +02:00
Oliver Schmidt
aea34c5410
Merge pull request #673 from bengdahl/master
Fix `make` failing in parent directories containing spaces
2018-06-07 17:01:42 +02:00
Oliver Schmidt
e99a5ff1fe
Fixed usage indentation. 2018-06-06 18:59:25 +02:00
existensialMemory
4fd17161eb
Update Makefile 2018-06-04 22:17:25 -04:00
Ben
1f245fbc0b Fix make failing in parent directories containing spaces 2018-06-04 21:27:04 -04:00
Greg King
362b6afacf Made a C union declaration know the sizes of anonymous struct/union members when it determines its size.
The bug was located, and the fix was written, by Francesco.
2018-05-13 18:54:45 -04:00
Michael Kohn
5ecd902fbf The opcode for BS should be 0x0C. 2018-05-13 06:31:05 -05:00
greg-king5
ca31e3af1e
Fixed a bug that didn't preserve the accumulator's value when a simple 16-bit fetch-and-store is optimized. (#637)
Fix a 16-bit fetch-and-store cc65 optimizer bug.
2018-05-12 13:46:16 -04:00
Oliver Schmidt
8b3e12d632
Added missing ror absolute override.
Fixes https://github.com/cc65/cc65/issues/489 as suggested by EtchedPixels.
2018-03-12 12:14:25 +01:00
Oliver Schmidt
8e75906737 Switched Apple II output format to AppleSingle.
Although the primary target OS for the Apple II for sure isn't DOS 3.3 but ProDOS 8 the Apple II binary files contained a DOS 3.3 4-byte header. Recently I was made aware of the AppleSingle file format. That format is a much better way to transport Apple II meta data from the cc65 toolchain to the ProDOS 8 file system. Therefore I asked AppleCommander to support the AppleSingle file format. Now that there's an AppleCommander BETA with AppleSingle support it's the right time for this change.

I bumped version to 2.17 because of this from the perspective of Apple II users of course incompatible change.
2018-03-07 23:05:21 +01:00
Oliver Schmidt
bc58bf572c Fixed -W cmdline option handling.
Reverted part of 3157e4be1e as it actually introduced a regression.

It doesn't make sense to check for Arg[3] == '\0' _before_ checking Arg[2] != '\0'. This made the Win32 builds fail to correctly parse e.g. cl65 -W unused-var test.c
2018-03-05 22:31:10 +01:00
Oliver Schmidt
19f3229f45 Made 'wrapped call' code build with VS 2015. 2018-03-05 20:44:32 +01:00
Oliver Schmidt
c3610aa971 Updated from Visual Studio 2013 to Visual Studio 2015. 2018-03-05 20:42:37 +01:00
prandeamus
1a95be9c3a 65C02 JMP (ind,x) opcode 7C 2018-01-14 19:42:29 +00:00
prandeamus
009f56afb6 65C02 version too. 2018-01-13 22:42:39 +00:00
prandeamus
c23f264fe4 Call ParaVirtHooks on JMP (indirect) 2018-01-13 18:30:53 +00:00
Oliver Schmidt
9229bb1f3e
Merge pull request #571 from greg-king5/win64
Change the type of a cc65 variable that holds both integers and pointers.
2018-01-10 12:48:28 +00:00
Greg King
c67e90dd19 Changed the type of a compiler variable that holds either integers or pointers.
The change allows cc65 to be compiled on 64-bit Windows, without getting warnings.  That OS is actually 32 bits with 64-bit pointers.  Its pointers are "long long" instead of "long".  The change uses type-names that are configured for the actual pointer width.
2018-01-09 05:34:16 -05:00
prandeamus
e7aabce8e9 Complain if unsupported flags are provided after -O 2018-01-07 18:57:48 +00:00
bauen1
60c68b1111
cl65 now links against none.lib when using --target none 2018-01-04 17:11:44 +01:00
greg-king5
c8dd88efad
Added missing "break;" statements to a "switch" statement. 2017-12-18 17:09:06 -05:00
Oliver Schmidt
e485e96de0 Suppress potential svnversion error output. 2017-11-30 19:17:45 +01:00
Stefan
7e4db1fdd6
Option removed 2017-11-22 18:17:43 +01:00
Stefan
44b13c1ca0
Subversion fallback
If you use don't use Git to access the repository, you will still get a revision number.
2017-11-22 01:02:02 +01:00
Greg King
de1f80571a Fixed the way that the disassembler looks for the end of a segment.
It checks only the bytes that actually were printed.  It won't show a bad error message when disassembling address $0000.  Fixes #506 on cc65's Github project.
2017-10-31 00:47:07 -04:00
Oliver Schmidt
c8d6ca908d Minor style fix. 2017-10-23 18:22:51 +02:00
Lauri Kasanen
ca4ed290d5 cl65: Add support for --all-cdecl 2017-10-03 18:46:39 +03:00
Oliver Schmidt
5d333239c6 Merge pull request #468 from pmjdebruijn/samples
make changes
2017-07-23 02:09:20 +02:00
Pascal de Bruijn
19f6ae1d54 make: change uppercase prefix var 2017-07-22 16:38:50 +02:00
Pascal de Bruijn
6e93c1ba73 pragma: add minimalist message pragma implementation
for example:

#pragma message ("in a bottle")

results in:

hello.c(207): Note: in a bottle
2017-07-19 17:58:13 +02:00
Pascal de Bruijn
ea7f4d7489 pragma: bring pragma_t enum in line with Pragmas struct
fixes an inconsequential inconsistency, might prevent some
confusion in the future.
2017-07-17 19:43:11 +02:00
Piotr Fusik
c0812670c1 Fix coding style. 2017-06-30 07:35:21 +02:00
Piotr Fusik
b31ae57be1 Make some arrays const. 2017-06-28 20:43:31 +02:00
Greg King
d3ccc289c1 Stopped cc65 from putting redundant .segment directives into its Assembly output. 2017-06-16 21:53:50 -04:00
Oliver Schmidt
682fd226ae Merge pull request #442 from polluks/patch-6
Use verbosity
2017-06-03 22:06:27 +02:00
Stefan
80feb80168 Update main.c 2017-05-28 16:17:34 +02:00
Stefan
49e22f566f Update main.c 2017-05-28 15:29:49 +02:00
Stefan
ea9430e28e Update list.c 2017-05-28 15:22:33 +02:00
Stefan
c9c2562c14 Update list.c 2017-05-28 15:13:43 +02:00
Stefan
843c5442b1 Update list.c 2017-05-28 13:13:53 +02:00
Stefan
9bdcb0a31b More POSIX.2, staying compatible 2017-05-28 00:35:38 +02:00
Stefan
ff33939385 Use verbosity 2017-05-28 00:29:53 +02:00
Oliver Schmidt
1bbe7043e1 Merge pull request #426 from MonteCarlos/master
added -E switch to cl65 for >>stop after the preprocessing stage<<.
2017-05-24 09:44:24 +02:00
mc78
f87a575d4d added missing spaces before braces. added unknown option msg if not given -Wc|l|a when passing options to subprocess 2017-05-23 22:57:27 +02:00
mc78
21b1add984 added four escaped tabs to -E Stop after .... description 2017-05-22 23:21:55 +02:00
mc78
3157e4be1e added empty lines and spaces according to olivers comments. Made local functions static. 2017-05-22 23:07:31 +02:00
Oliver Schmidt
1c54213091 Merge pull request #433 from clbr/trampoline-fixes
Trampoline fixes
2017-05-20 12:29:10 +02:00
Lauri Kasanen
e8a735492d Correct comment style 2017-05-19 15:38:50 +03:00
Lauri Kasanen
901ac80026 Wrapper functions use all registers 2017-05-19 15:25:50 +03:00
Oliver Schmidt
16a2beaaca Adjusted VS project files to commit 11b01b908d 2017-05-18 22:40:18 +02:00
Oliver Schmidt
11b01b908d Merge pull request #424 from clbr/trampoline
Trampoline support
2017-05-18 16:29:34 +02:00
Lauri Kasanen
219b239a34 Adjustments in response to latest comments 2017-05-18 17:14:26 +03:00
Lauri Kasanen
4c05c46cd1 Remove RAM-trampoline array support 2017-05-18 16:11:39 +03:00
Lauri Kasanen
f6fa74a636 Rename trampoline to wrappedcall everywhere 2017-05-18 16:00:04 +03:00
Lauri Kasanen
7feced8862 More tabs to spaces 2017-05-18 15:54:47 +03:00
Lauri Kasanen
a590b99f5b Align with spaces instead of tabs here 2017-05-18 14:21:43 +03:00
Oliver Schmidt
390ee4e22f Merge pull request #429 from pfusik/opt-stdfunc
Optimize the inlined strlen/memcpy/memset
2017-05-17 22:58:54 +02:00
Oliver Schmidt
f151142e6a Keep GCC from complaining about 'List' may be used uninitialized in this function. 2017-05-17 19:39:02 +02:00
Oliver Schmidt
298dda0e71 Increased GCC optimization level. 2017-05-17 18:30:35 +02:00
Piotr Fusik
675dd3c963 Optimize the inlined memcpy/memset for the sizes of 128/129. 2017-05-17 10:08:08 +02:00
Piotr Fusik
6011bdb2f6 Optimize the inlined strlen. 2017-05-17 10:00:35 +02:00
Lauri Kasanen
ca41af41c2 Rename pragma trampoline to wrapped-call, value to identifier 2017-05-16 20:10:24 +03:00
mc78
d70a9507a7 replaced tabs with spaces which accidently were introduced. 2017-05-16 13:31:10 +02:00
mc78
691df09a1f According to recent comments on my recent pull request, -Wc checking for -E flag has been removed again. Intead, -E flag has been added to cl65 without need of -Wc. Two functions have been introduced to disable compile, link or both. These function remove assigment repetions to DoAssemble and DoLink for litte overhead, having the maintainability in mind. 2017-05-16 13:13:09 +02:00
mc78
4cbfb4e199 added -E switch to cl65 for >>stop after the preprocessing stage<<.
added compilation and assemblation disable after -Wc -E also with -E beeing part of a comma separated list of arguments
2017-05-12 12:23:30 +02:00
Lauri Kasanen
a2f61c667a Update comments and location checks according to Greg 2017-05-07 20:31:41 +03:00
Lauri Kasanen
ead0338c0d Add fast path for char postdec 2017-05-06 13:35:39 +03:00
Lauri Kasanen
767f093ff8 Add fast path for char postinc 2017-05-06 13:35:39 +03:00
Lauri Kasanen
2890b3a810 Pragma trampoline 2017-05-02 20:51:53 +03:00
Lauri Kasanen
d091a57e91 Trampoline stack 2017-05-02 20:43:41 +03:00
Lauri Kasanen
679bfb0ae9 Add IntPtrStack 2017-05-01 21:08:04 +03:00
Oliver Schmidt
18b0aaf9f2 Removed help for non-existent option. 2017-04-15 23:12:19 +02:00
Greg King
1aab287189 Fixed the handling of "while (0) {}".
It's a corner case; but, conditional macroes might create it -- better safe than sorry.
2017-04-07 09:26:58 -04:00
Oliver Schmidt
be772c0198 Bumped version.
As suggested the incompatibility resulting from 02daf9f8b5 makes a new version appropriate.
2017-04-06 12:22:39 +02:00
Greg King
dce5783dc9 Fixed the simulations of the stack pointer and the "break" and decimal-mode flags.
* The pointer wraps around the stack page.
* The break flag exists on only the stack, and only after an interrupt.
* 65C02 interrupts clear the decimal-mode flag.
2017-04-04 13:23:44 -04:00
Oliver Schmidt
02daf9f8b5 So far the built-in inlining of several known standard function was always (!) enabled and the option -Os enabled additional, potentially unsafe inlining of some of those functions.
There were two aspects of this behavior that were considered undesirable:
- Although the safe inlining is in general desirable it should only be enabled if asked for it - like any other optimization.
- The option name -Os implies that it is a safe option, the potentially unsafe inlining should have a more explicit name.

So now:
- The option -Os enables the safe inlining.
- The new option --eagerly-inline-funcs enables the potentially unsafe inlining (including the safe inlining).

Additionally was added:
- The option --inline-stdfuncs that does like -Os enable the safe inlining but doesn't enable optimizations.
- The pragma inline-stdfuncs that works identical to --inline-stdfuncs.
- The pragma allow-eager-inline that enables the potentially unsafe inlining but doesn't include the safe inlining. That means that by itself it only marks code as safe for potentially unsafe inlining but doesn't actually enable any inlining.
2017-04-03 23:20:26 +02:00
Oliver Schmidt
cbb2833c01 Merge pull request #414 from IrgendwerA8/SED_Fix
Fixed sim65 SED
2017-03-30 12:26:37 +02:00
IrgendwerA8
170d96898f Fixed SED 2017-03-30 12:17:29 +02:00
Oliver Schmidt
5dbacb538e Merge pull request #411 from pfusik/bss-name-regression
Fix regression of #pragma bss-name
2017-03-22 13:44:48 +01:00
Piotr Fusik
8e35a82c91 Fix regression of #pragma bss-name
Closes #409
2017-03-21 22:35:25 +01:00
Oliver Schmidt
669113b595 Added missing line continuation.
Fixes https://github.com/cc65/cc65/issues/408
2017-03-21 20:45:51 +01:00
IrgendwerA8
cc82cd9992 Fixed addressing error for TSB/TSR and enabled tests again. 2017-03-20 21:53:07 +01:00
Oliver Schmidt
3a30669ff6 Merge pull request #405 from IrgendwerA8/65SC02_sim65_support
Added 65SC02 support for simulator.
2017-03-18 23:38:05 +01:00
IrgendwerA8
e14e13abf4 fixed curly brackets for single line scopes 2017-03-18 22:52:13 +01:00
IrgendwerA8
ad003e5991 style changes 2017-03-18 20:27:41 +01:00
IrgendwerA8
0985655ac7 Fixed bug in original sim65 implementation (reason for C&P error in last commit) 2017-03-18 17:02:22 +01:00
IrgendwerA8
c50e4d25e2 additional fix for scrambled code (sorry) 2017-03-18 16:56:36 +01:00
IrgendwerA8
4ba34f2a69 fixed scrambled semicolon 2017-03-18 16:54:00 +01:00
IrgendwerA8
360372420b Added 65SC02 support for simulator. 2017-03-18 16:37:15 +01:00
Greg King
750a527100 Made C's sizeof operator work with initialized void variables.
Added regression tests that check cc65's handling of void variables.
2017-03-12 14:41:32 -04:00
Oliver Schmidt
a780df1fe1 Merge pull request #381 from pfusik/static-forward-decl
"static" forward declarations
2017-03-12 18:26:14 +01:00
Piotr Fusik
d2c89d2ba9 "static int n; int n;" is an error.
Fixes test/err/static-4.c regression.
2017-03-09 19:14:31 +01:00
Piotr Fusik
5988ec37cd Revert "Disallow global variable declarations with an initializer."
This reverts commit 1f12a06f7c.
2017-02-15 18:51:27 +01:00
Christian Groessler
a5fba551d1 Merge remote-tracking branch 'upstream/master' into something_to_pull2 2017-02-13 21:38:38 +01:00
Piotr Fusik
31f19fbc65 Issue an error for duplicate global variables.
Previously it was an assembler error.
2017-02-13 21:10:21 +01:00
Piotr Fusik
730d01a25f Global uninitialized variable is only a tentative definition.
Closes #204
2017-02-13 21:04:45 +01:00
Piotr Fusik
1f12a06f7c Disallow global variable declarations with an initializer.
E.g.
extern int i = 42;
2017-02-13 19:41:05 +01:00
Greg King
7e8bb7b700 Fixed ca65's BRK instruction encoding for the 65816.
BRK is two bytes on all 6502 variants; but, the 65816's maker declared officially that assemblers should support an optional operand.
2017-02-12 14:54:57 -05:00
Oliver Schmidt
5bbf010029 Merge pull request #371 from jedeoric/master
Create an Oric Telestrat target library
2017-02-10 23:47:13 +01:00
jede
9cde534b23 Rollback for *.vcxproj, telestrat.sgml modified for "don't" instead of "did not" for telemon2.4 2017-02-09 18:46:56 +01:00
Christian Groessler
a08f905224 Cleanups for Creativision. 2017-02-01 20:09:03 +01:00
Christian Groessler
07f840f11c Merge remote-tracking branch 'upstream/master' into creativision 2017-02-01 18:15:05 +01:00
jede
b5fef66f37 Merge telemon24 and telemon30 into telestrat target.
Cleaning, and replace tab to spaces
Converting hex lowercase value into uppercase char.
Changing := and = when it was needed
2017-01-31 22:09:14 +01:00
jede
858e952505 Fix 2017-01-29 23:05:18 +01:00
jede
db3b6603e5 Fix 2017-01-29 23:03:01 +01:00
jede
bd82bf6a7f Fix 2017-01-29 22:59:53 +01:00
jede
e21eca942b new pull fix 2017-01-29 22:55:35 +01:00
jede
2697499b3c Fixing old pull request 2017-01-29 22:53:50 +01:00
jede
0f8fb4d79d Merge with current version 2017-01-29 22:39:51 +01:00
Florent Flament
c1aac0de0e Add C support for Atari 2600 (VCS) 2017-01-13 21:12:22 +01:00
Chris Cacciatore
66b30f0c7a Added 'any' to --list-opt-steps. 2016-12-15 09:06:15 -08:00
jede
252e4afb9c Adding files for telemon30 2016-12-14 21:22:10 +01:00
Peter Ferrie
8a08413263 fix build break on da65 2016-12-03 20:54:14 -08:00
Alan Cox
e4aee2ba34 cc65: remove un-needed logic from octal parsing
We no longer need the extra error handling logic for octal parsing so simplify
it as requested by Greg King.

Signed-off-by: Alan Cox <etchedpixels@gmail.com>
2016-11-20 18:02:45 +00:00
Alan Cox
6ee1fd2a67 scanner: Correct handling of \0101
The C language has this oddity that octal constants are 3 bytes so the sequence
"\0101" is two bytes and well defined by the langage. cc65 currently misparses
this as a 1 byte octal code. Add a count to fix this.

Signed-off-by: Alan Cox <etchedpixels@gmail.com>
2016-11-19 13:02:19 +00:00
Sven Oliver Moll
2d76d0a657 da65: 4510 support
- cleaned up unnecessary static function
- adjusted table formatting
2016-09-23 13:10:38 +02:00
Sven Oliver Moll
d0ed84c2d0 da65: adding support for 4510 cpu of c65 2016-09-20 17:37:10 +02:00
Sven Oliver Moll
ae3f9bbd77 Added assembler pseudo commands .P4510 and .IFP4510 together with docs and testcase 2016-09-07 19:21:24 +02:00
Christian Groessler
3531bcbf3e Fix some typos. 2016-09-06 15:13:44 +02:00
Greg King
4b2e3be2fc Fixed some bugs in da65's HuC6280 section. 2016-09-02 14:24:29 -04:00
Oliver Schmidt
9c38521ea8 Merge pull request #343 from SvOlli/release
Add 4510 support for C65/C64DX
2016-08-31 22:05:49 +02:00
Sven Oliver Moll
48f64de720 4510 support: yet another round up little updates 2016-08-31 20:18:54 +02:00
Sven Oliver Moll
4384603eeb 4510 support: added some other small improvements:
- fixed typo in doc/ca65.sgml
- Greg found a way to get rid of one extra opcode handling in total
2016-08-30 22:58:40 +02:00
Sven Oliver Moll
91f8e09bcc 4510 support: fixed some cosmetical stuff and documentation 2016-08-29 23:29:31 +02:00
Sven Oliver Moll
0538184699 Add 4510 support for C65/C64DX 2016-08-29 10:45:18 +02:00
Greg King
1dee57bf1f Made cc65 not warn us when we change character code 0x00 back to itself. 2016-08-26 08:08:44 -04:00
Chris Cacciatore
e9295b2a98 Updated comment regarding curly braces. 2016-08-20 09:42:29 -07:00
Chris Cacciatore
7919812378 Updated switch statement comments.
* Now comments represent the fact that there may not be curly braces.
2016-08-19 20:21:10 -07:00
Chris Cacciatore
3bd3fd8749 Removed check for LCURLY in switch statements. 2016-08-15 11:03:02 -07:00
Chris Cacciatore
bad8412131 All programs print version and exit successfully.
* All programs are now using the ProgName variable as well.
2016-08-12 08:54:41 -07:00
Chris Cacciatore
f9482a1b72 Fixed test negation. (#329)
Fixed test negation.
2016-08-09 15:46:51 -04:00
Oliver Schmidt
d90dff5861 Merge pull request #328 from cacciatc/print-sym-name-incompatible-ptr-types
Reporting sym name for incompatible pointer types.
2016-08-05 13:31:34 +02:00
Greg King
33b1d82791 Added the WDC65c02S WAI and STP mnemonics to the disassembler. 2016-08-02 16:38:39 -04:00
Chris Cacciatore
9accf983e1 Reporting sym name for incompatible pointer types. 2016-08-02 11:31:09 -07:00
David M. Lloyd
8f0146f14a Add missing WDC instructions 2016-07-28 11:55:25 -05:00
Christian Groessler
85d755f214 fix indentation 2016-07-05 17:10:10 +02:00
Christian Groessler
97b517a892 sim65: add command line parameter to print number of CPU cycles at exit 2016-07-05 17:07:39 +02:00
Greg King
a6eb7d0763 Fixed how ca65 handles some debug info from cc65.
ca65 used to claim that an assembler error/warning was found on a C code line; and, that an Assembly line is only indirectly related to it.
Now, ca65 says that the Assembly line has the problem; and, that the Assembly line was produced from the C line.
2016-07-03 07:07:09 -04:00
Greg King
90b2f5aff8 Fixed some code that adjusts an index after a deletion from a collection. 2016-07-02 10:26:33 -04:00