1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00
Commit Graph

40 Commits

Author SHA1 Message Date
Carlo Bramini
b04d79b1da [SIM65] Support undocumented opcodes for 6502
This PR is mostly a complete rewrite of the emulator for 6502/65c02 opcodes.
It provides an easier to maintain implementation of the instructions, by using few macros rather than having hand-written code for each function.
All undocumented, previously missing opcodes for 6502 are also implemented.
The patch also includes a detailed documentation of those opcodes, for reference to developers.
This PR should fix one of the milestones listed here for the next version of CC65:

https://github.com/cc65/wiki/wiki/Before-the-next-release
2024-02-08 12:13:17 +01:00
bbbradsmith
f15e9c4159 Linux build rejects %llu in ErrorCode 2023-05-07 17:41:54 -04:00
bbbradsmith
0081fe548c sim64 universal 64-bit cycle count support:
MaxCycleCount is accounted by countdown, eliminating the 1-instruction-overhead issue, and removing the need to compare against a growing TotalCycles.
Makes main.c responsible for counting total cycles, instead of 6502.c, so the size of MaxCycleCount etc. is fully determined in one location.
Makes error.c responsible for PrintCycles instead of paravirt.c, so that it can be treated globally instead of
Return value of main() should be SIM65_ERROR because it is unreachable by design.
2023-05-07 16:26:42 -04:00
bbbradsmith
84f0ab322d sim65: cycles does not increment 1 at a time, so some small overhead is needed in range check 2023-05-06 13:54:28 -04:00
bbbradsmith
c03d00bc80 sim65 suppress uninitialized variable warning
the EOF check was protecting uninitialized Val2 but the compiler can't figure that out
2023-05-05 21:46:42 -04:00
bbbradsmith
f2e7609046 sim65 cycles 32-bit range fix
long is 64-bit on some platforms, making this inconsistent, added range check to catch overflow.
reduced tests requesting 5 billion cycles to 2^32-1 so they can fun on 32-bit long sim65.
2023-05-05 21:45:57 -04:00
bbbradsmith
5269552346 sim65 common define for paravirt hooks base location
allows the loaded binary to take up as much space as possible
restored some documentation of the hooks but without reference to specific location
2019-05-31 10:40:04 +02:00
bbbradsmith
7e4c4ee53e sim65/main.c spaces were requested 2019-05-29 22:56:51 +02:00
bbbradsmith
fb7d4acd5c versionable header for sim65
load and run address now configured from header
fix error codes not to conflict with test
fix test/misc/endless.c which is supposed to fail if an endless loop does not occur
2019-05-29 22:56:51 +02:00
bbbradsmith
07ca772932 adjust literal width to match variable type 2019-05-29 22:56:51 +02:00
bbbradsmith
2f3cae0d2e movable sp for sim65 2019-05-29 22:56:51 +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
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
Christian Groessler
97b517a892 sim65: add command line parameter to print number of CPU cycles at exit 2016-07-05 17:07:39 +02:00
polluks
cb3700ef66 Changed stdout to stderr to separate sim65's output streams. Suggested doc edit. 2016-01-05 17:45:18 +01:00
mrdudz
d5844bd63b changed return code to -99 2014-11-20 14:49:35 +01:00
mrdudz
adc5525e85 added commandline option to quit after X cycles 2014-09-25 18:47:23 +02:00
Oliver Schmidt
bb37f2e9c8 Adjusted usage. 2013-05-24 18:36:59 +02:00
Oliver Schmidt
5bd0a53ea2 Added support for cc65 program arguments. 2013-05-24 18:36:30 +02:00
Oliver Schmidt
3a028fb621 Turned sim65 into a lightweight cc65 execution environment.
The sim65 source code has been a construction site for over a decade.
I was looking for a simple cc65 program execution environment for
regression tests. So I decided to re-purpose sim65 for that task by
removing about everything but the 6502 emulation.

There's no memory mapped i/o emulation whatsoever. Rather exit(),
open(), close(), read() and write() calls are supported by mapping
them through a thin paravirtualization layer to the corresponding
host os functions.

Note: The sim65 6502 emulation provides means to switch between
6502 and 65C02 emulation but currently there are no actual 65C02
opcodes implemented.
2013-05-20 20:20:14 +02:00
Oliver Schmidt
85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
uz
74ee7a44a9 One more intermediate state - not compilable.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5644 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-04-05 19:55:04 +00:00
uz
31e0666087 Use FileStat instead of stat.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5640 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-04-03 13:28:33 +00:00
uz
05f7296369 Restructured search path handling.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4662 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-09 10:54:15 +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
cuz
8a6fdb8562 Output the help text to stdout
git-svn-id: svn://svn.cc65.org/cc65/trunk@3414 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-03-24 20:08:41 +00:00
cuz
e9f6a0a3ab Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@2143 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-05-04 21:51:13 +00:00
cuz
2a5fbd00ef Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@2109 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-05-01 18:58:35 +00:00
cuz
94e6e73089 Moved the chiplib module into chip.c
git-svn-id: svn://svn.cc65.org/cc65/trunk@2093 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-04-28 06:19:33 +00:00
cuz
8bff858b09 Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@2092 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-04-27 15:31:00 +00:00
cuz
251547f028 Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@2091 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-04-27 11:49:53 +00:00
cuz
3dcb7dba3b Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1240 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-14 19:14:52 +00:00
cuz
8701a2c8d5 Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1234 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-08 20:05:05 +00:00
cuz
09f288e43d Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1230 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-08 18:52:47 +00:00
cuz
58b5779f35 Working on the plugins
git-svn-id: svn://svn.cc65.org/cc65/trunk@1222 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-07 20:00:39 +00:00
cuz
6c3720686b First test plugin
git-svn-id: svn://svn.cc65.org/cc65/trunk@1221 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-07 13:42:45 +00:00
cuz
9abe1e62e7 Working on the plugin interface
git-svn-id: svn://svn.cc65.org/cc65/trunk@1220 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-06 22:11:09 +00:00
cuz
2a7a410532 Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1213 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-01 17:55:22 +00:00
cuz
d17936488c Working
git-svn-id: svn://svn.cc65.org/cc65/trunk@1212 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-04-01 17:42:24 +00:00
cuz
febf56a10b First import
git-svn-id: svn://svn.cc65.org/cc65/trunk@1209 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-03-30 16:43:27 +00:00