Commit Graph

24 Commits

Author SHA1 Message Date
Tennessee Carmel-Veilleux
680c212992
Merge pull request #3 from ratherlargerobot/fread-brk-bugfix
Use fread() return value to count bytes
2018-09-02 15:28:46 -04:00
Nathan Rosenquist
8b01d8b204 Use fread() return value to count bytes
This commit changes the behavior of dcc6502, so that it consults the
return value of fread(), and then increments the value of byte_count
by the number returned by fread(), rather than implicitly incrementing
it every time.

Previously, a warning occurred during compilation, because the return value
of fread() was ignored. Instead, the number of bytes in the input file were
counted implicitly by incrementing a byte_count variable after every fread()
call.

Additionally, I created a two-byte test input file consisting of the
bytes #$a9ff, which corresponds to LDA #$FF. When dcc6502 tried to
disassemble this input file, it reported that the file had a size of three
bytes. It reported the first two opcodes correctly, but then incorrectly
displayed a BRK as the third opcode.

After this change, the input file now has a reported size of two bytes,
without the phantom BRK opcode at the end.
2018-09-01 20:44:41 -04:00
Tennessee Carmel-Veilleux
c003395dd7 Bumped version to 2.1 after -s added 2018-02-21 09:43:20 -05:00
Tennessee Carmel-Veilleux
2c46640706
Merge pull request #2 from KaleviKolttonen/input_file_offset
Add a command line option -s for specifying file offset to start disa…
2018-02-21 09:40:34 -05:00
Kalevi Kolttonen
ab33fe1c84 Minor cleanups for new command line option -s code 2018-02-21 16:31:05 +02:00
Kalevi Kolttonen
1ff0a0949b Add a command line option -s for specifying file offset to start disassembling from 2018-02-21 15:21:22 +02:00
Tennessee Carmel-Veilleux
91f4853529 Updated .gitignore 2014-07-24 23:22:12 -04:00
Tennessee Carmel-Veilleux
6f0226a7e6 Fixed argument error handling and usage message 2014-07-24 23:18:00 -04:00
Tennessee Carmel-Veilleux
aa6c897c1a Fixed cycle counting and finished 2.0
* Added rules for branch taken/not taken
* Fixed incorrect adding of cycles for many ALU instructions
* Fixed timing for ASL, DEC, INC, LSR, ROL, and ROR
* Renamed global opcode_table to g_opcode_table
* Normalized all hex output to be capitals
2014-07-24 23:00:31 -04:00
Tennessee Carmel-Veilleux
d8869a8d28 Major refactoring of arguments handling 2014-07-24 22:23:54 -04:00
Tennessee Carmel-Veilleux
57e20cdf26 Started version 2.0
* Simplified mnemonic name lookup
* Started refactor of argument parsing
* Converted addressing modes to an enum
* Renamed poorly named variables
2014-07-24 19:35:02 -04:00
Tennessee Carmel-Veilleux
34ccb70eae Simplified hex value conversions for args 2014-07-24 18:56:51 -04:00
Tennessee Carmel-Veilleux
0ffacd9e5d Greatly simplified disassembly code 2014-07-24 17:22:40 -04:00
Tennessee Carmel-Veilleux
4c9a2daeb4 Refactored disassembly code to combine steps 2014-07-24 16:40:08 -04:00
Tennessee Carmel-Veilleux
7985830ecd Started main clean-up of version 1.6
* Fixed all compiler warnings
* Killed union usage
* Started using C99 fixed width types
* Started normalization of whitespace width in listing
* Simplified internal addresses computations
2014-07-24 16:09:53 -04:00
Tennessee Carmel-Veilleux
e19fc4568c Fixed some compiler warnings 2014-07-24 14:13:24 -04:00
Tennessee Carmel-Veilleux
18114bf7df Updated license in file and added FIXME markers 2014-07-23 15:36:35 -04:00
Tennessee Carmel-Veilleux
11eb27cced Fixed copyright date 2014-07-23 15:08:55 -04:00
Tennessee Carmel-Veilleux
676ddb5177 Added whitespace for each run-in comma 2014-07-23 15:07:19 -04:00
Tennessee Carmel-Veilleux
984edd2187 Added Makefile and cleaned-up indent 2014-07-23 14:57:21 -04:00
Tennessee Carmel-Veilleux
2955bbb7ef Updated README.md 2014-07-23 14:16:22 -04:00
Tennessee Carmel-Veilleux
2e2e0f7b1d Update to legacy version 1.5 2014-07-23 13:59:14 -04:00
Tennessee Carmel-Veilleux
33a91e2427 Commit of version 1.4 2014-07-23 13:52:56 -04:00
Tennessee Carmel-Veilleux
a77865e704 Initial commit 2014-07-23 13:44:07 -04:00