1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-28 03:29:39 +00:00
Commit Graph

668 Commits

Author SHA1 Message Date
mrdudz
b6ffa4af64 Fix endless loop on expanding a recursive macro, fixed issue #1678, patch by kugelfuhr 2022-05-09 21:26:45 +02:00
rofl0r
d78672a4b4 rename AddSubSearchPathFromWinBin to AddSubSearchPathFromBin 2022-04-28 18:35:05 +00:00
mrdudz
7c7c5af59f Merge remote-tracking branch 'upstream/master' into constexpr 2022-04-26 16:43:10 +02:00
rofl0r
bf1ef6157c build: properly quote strings passed as cpp macros
until now, the strings intended to be hardcoded into the binary,
such as directory names and build id, were passed unquoted, which
means they're interpreted by the preprocessor as C tokens, rather
than strings, which can result in all sorts of "interesting"
behaviour such as interpreting paths starting with // as C++-style
comment.
this was then worked around using a stringize macro which turned
the tokens into a string (if they happened to be in a compatible
format).

adresses #1726
2022-04-25 16:52:46 +00:00
mrdudz
23831f08de const value should never have default size, use 32bit instead 2022-04-21 14:50:48 +02:00
mrdudz
a0280d4917 Also handle the case when the non constant side of the AND expression is
known to have a smaller size than the constant side of the expression.
2022-04-20 12:53:34 +02:00
mrdudz
f64bf76ae8 special case for evaluating the AND operator, this should fix the problems
described in issue #1538
2022-04-20 00:13:34 +02:00
mrdudz
8d0098b818 more descriptive error message 2022-04-20 00:12:03 +02:00
mrdudz
89fcb0d404 typo 2022-04-20 00:11:24 +02:00
mrdudz
3c1bb85b8e remove dangling spaces 2022-04-17 16:07:09 +02:00
Karri Kaksonen
3266e70de4 Add target atari7800 2022-03-01 06:44:55 +02:00
Jeff Tranter
2bf8be5b3b Fix some commonly made spelling errors in comments. 2022-02-21 15:44:31 -05:00
Spiro Trikaliotis
364e72921c ca65: .constructor after .export fails
The actor directives (.constructor, .destructor, .interruptor, and .condes)
can't handle a symbol that's already exported.

The relevant code does the checks in the wrong order.

For example, the following correct snippet does not assemble:

        .export         C
C:      .constructor    C, 5

The assembler outputs: test.s:2: Error: Address size mismatch for symbol 'C'

Exchanging both lines makes it work.

This fixes #1647; the patch is provided by 'kugelfuhr' and taken from there.
2022-02-15 22:03:47 +01:00
Spiro Trikaliotis
3d0013ab30 Invalid flagged errors if token is missing
A missing factor in an expression causes an expected but missing token
to be skipped, leading to invalid flagged errors in the following line:

l = 3 +
lda     #$00

An error should be output for line 1, but not for line 2. Actually, both
are flagged as errors:

test.s(1): Error: Syntax error
test.s(2): Error: Unexpected trailing garbage characters

