From ST2205u wiki

This patch fixes the wrongly assembled CPX/CPY instructions in crasm. I've also posted this fix to the author but haven't received any response yet.

--- ./cpu6502.c 2005-05-10 14:57:52.000000000 +0200
+++ /home/jorik/build/software/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 all you have to do is swap the cpx/cpy lines around. This'll save you some work manually assembling opcodes :)

  • I've added crasm to sourceforge, incorporating the above patch --bifferos.
  • This crasm bug does not seem to affect the original hack code --MarkoS 00:35, 16 November 2008 (CET)