#
# 6280_test_3
#
# test "big 8" instruction addressing modes
#

#
# test Immediate mode (0x29)
#

start and immed (0x29), take 1
set mem 0x2000 = 0x29
set mem 0x2001 = 0xaa
set reg a = 0xa5
set flags 0x00
set pc 0x2000
set cycles 2
run
check cycles 0
check pc 0x2002
check reg a = 0xa0
check flags 0x80
done

#
# test ZPage, X mode (0x35)
#

start and zpagex (0x35), take 1
set mem 0x2000 = 0x35
set mem 0x2001 = 0x60
set mem 0x0040 = 0xaa
set reg a = 0xa5
set reg x = 0xe0
set flags 0x00
set pc 0x2000
set cycles 4
run
check cycles 0
check pc 0x2002
check reg a = 0xa0
check flags 0x80
done

#
# test Abs mode (0x2d)
#

start and abs (0x2d), take 1
set mem 0x2000 = 0x2d
set mem 0x2001 = 0x60
set mem 0x2002 = 0x45
set mem 0x4560 = 0xaa
set reg a = 0xa5
set flags 0x00
set pc 0x2000
set cycles 5
run
check cycles 0
check pc 0x2003
check reg a = 0xa0
check flags 0x80
done

#
# test Abs, X mode (0x3d)
#

start and absx (0x3d), take 1
set mem 0x2000 = 0x3d
set mem 0x2001 = 0x60
set mem 0x2002 = 0x45
set mem 0x4650 = 0xaa
set reg a = 0xa5
set reg x = 0xf0
set flags 0x00
set pc 0x2000
set cycles 5
run
check cycles 0
check pc 0x2003
check reg a = 0xa0
check flags 0x80
done

#
# test Abs, Y mode (0x39)
#

start and absy (0x39), take 1
set mem 0x2000 = 0x39
set mem 0x2001 = 0x60
set mem 0x2002 = 0x45
set mem 0x4650 = 0xaa
set reg a = 0xa5
set reg y = 0xf0
set flags 0x00
set pc 0x2000
set cycles 5
run
check cycles 0
check pc 0x2003
check reg a = 0xa0
check flags 0x80
done

#
# test Ind mode (0x32)
#

start and ind (0x32), take 1
set mem 0x2000 = 0x32
set mem 0x2001 = 0xff
set mem 0x00ff = 0x60
set mem 0x0000 = 0x45
set mem 0x4560 = 0xaa
set reg a = 0xa5
set reg x = 0x55	# not used, used to prove the point
set reg y = 0x73	# not used, used to prove the point
set flags 0x00
set pc 0x2000
set cycles 7
run
check cycles 0
check pc 0x2002
check reg a = 0xa0
check flags 0x80
done

#
# test (Ind, X) mode (0x21)
#

start and (ind, x) (0x21), take 1
set mem 0x2000 = 0x21
set mem 0x2001 = 0x40
set mem 0x00ff = 0x60
set mem 0x0000 = 0x45
set mem 0x4560 = 0xaa
set reg a = 0xa5
set reg x = 0xbf
set flags 0x00
set pc 0x2000
set cycles 7
run
check cycles 0
check pc 0x2002
check reg a = 0xa0
check flags 0x80
done

#
# test (Ind), Y mode (0x31)
#

start and (ind), y (0x31), take 1
set mem 0x2000 = 0x31
set mem 0x2001 = 0xff
set mem 0x00ff = 0x60
set mem 0x0000 = 0x45
set mem 0x4620 = 0xaa
set reg a = 0xa5
set reg y = 0xc0
set flags 0x00
set pc 0x2000
set cycles 7
run
check cycles 0
check pc 0x2002
check reg a = 0xa0
check flags 0x80
done

#
# EOF
#
