1
0
mirror of https://github.com/ksherlock/x65.git synced 2024-06-11 01:29:26 +00:00
Commit Graph

112 Commits

Author SHA1 Message Date
Carl-Henrik Skårstedt
b16edcd592 Fixed a couple of linker related bugs
did not have any effect, link directive doesn't do what I expect,
probably need to clean up the linker portion.
2017-09-24 22:36:42 -07:00
Carl-Henrik Skårstedt
05b7e253c3 Listing file contains sections including merged sections. 2017-08-06 16:13:11 -07:00
Carl-Henrik Skårstedt
e37bf5ae11 Visual Studio Code colorizing extension, Error includes line number of undefined label reference
* PrintError has an optional argument for enclosing file
* Visual Studio Code extension
2017-01-28 13:29:42 -08:00
Carl-Henrik Skårstedt
576ec5497d MERGE directive, indexed TEXT, Code Style fixes
* Added a directive to control merging of SECTIONs: MERGE
* Added an indexed TEXT format that uses a String Symbol for the
indexing order
* General coding style consitencies
2017-01-08 16:30:30 -08:00
Carl-Henrik Skårstedt
baebdbe096 Label Pool changes
Pool are extended to:
* A pool label can be any size by using POOL <label>.<size> where <size>
is a decimal number
* A pool can define a pool within itself <pool> pool <name> <size> where
<pool> is the name of a pool that would fit another pool and <name> is
the name of the new pool and <size> is the size of the new pool
* pool labels are local if they are preceeded by . or ! or $ or @
* pool labels can be global
2016-12-24 13:23:01 -08:00
Carl-Henrik Skårstedt
8f4a00e3ce Fixing label pools
* label pools don't go out of scope so they can be declared in an
include file and used by the includer file
* label pool labels can be either global or local
* code fixes
* updated struse
* updated binaries
2016-12-23 13:56:57 -08:00
Carl-Henrik Skårstedt
b4407f7cb5 struse.h fixes, warning fixes 2016-05-25 22:44:17 -07:00
Carl-Henrik Skårstedt
a0b73db5c8 Struse was updated and fixing related issues 2016-05-20 22:48:13 -07:00
Carl-Henrik Skårstedt
03f5e5cbfe First column in Merlin mode recognizes scope braces ('{' and '}') 2016-03-17 21:33:39 -07:00
Carl-Henrik Skårstedt
e452d3ab7e Fix 2016-03-17 00:07:15 -07:00
Carl-Henrik Skårstedt
9752c1d8a1 Merlin macro fix
- Does not require merlin macro parameters to be listed after the
keyword MAC
- Updated struse.h
2016-03-17 00:05:36 -07:00
Carl-Henrik Skårstedt
73d67d0657 Context scope cleanup and fix for sequential subtraction in expressions
- Should clean up Merlin mode macros a bit
- Fixes a numerical error
2016-03-13 18:16:43 -07:00
Carl-Henrik Skårstedt
d1c9f3aab5 Fix for local labels accessed crossing over a REPT / LUP
- Added a scope increment when entering a block of repeated code so only
the local symbols within the block would be destroyed each iteration
- Switched over to inttypes.h to make code a smidgeon more readable
2016-03-12 11:39:53 -08:00
Carl-Henrik Skårstedt
07b1a52bb4 Updating binaries 2016-03-11 17:55:32 -08:00
Carl-Henrik Skårstedt
d9d386a260 Adding error handling for flushing local labels
- Errors were ignored in a couple of places
2016-03-11 17:08:44 -08:00
Carl-Henrik Skårstedt
273bdcc92d Fix for local labels within rept/LUP and force org with command line argument
- Flushing local labels after each rept/LUP source segment so local
labels within won't cross over the segment boundary
- The command line argument -org will force fixed address rather than
suggest a location, which in turn makes the -lst command line more
readable.
2016-03-11 16:58:24 -08:00
Carl-Henrik Skårstedt
ee53c41776 Fix for Merlin macros with arguments
- Macro argument was assembled and first argument was defined as a label
2016-03-11 14:12:32 -08:00
Carl-Henrik Skårstedt
341cc8f2ad Labels can begin with numbers
- It is a bad idea to define labels starting with numbers but apparently
Merlin allows it.
2016-03-01 18:34:20 -08:00
Carl-Henrik Skårstedt
462eaeccf6 Fixed bad fix (INCSYM was not properly fixed) 2016-02-15 21:11:10 -08:00
Carl-Henrik Skårstedt
0605a1d6d2 Fix for INCSYM directive when loading files with local labels 2016-02-14 12:36:01 -08:00
Carl-Henrik Skårstedt
7d59943d35 Fixed broken INCBIN and IMPORT BINARY directives 2016-02-13 16:41:33 -08:00
Carl-Henrik Skårstedt
60780a514a Pool labels of even 16ths would be re-reserved due to a left-right bug
- Shifted left when I should have shifted right.
2016-01-28 21:06:41 -08:00
Carl-Henrik Skårstedt
1f50f07c24 STRUCT Directive fix
- Structs can contain empty lines
- Structs can be empty
- All structs have a size member named bytes, the number of bytes used
by a struct is <struct>.bytes
2016-01-04 20:55:32 -08:00
Carl-Henrik Skårstedt
6cbf7f8754 x65macro.i added
- Adding standard macros with for loops, memory copy, add, subtract,
move and set
- macros can be named with dots
- double negatives won't cause errors in expressions
- vice output will convert labels named "debugbreak" to vice breakpoints
rather than vice labels
- fixed issues with mixing conditional operators with math operators in
expressions
2015-12-02 22:16:31 -08:00
Carl-Henrik Skårstedt
260f48e126 Bug fixes
- struse.h replace with bookend didn't check bookends in all cases
- macros can be inside of conditionals (within if/else/endif, etc)
- string symbols mistake caused garbage code (missing braces around
assignment and return)
2015-12-01 21:21:00 -08:00
Carl-Henrik Skårstedt
65f19b4a47 Bug fixes
- rtl instruction had wrong opcode
- disassembler works a lot better with correct rtl, even for 6502
- disassembler can specify n bytes of data before code starts in src
mode (data=initial data size)
2015-11-27 18:01:53 -08:00
Carl-Henrik Skårstedt
9f8ad61fe2 Adding string symbols
- String Symbols can be evaluated as expressions or assembled as code
- String Symbols can be generated by macros
- Cleaning up first page
- Adding more to the x65.txt documentation
2015-11-26 13:10:58 -08:00
Carl-Henrik Skårstedt
05bdc73b86 Added doc & binaries
- Started text documentation of assembler
- Built binary zip files (Windows)
- Fix for conditional + scope characters
- Fix for empty section "default" defaulting to BSS
2015-11-23 22:34:30 -08:00
Carl-Henrik Skårstedt
bf2e281751 Resolved OMF Directpage+stack seg, Disassembler "smarter"
- Using a section named DirectPage_Stack to adjust same named segment in
OMF file
- Resolving all zero page sections to fixed addresses before exporting
OMF
- Disassembler does more shenanigans to output more assemblable code
- Automatically determine the code address for c64 prg files
2015-11-17 23:47:35 -08:00
Carl-Henrik Skårstedt
7fbe9661fa Fixing analyzer issues 2015-11-15 22:15:41 -08:00
Carl-Henrik Skårstedt
43931568aa Apple II GS executable generation
- Lots of managing section support
- a2o command line argument
- DASM directives added
2015-11-15 21:14:46 -08:00
Carl-Henrik Skårstedt
25eab76c95 Fixed Merlin LNK directive and streamlined the LINK directive
- No longer merging sections but assigning sequential addresses to
sections
- Required separate linking logic for Merlin.
2015-11-09 22:15:14 -08:00
Carl-Henrik Skårstedt
90fc74a6fb Adding -org command line option
- -org allows for command line control of fixed address binary output
start address
- fixed a quirk in merged section reloc resolve
2015-11-09 00:07:55 -08:00
Carl-Henrik Skårstedt
b5ab013cb5 Rebuilt the fixed address linker
- Code and data segments are not just merged together, each segment in
each export group just gets address assigned and relocs / labels are
fixed up.
- BSS sections won't generate binary data if not inbetween code and data
segments for an export group (labels and relocs are still extended)
- DC directive now allows for .t (3 byte values) and .l (4 byte values)
decoration
- .lst includes all section info and address ranges if fixed
- Updated x65 dump tool with fixes to x65 data
2015-11-08 18:06:45 -08:00
Carl-Henrik Skårstedt
9cd2ee7cd1 Linking zero page / direct page sections 2015-11-07 18:23:57 -08:00
Carl-Henrik Skårstedt
5030d0be15 Added type of sections
- x65 now has a type for each section
2015-11-06 22:48:50 -08:00
Carl-Henrik Skårstedt
97dc0ad5e6 Fix reloc data
- changed rigid type of reloc target from byte/word/hi byte/lo byte to
number of bytes and bits to shift (Apple II GS OMF format)
2015-11-05 21:23:38 -08:00
Carl-Henrik Skårstedt
9f935a8e91 Bug fixes
- REPT caused a crash if expression was resolved after assembly
completed
- Fix expression % as a label at end of scope if another scope ended
before the current scope
- Removed # from conditionals since that doesn't fit with any assembler
style
- Added .l (long) and .t (triple) to label pool sizes, also supporting
.d as double which is the same size but different meaning than .w (word)
2015-11-03 20:57:06 -08:00
Carl-Henrik Skårstedt
95e22ae7a2 Fix for forward reference in REPT block and assigning section relative address to symbol
- Remember the REPT index for values that can't be evaluated yet
- Remember section reference when evaluating symbols dependent on
address labels.
2015-11-02 23:14:01 -08:00
Carl-Henrik Skårstedt
81e71acea5 Linker fix
- Fix for appended section to last instead of target section
2015-11-01 23:02:03 -08:00
Carl-Henrik Skårstedt
a4d6c3efbf Cycle timing listing for 65816
- XREF blocked linking with same name label
- REPT also works as a symbols for repeat counter to reduce need for
extra counting labels.
- "<<" got interpreted as a right shift
- Added LONG keyword to declare 32 bit values
2015-11-01 15:08:38 -08:00
Carl-Henrik Skårstedt
c50ae5027d Cycle counter hierarchy
- Each scope in a file shows the cycle count added up for instructions
within it.
- Added Merlin version of XREF which is EXT (was previously ignored)
- Added Merlin cycle counter on/off directive (CYC)
2015-10-31 14:34:45 -07:00
Carl-Henrik Skårstedt
07b2b04763 Fix for enums
- enum assignment (=) was ignored
2015-10-31 00:35:25 -07:00
Carl-Henrik Skårstedt
b1e9797160 XREF support, starting cycle counting
- XREF directive now required for referencing XDEF symbols from other
files
- Created cycle timing table for 6502, displaying for each line in .lst
files
2015-10-30 22:30:16 -07:00
Carl-Henrik Skårstedt
8fdeb287e1 Bug fixes
- Fixed section alignment
- Fixed nested scopes
- Fixed a borked parameter sent to label pools
- Added -all as a command line option for dump_x65
2015-10-28 21:08:23 -07:00
Carl-Henrik Skårstedt
662982404b Link issues
- Map symbols might not have been updated with their labels
- Relocation index may be off
- Map symbols stored in 16 bits causing truncation of value in symbol
output
- Added a tool to dump the values in object files
2015-10-27 20:57:14 -07:00
Carl-Henrik Skårstedt
74a34585d4 Rastan IIgs builds with x65
- Fixed issue with CPU indexing
- Added missing 65816 jmp (addr,x) and jmp $123456,x and jsl
- Added a method for Merlin style linking to work in x65
- Made low byte / high byte (<, >) very low precedence
- Some more Merlin directives
- Split out some directive code from the huge ApplyDirective function
- Add source lines of keywords and labels to the output listing file
- x65 object file fixes
2015-10-26 20:50:26 -07:00
Carl-Henrik Skårstedt
72b9842354 Leftover fixes
- added -acc=16 and -xy=16 command line options for 65816 immediate mode
instruction size
- added conditional expressions (evaluates to 0 for false and 1 for
true)
- fixed macro substitution to be whole word only
2015-10-25 23:48:35 -07:00
Carl-Henrik Skårstedt
c2c6aaef0f Import directive
- IMPORT directive added, works like Kick Assembler
- -endm option also applies to REPT
- REPEAT directive is an alias of REPT
- Merlin macro fix uses ]1, ]2, .. as macro params
- Erroneously flushed local labels when starting to assemble a macro
2015-10-25 14:29:41 -07:00
Carl-Henrik Skårstedt
98886793df 6502 illegal opcodes (-cpu=6502ill)
- Added illegal instructions since it only needed updating of tables.
2015-10-24 15:02:16 -07:00
Carl-Henrik Skårstedt
d279d35f7e Alias opcodes
- Added aliases to opcodes
- Fixed XCode warnings
- Revisited outdated comments
- Fixed CPU / PROCESSOR keyword giving an error even if the argument was
valid
- Rearranged switch statements to be in a more logical order
2015-10-24 13:41:11 -07:00
Carl-Henrik Skårstedt
fa0c6b0187 65816 Added
- Addressing modes
- Opcodes
- Directives
- Cleanup
2015-10-23 22:44:56 -07:00
Carl-Henrik Skårstedt
cc99faed16 65C02 CPU added
- Added SAV as a Merlin directive
- cpu command line option to switch CPU target
2015-10-21 22:34:01 -07:00
Carl-Henrik Skårstedt
fbade4eb06 Fix negative numbers, Merlin MAC and LUP, endmacro switch
- Could not declare negative numbers
- Support for LUP (Merlin rept) and MAC (Merlin macro)
- Support for endmacro instead of scoped macros
2015-10-20 22:28:53 -07:00
Carl-Henrik Skårstedt
521e3b98a8 Merlin syntax support, symbol file fix, list file fix
- don't allow ! in merlin labels
- don't skip initial : in merlin labels
- symbol files resolves labels from incobj relative sections
- assembler listing skipping disassembly for lines that was not built
from source code
2015-10-19 22:44:02 -07:00
Carl-Henrik Skårstedt
38e0abcc6e Export now writes all sections instead of just the last fixed one
- Combines all fixed sections into a single binary
- Export directive allows for writing multiple binaries from one source
file
2015-10-18 19:48:03 -07:00
Carl-Henrik Skårstedt
b7d0b195af List file option added
- using -lst the disassembled and assembled source is written out side
by side
- option -opcodes saves out a source file with all opcodes & addressing
modes for testing
- cleaned up opcode table to be simpler and more robust so I can
consider supporting other cpus
- bug fixes
2015-10-18 12:42:10 -07:00
Carl-Henrik Skårstedt
c8ceffdbf6 Compile issues fixed for xcode
- Additional stability checks
2015-10-17 12:13:23 -07:00
Carl-Henrik Skårstedt
071d64de80 Object file now protects local labels
- XDEF declares labels as global
- Each incobj file keeps its own protected set of labels for link-time
evalulations
2015-10-16 20:27:56 -07:00
Carl-Henrik Skårstedt
12cfe830f9 Fixes
- Sections got overwritten (reference vs pointer mistake)
- Check that relocs and late evals apply the adjustments within the
existing binary
2015-10-15 20:58:17 -07:00
Carl-Henrik Skårstedt
ca604ad81c Export and import of object files
First pass implementation of object files - all imported labels are
currently global.
2015-10-13 19:38:13 -07:00
Carl-Henrik Skårstedt
6962a98419 Renaming asm6502 to x65 2015-10-13 19:25:24 -07:00