This patch (as proposed in issue #1634 by kugelfuhr) fixes this.
2022-02-15 21:46:07 +01:00
Greg King
86b6514c16 Added code that avoids infinite loops that were caused by circular references
(a symbol that was defined by referring to itself directly or indirectly).  Patch by kugelfuhr.
2022-02-13 07:38:00 -05:00
Bob Andrews
122461a08c
Merge branch 'master' into pr-1056 2021-12-11 22:36:51 +01:00
Oliver Schmidt
8b0de8a931
Merge branch 'master' into master 2021-11-23 22:56:51 +01:00
Wayne Parham
69e2313a63 First round of requested code changes 2021-06-06 23:20:54 +01:00
Greg King
d14148ab4f Restricted commit b9a3c78888 to classic-style Assembly macros.
.include will work at expansion-time for .define macros.
2021-05-17 19:48:47 -04:00
WayneParham
e9fd87d07a
Merge branch 'master' into master 2021-05-16 10:02:37 -05:00
Andrea Odetti
bcc670ee36 Standard formatting of error messages.
https://www.gnu.org/prep/standards/html_node/Errors.html

Issue: https://github.com/cc65/cc65/issues/1494
2021-05-11 17:41:59 +02:00
Wayne Parham
f81aefe8bd Synertek Systems Sym-1 config files 2021-05-09 17:13:24 -05:00
Marco Aurelio da Costa
04cd884f8f Prevent missed .ENDMACRO in included file 2021-05-02 14:17:11 +02:00
Marco Aurelio da Costa
b9a3c78888 Parse file included inside a macro at definition time 2021-05-02 14:17:11 +02:00
Evgeny Vrublevsky
8e02f8f5ec Add .REFTO as an alias to .REFERTO. Update the docs related to it. 2021-04-29 07:55:43 -04:00
Evgeny Vrublevsky
50a58e7706 Added documentation for the .REFERTO. 2021-04-29 07:55:43 -04:00
Evgeny Vrublevsky
83e7c37277 Use .REFERTO instead of .REF as the command. 2021-04-29 07:55:43 -04:00
Evgeny Vrublevsky
e9a72b2462 Add .REF control command implementation. 2021-04-29 07:55:43 -04:00
Oliver Schmidt
5d84a4ba13 Removed non-ASCII chars. 2021-04-19 16:06:10 +02:00
Oliver Schmidt
f272bc8f42 Removed non-ASCII chars. 2021-04-19 15:50:52 +02:00
Marco Aurelio da Costa
fd3d5d35fb mc: Implemented .LITERAL 2021-04-19 15:42:29 +02:00
Marco Aurelio da Costa
c915b5d7f3 Implemented charmap stack
New commands:
 .PUSHCHARMAP: will push the current charmap state into an internal stack
 .POPCHARMAP: will restore the current charmap to the last pushed charmap

Details:
  The push and pop facilities are implemented directly inside the tgttrans.h,
  to facilitate its reuse on the C compiler.
2021-04-18 20:39:05 +02:00
Zsolt Branyiczky
63543dee07 Revert transient modification of EATab Table 0 comment 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
0e98818db5 assembled SAC and SIR opcodes of 6502DTV cpu were wrong 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
130d3b52a2 new macros supporting 6502DTV cpu 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
0f7cf87bfa Synchronizin InsTab6502DTV instructions table for DTV with the illegal opcodes verified by VICE-emu tests 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
92c013944e Mistyped comment, missing comma 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
b33b053307 add c64dtv support 2020-11-15 16:35:55 +01:00
Greg King
c05a750f47 Fixed some copy-&-paste typo mistakes about HuC6280's TMA mnemonic. 2020-10-01 07:25:08 -04:00
laubzega
477adc23fb Fix #1056. 2020-06-30 20:36:13 -07:00
Greg King
f8be35b41e Fixed some typos in the "large alignment" support. 2020-05-15 21:09:02 -04:00
Greg King
5109c0b68f Made ca65 give error messages when it sees duplicate .define commands. 2020-01-02 04:26:02 -05:00
Greg King
3fa253d31f Updated the cx16 library to the Commander X16 Kernal's prerelease 35. 2019-12-25 10:56:32 -05:00
Greg King
18afc7c703 Created a target and a library for the Commander X16 prototype computer. 2019-09-27 03:38:51 -04:00
Greg King
0896deedef Added a .ORG keyword to ca65 structs/unions.
Allow 24-bit numbers as operands in ca65 structs/unions.
2019-09-11 19:00:08 -04:00
bbbradsmith
9299e550a5 fix NearAddr case in comment 2019-05-11 12:32:44 +02:00
bbbradsmith
10cefdb456 move EXPR_NEARADDR to end of enum list to avoid invalidation of existing object binaries? 2019-05-11 12:32:44 +02:00
bbbradsmith
ac2ecb0b2c 65816 now generate EXPR_NEARADDR instead of EXPR_WORD0 for default assumed address mode, which will be validated by the linker's range check rather than blindly truncated. Assuming the assembler correctly validated this, the linker is allowed to truncate. 2019-05-11 12:32:44 +02:00
Olli Savia
f95481fabf Fixed gcc compiler warning (#867)
* Changed spelling FALLTHRU -> FALLTHROUGH
2019-03-30 16:09:16 -04:00
Oliver Schmidt
cd72f816d3
Merge pull request #829 from inexorabletash/string-escapes
ca65: Add string_escapes feature. Resolves #535
2019-01-20 21:58:06 +01:00
Greg King
a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
Joshua Bell
c8bf652982 ca65: Add string_escapes feature. Resolves #535 2019-01-05 11:29:54 -08:00
Greg King
554448a1f1 .byt "" emits no data; avoid a ca65 crash.
Fixes #775 on GitHub.
2018-10-20 13:41:52 -04:00
Stefan
b93b88211c WDM support (#721)
WDM support
2018-08-19 10:29:25 -04:00
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
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
Michael Kohn
5ecd902fbf The opcode for BS should be 0x0C. 2018-05-13 06:31:05 -05:00
Piotr Fusik
b31ae57be1 Make some arrays const. 2017-06-28 20:43:31 +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
18b0aaf9f2 Removed help for non-existent option. 2017-04-15 23:12:19 +02:00
Christian Groessler
a5fba551d1 Merge remote-tracking branch 'upstream/master' into something_to_pull2 2017-02-13 21:38:38 +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
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
jede
252e4afb9c Adding files for telemon30 2016-12-14 21:22:10 +01: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
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
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
David M. Lloyd
8f0146f14a Add missing WDC instructions 2016-07-28 11:55:25 -05: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
573381a340 Allowed character code zero to be remapped with other character codes. 2016-06-11 06:43:19 -04:00
Oliver Schmidt
ab1600b346 Merge pull request #269 from jbrandwood/squarebracket
New ".feature" to use brackets instead of parens for 6502 indirect addressing.
2016-03-03 09:07:21 +01:00
mrdudz
0dc85268c4 fix merge fxxxup 2016-02-28 19:11:04 +01:00
Oliver Schmidt
54e09fdd03 Added basic frame for new target 'creativision'.
Kym Greenshields <kym.greenshields@gmail.com> has expressed interest
in contributing and maintaining support for the VTech CreatiVision system.

this resembles commit 8e6b8dd0af from oliver
2016-02-28 19:05:40 +01:00
Bob Andrews
25f4482641 Merge pull request #238 from mrdudz/gamate
Bit Corporation 'Gamate' support
2016-02-27 18:44:26 +01:00
John Brandwood
d23db09f7f Add optional feature to use brackets instead of parens for 6502 indirect addressing. 2016-02-25 12:40:31 -08:00
Greg King
7a39b85e30 Fixed how ca65's CONDES-type pseudo-instructions save line numbers (for error messages). 2016-01-15 17:18:09 -05:00
mrdudz
8a499fdf4e fixup conio.c some more. also includes merge of upstream/master because git is retarded. 2015-12-02 00:13:32 +01:00
f
4dc4ea60ee Implemented escaping of spaces in ca65 dependency files. Largely based on input.c from cc65 (WriteEscaped was copied verbatim). 2015-11-26 19:00:47 +02:00
Greg King
3c8c62c6ab Fixed the ca65 Assembly-code variable ".paramcount".
Fixed how it's described in the ca65 document.
2015-11-17 14:21:40 -05:00
mrdudz
60285097e3 initial import of the gamate stuff 2015-11-14 13:15:29 +01:00
Marcus Rowe
25e0b157be Fixed code style 2015-10-24 01:07:47 +10:00
Marcus Rowe
67cd0c2197 Added .asize and .isize pseudo variables
These pseudo variables will return the size of the accumulator/index
in bits.

For the 65816 instruction set .ASIZE/.ISIZE will return either 8 or 16,
depending on the current size of the operand in immediate addressing
mode.

For all other CPU instruction sets, .ASIZE/.ISIZE will always return 8.

For example:

	; Reverse Subtract with Accumulator
	; A = memory - A
	.macro rsb param
		.if .asize = 8
			eor	#$ff
		.else
			eor	#$ffff
		.endif
		sec
		adc	param
	.endmacro
2015-10-20 09:30:25 +10:00
mrdudz
d0a1dc73b8 Merge remote-tracking branch 'upstream/master' into pcenginetarget 2015-09-04 13:40:52 +02:00
JT
cacc5e2ace Style again 2015-07-20 19:16:48 -04:00
JT
10579d0421 Fix style 2015-07-20 19:12:30 -04:00