ATasm version History:
==============================================================================
Jan 1,1999
  version 0.90 - initial public release

Jan 11,1999
  version 0.91 - added '-x' command-line option, providing initial .XFD
		 support

Jan 14,1999
  version 0.92 - added '-u' command-line option, enabling illegal opcodes

Oct 19,1999
  version 0.93 - fixed a bug with indirect jmp opcode, removed some spurious
		 warnings generated by the .DC directive.

November 10,1999
  version 0.94 - fixed embedded ';' in strings, jmp to zero page locations,
                 mapped 'LDA/STA zero,y => LDA/STA a,y to emulate Mac/65
	         behavior, a few minor updates to this document

January 15,2001
  version 0.95 - fixed a bug in .incbin that would append an extra byte,
                 compiled DJGPP version with new GCC 2.95.2; updated
                 cwsdpmi.doc/cwsdpmi.exe/emu387.dxe to more modern versions

May 25,2002
  version 0.96 - fixed a bug with missing the final line in a file, added 2
                 new .OPT directrives;  compiled with new DJGPP version GCC 3.1
                 for added Windows 2k/XP support

May 27,2002
  version 0.97 - fixed a rather unfortunate bug with .INCBIN introduced
                 in last release

June 15,2002
  version 1.00 - added new mappings for several zero,y to absolute,y
                 instructions;  fixed quoted immediate commas, fixed several
                 bugs related to macros and rept blocks

June 21,2002
  version 1.01 - added new raw binary ouput option; fixed some zero,y instructions

August 13,2002
  version 1.02 - added include path and define command-line options, new .OPT
                 directive enabling illegal opcodes, fixed a bug with data
                 commands emiting code without a set origin;

March 3,2003
  version 1.03 - added mapping for zero page JSR, enforce label name restrictions,
                 added interpretation of #$LABEL (with warnings);

August, 2003
  version 1.04 - fixed some serious problems with macro expansion, added
                 fill byte command-line parameter, limited display of
                 errors and warnings to one pass only, initial support
                 of multiple passes to prevent the dreaded "PHASE
                 ERROR", fixed problem with command-line definitions

October 10, 2003
  version 1.05 - added new directives .BANK, .SET 6, and .OPT LIST/NO LIST;
                 Preliminary support for .ATR disk images and the Atari++
                 emulator memory snapshots;

March 17, 2009
  version 1.06 - allow negative offsets with .SET 6 directives; allow arithmentic
                 expressions in REPEAT blocks;  Better detection of resized labels;
                 Fixed a buffer overflow problem; Added -l option to allow label output;
                 Compiling Windows executable with mingw

September 21, 2011
  version 1.07 - Introduced .BANKNUM operator; Allow .SET 6 to forward reference labels;
                 Allow leading underscores in label names; Fixed an error with command-line
                 defines; Allow character quoting of spaces and semicolons;  Allow comments
                 to start without a preceding  space.  Fixed local label references inside
                 of macros or macro parameters.

May 26, 2014
  version 1.08 - Initial support of list files with -g command-line parameter; Allow .INCBIN
                 to honor include paths; Missing state files no longer segfault;  Double-forward
                 defines now throw an error rather than silently generate bad code
March 20, 2021
  version 1.09 - Fixed a problem with filename creation when saving output to an ATR image;
                 Fixed CVE-2019-19785: Stack-based buffer overflow in the to_comma() function;
                 Fixed CVE-2019-19786: Stack-based buffer overflow in the parse_expr() function;
                 Fixed CVE-2019-19787: Stack-based buffer overflow in the get_signed_expression() function;

May 10, 2021
  version 1.10 - Fixes absolute address calculation in the case of lda abs,x
                 If the address was undefined but used an offset like (here+1) the code would
                 place the address into page 0.
                 Fixed a buffer overflow in aprintf()

May 14, 2021
  version 1.11 - Fixes buffer overrun in put_float().
                 Changes the output format of the list command slightly to allow source level
                 debugging in the Altirra emulator.  The list file has to start with "mads "
                 Adds support to pass Altirra specific ;##TRACE and ;##ASSERT commands from
                 the source code to the listing file (to be read and interpreted by Altirra)

Nov 28, 2021
  version 1.12 - When listing an assembly via the -g command line parameter, labels not defined on
                 the same line as an operand where not output at all.  This version outputs the 
                 label in its original name (in all caps).
                 SomeLabel:
                 lda #0
                 Will output as "SOMELABEL lda #0"

Nov 30, 2021
  version 1.13 - Added CC65 header and assembler include file generation switches.
                 Switch -hc dumps all equates and labels into a C-style header file. Useful
                 when interfacing with CC65. Each #define is prefixed with the basename of the
                 assembler file. atasm -hc test.asm will create "test.asm.h" with #define TEST_...
                 Switch -ha dumps all equates and labels into an atasm style include file.
                 Both -hc and -ha switches can have their output filenames specified by the switch
                 or if left out auto-generated by atasm.
                 -hcmy-project.h -hamy-project.inc will generate "my-project.h" and "my-project.inc"
				 
Dec 2, 2021
  version 1.14 - Improved the source file and line # tracking for equate and label definitions.
                 The -hc and -ha switches now dump detailed info on which file and on which line the definition occurred.
                 -hc and -ha dumps sort their output by the address and not alphabetically.
                 Added support for labels with '.' in them.
                   cio.cmd .byte 0
                   cio.len .byte 0
                 are now valid labels.
                 Fixed some Linux compile warnings.

