Share

Crasm

Tracker: Bugs

5 6502 CPX and CPY opcodes are mixed up - ID: 1834185
Last Update: Comment added ( leonb )


A 6502 CPX immediate instruction is 0xE0 and CPY immediate is 0xC0. crasm
reverses these.


Thomas Skibo ( skibo ) - 2007-11-18 19:47

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 2 )

Date: 2008-11-06 17:31
Sender: leonbProject Admin

Ooops. Fixed in crasm-1.5.


Date: 2008-01-30 17:22
Sender: jorikb


I ran into this bug as well, here is a patch:

+++ crasm-1.4/src/cpu6502.c 2008-01-30 18:17:26.000000000 +0100
@@ -274,8 +274,8 @@

mnemo2 ("ldx", 1,0xa0 ,F_noacc|F_noindx )
mnemo2 ("ldy", 1,0x9e ,F_noacc|F_noindy )
-mnemo2 ("cpx", 1,0xbe ,F_noindy|F_noindx|F_noacc )
-mnemo2 ("cpy", 1,0xde ,F_noindy|F_noindx|F_noacc )
+mnemo2 ("cpx", 1,0xde ,F_noindy|F_noindx|F_noacc )
+mnemo2 ("cpy", 1,0xbe ,F_noindy|F_noindx|F_noacc )

mnemo2 ("stx", 2,0x80 ,F_noindx )
mnemo2 ("sty", 2,0x7e ,F_noindy )


basically you only need to swap these two entries and rebuild the
assembler


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2008-11-06 17:31 leonb
resolution_id None 2008-11-06 17:31 leonb
close_date - 2008-11-06 17:31 leonb