1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-10 13:29:50 +00:00
Commit Graph

97 Commits

Author SHA1 Message Date
Jeff Tranter
ba13ba32a1 Fix some commonly made spelling errors in comments. 2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
e35f4fb48f 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-07-21 03:18:13 +02:00
Greg King
800568dd58 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-07-21 03:18:13 +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
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
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
JT
55adf03bdf Move FuncIsMnemonic 2015-07-11 19:09:42 -04:00
JT
e7fca18798 Added .DEFINEDMACRO psuedo function
Fixed typo/fomatting

Formatting fix

Refactor the code to test for a macro

Remove .FEATURE requirement for .DEFINEDMACRO
2015-06-27 01:39:11 -04:00
JT
1e3234f370 changed name of function to .ISMNEMONIC, small fixes 2015-05-19 19:50:51 -04:00
JT
9ee5adc190 Remove .FEATURE requirement and add documentation 2015-05-19 00:06:12 -04:00
JT
5ed3a1a6dc Added pseudo function .DEFINEDINSTR 2015-05-12 19:28:57 -04:00
JT
ffa52863b3 Small changes to coding style and to ca65 documentation for .ADDRSIZE 2015-04-21 16:09:01 -04:00
JT
dfddf8f9d2 Improved on funciton .ADDRSIZE. Conform to coding style. 2015-04-20 17:20:54 -04:00
JT
c6f45a338c Added function .ADDRSIZE to ca65 2015-04-19 23:21:56 -04:00
Greg King
0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt
4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Oliver Schmidt
85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
Oliver Schmidt
365668785c Allow for warning-free build of ca65 with MS VC on warning level 3. 2013-04-08 00:11:08 +02:00
uz
43ea0e3df9 Move evaluation of the argument for .BANK into the linker. It is otherwise too
restricted, since no imported symbols may be used.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5746 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-06-30 17:18:03 +00:00
uz
7ecb4c50b1 Add bounded expressions for immediate addressing and list the new feature in
the docs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5406 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-18 19:50:34 +00:00
uz
e7e4877e6e Mark segments that are referenced in a .BANK statement.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5383 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-04 22:15:47 +00:00
uz
9e68be3842 Started to add a new .BANK instruction that allows access to a memory area
attribute named "bank". Some error checks and a lot of testing is required.
Don't use for now.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5375 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-03 21:41:34 +00:00
uz
6e32190cae A few measures to create slightly smaller object files.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5165 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-14 20:06:14 +00:00
uz
ca0877adb6 Fixed an error in the special purpose allocator in expr.c.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5109 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-02 16:46:47 +00:00
uz
ddb7296b6c Move all attributes and other information that is attached to a token into a
structure named Token.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4910 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-01-16 16:05:43 +00:00
uz
dbfae85f54 Renamed the Token enumeration to token_t.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4909 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-01-16 14:51:13 +00:00
uz
3f24c88355 SegNum has been renamed to SecNum.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4845 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-10 10:22:55 +00:00
uz
c921c409e8 Rename symbol index => import id because that's what it really is.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4809 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-17 20:01:54 +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
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
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
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
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
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
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
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
476e3f9acc Fixed a bug in FuncStrAt. New shortcut function GenLiteral0().
git-svn-id: svn://svn.cc65.org/cc65/trunk@3605 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-08-30 19:40:43 +00:00
cuz
945bbe2b50 Added variable symbols using .set
git-svn-id: svn://svn.cc65.org/cc65/trunk@3510 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-05-11 08:31:42 +00:00
cuz
27b5721cf6 Allow a unary +
git-svn-id: svn://svn.cc65.org/cc65/trunk@3371 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-01-21 12:57:41 +00:00
cuz
b10b7cd3e8 Fixed a problem with {} enclosed token lists and implemented them for
.blank and .tcount.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3014 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-09 20:24:51 +00:00
cuz
fdb685b874 Allow token lists to be optionally enclosed in curly braces. Using such
enclosement, tokens that would otherwise terminate the list can be part
of the list.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3013 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-09 19:45:07 +00:00
cuz
95c0fb6e0b Removed an unused assignment
git-svn-id: svn://svn.cc65.org/cc65/trunk@2872 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-01-04 21:35:38 +00:00
cuz
6d49e06fa2 Fixed a few bugs
git-svn-id: svn://svn.cc65.org/cc65/trunk@2860 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-30 22:42:49 +00:00
cuz
9dad608bc9 Use the WORD0 expression op instead of AND
git-svn-id: svn://svn.cc65.org/cc65/trunk@2732 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-12 16:02:30 +00:00
cuz
fd102deb77 New pseudo functions: .LOBYTE, .HIBYTE, .BANKBYTE, .LOWORD, .HIWORD
git-svn-id: svn://svn.cc65.org/cc65/trunk@2731 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-12 15:59:44 +00:00
cuz
54a50d9354 Code cleanup
git-svn-id: svn://svn.cc65.org/cc65/trunk@2728 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-12 12:59:10 +00:00
cuz
87857eced3 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2720 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-06 14:44:16 +00:00
cuz
92a001d3af Fixes for scoping and better .sizeof support
git-svn-id: svn://svn.cc65.org/cc65/trunk@2706 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-03 10:13:41 +00:00