Dec 21, 2021
  version 1.15 - Added -hv switch to dump all equates, labels, macro defs and included source files to 
                 the 'plugin.json' file located at the root folder from where atasm starts searching for
                 source files.  This is to be used by the Atasm-Altirra-Bridge VSCode plugin to allow you to 
                 quickly jump to your code.
                 Added modulo/remainder operator. %% or .MOD
                 You can now say '.byte 15%%10' and it will store the value of 5.

Dec 22, 2021
  version 1.16 - Added the << and >> shift operators to the expression parser.
                 Code like this now assembles:
                 lda #1<<4
                 Fixed a bug in .LST output generator.  Filenames were not tracked correctly which caused source lines
                 to be allocated to the wrong source file.  Thank you to Lars Langhans for reporting this.
Feb 2, 2022
  version 1.17 - Extended the -hv[clm] option. You can now limit the data export to (c)onstants, (l)abels and (m)acros.
				 Or any combination of them. -hvcl exports constants and labels. By default all data is exported.
				 Used by the "Atasm-Altirra-Bridge" VSCode plugin (https://bit.ly/3ATTHVR)
				 Breaking default behavior change: When running atasm without a target assembler file (was test.m65)
				 the command line help is shown. Same when specifying -h on the command line.
Apr 4, 2022
  version 1.18 - The -hv[clm] export option has an extra parameter: L
				 -hv[clLm] are the available options.
				 l = export defined labels (excluding local labels, those starting with a ?)
				 L = export ALL labels (including local labels)
				You can use ".OPT NO SYMDUMP" to turn off the dumping for constants. i.e.
					.OPT NO SYMDUMP
					.INCLUDE "ANTIC.asm"
					.OPT SYMDUMP
				First .opt turns off constant tracking. This means all constants
				created from then until the ".opt SYMDUMP" will NOT make it into
				the "asm-symbols.json" file.

Dec 28, 2022
  version 1.19 - Modified the * program counter command to also name a memory region.
				* = $2000 "BOOT"
				Will name the region starting at $2000 as "Boot", which will be
				dumped after the compile for the vscode extension. Same can be
				done via: .REGION "BOOT" directly after the * command.
				Added -eval command line option to only do the compile and NOT
				write anything to disc.
				Slight warning and error format change to make it external parsable.

Dec 29, 2022
  version 1.20 - Added the .ELSEIF directive to build easier .IF .ELSEIF .ELSE .ENDIF control blocks.

Jan 4, 2023
  version 1.21 - Fixed the .ref implementation. It will now detect a forward reference to a label correctly.
				This is useful in building libraries and excluding code from them if the functions or data
				is not being referenced. i.e. If there is no JSR FUNC1 then the code in the .IF block is
				not generated.
				.IF .DEF func1
					func1 ...
				.ENDIF
			
Jan 10, 2023
  version 1.22 - Added long jump commands JEQ, JNE, JPL, JMI, JCC, JCS, JVC, JVS
				These macro commands are similar to the 6502 branch instructions BEQ, BNE, BPL, BMI, BCC, BCS,
				BVC, BVS, but can target the entire 64KB address space via a jump. If the distance is short
				and the target is known during the first assembler pass then the jump is converted into a branch.
				The assembler spits out code change suggestions if it finds jumps that could be optimized.
				
Mar 19, 2023
  version 1.23 - Fixed the opcodes for the JCC -> BCS/BCC long jumps.
				Thank you to LarsImNetz for finding this.

Nov 1, 2023
  version 1.24 - Added basic trigonometry functions as dot commands: .sin, .cos
				These can be used in loops to generate trig tables.

May 4, 2024
  version 1.25 - Added -a / -mac65 option
				This option will create a memory bank for every program counter assignment.
				* = $2000
				* = $2100
				This will create 2 banks and put the code into the respective banks.
				The banks are NOT sorted or combined.
				This means you can do something like this now:
				* = $2000
				init: RTS
				* = $2e2
				.WORD init
				* = $2100
				boot: lda #1
				.....
				* = $2e0
				.word boot

				The segments in the xex will be in the correct order:
				$2000
				$2e2
				$2100
				$2e0

				Or even easier you can now use the .INIT and .RUN commands to replace:
				* = $2e0
				.word ....

				So this will work now:
				* = $2000
				boot: .....
				.RUN boot

				And the assembled code will start running @ $2000

Feb 5, 2025
  version 1.26 - fixed the parsing of the -hvclm and -hvcLm command line parameters
  				-l and -s options now produce the same output. -l also includes equates (=)

April 23, 2025
  version 1.27 - Thank you to Itay Chamiel for finding an OLD bug in atasm.
				Basically forward references that required an extra pass to resolve did not work.
				The issue has now been fixed. Broken since V1.08

April 25, 2025
  version 1.28 - Fixed a parse error in a forward declared variable.
				The problem is that a forward declaration was given the value of $FFFF.
				Issue comes in if the variable is also given that value via x = $FFFF.
				At that point atasm does not know if its a forward declaration or a fixed assignment.

May 2, 2025
  version 1.29 - Added .IFDEF and .IFNDEF directive. Short version of: .IF .DEF and .IF .NOT .DEF
				Parsing binary numbers in MADS format %11110000 works now.
				Added multi-line comments using the /* ..... */ format