#
# 68k_test_10
#
# tenth test file for the 68k core testing program
#
# tests Immediate instructions in the 0x0xxx range
#

# $Id$

#
# NOTE: Someone plays fast and loose with flags...
#

#
# Test ANDI instruction (ANDI.B)
#

# test ANDI.B d0
start andi.b d0, take 1
set mem 0x002000 = 0x0200
set mem 0x002002 = 0x00f0
set reg d0 = 0xffffff55
set pc 0x002000
set cycles 8
set flags 0x000f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffff50
check flags 0x0000
done

# test ANDI.B d0
start andi.b d0, take 2
set mem 0x002000 = 0x0200
set mem 0x002002 = 0x0000
set reg d0 = 0xffffff55
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffff00
check flags 0x0014
done

# test ANDI.B d0
start andi.b d0, take 3
set mem 0x002000 = 0x0200
set mem 0x002002 = 0x00f0
set reg d0 = 0xffffffaa
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffffa0
check flags 0x0018
done

#
# Test ANDI instruction (ANDI.W)
#

# test ANDI.W d0
start andi.w d0, take 1
set mem 0x002000 = 0x0240
set mem 0x002002 = 0xf0f0
set reg d0 = 0xffff55aa
set pc 0x002000
set cycles 8
set flags 0x000f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffff50a0
check flags 0x0000
done

# test ANDI.W d0
start andi.w d0, take 2
set mem 0x002000 = 0x0240
set mem 0x002002 = 0x0000
set reg d0 = 0xffff55aa
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffff0000
check flags 0x0014
done

# test ANDI.W d0
start andi.w d0, take 3
set mem 0x002000 = 0x0240
set mem 0x002002 = 0xf0f0
set reg d0 = 0xffffaa55
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffa050
check flags 0x0018
done

#
# Test ANDI instruction (ANDI.L)
#

# test ANDI.L d0
start andi.l d0, take 1
set mem 0x002000 = 0x0280
set mem 0x002002 = 0xf0f0
set mem 0x002004 = 0xf0f0
set reg d0 = 0x55aa55aa
set pc 0x002000
set cycles 16
set flags 0x000f
run
check cycles 0
check pc 0x002006
check reg d0 = 0x50a050a0
check flags 0x0000
done

# test ANDI.L d0
start andi.l d0, take 2
set mem 0x002000 = 0x0280
set mem 0x002002 = 0x0000
set mem 0x002004 = 0x0000
set reg d0 = 0x55aa55aa
set pc 0x002000
set cycles 16
set flags 0x001f
run
check cycles 0
check pc 0x002006
check reg d0 = 0x00000000
check flags 0x0014
done

# test ANDI.L d0
start andi.l d0, take 3
set mem 0x002000 = 0x0280
set mem 0x002002 = 0xf0ff
set mem 0x002004 = 0xf0f0
set reg d0 = 0xaa55aa55
set pc 0x002000
set cycles 16
set flags 0x001f
run
check cycles 0
check pc 0x002006
check reg d0 = 0xa055a050
check flags 0x0018
done

#
# Test CMPI instruction (CMPI.B)
#

# test CMPI.B d0 (0x0c00)
start cmpi.b d0, take 1
set mem 0x002000 = 0x0c00
set mem 0x002002 = 0x0055
set reg d0 = 0xffffff55
set pc 0x002000
set cycles 8
set flags 0x000f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffff55
check flags 0x0004
done

# test CMPI.B d0 (0x0c00)
start cmpi.b d0, take 2
set mem 0x002000 = 0x0c00
set mem 0x002002 = 0x0000
set reg d0 = 0xffffff55
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffff55
check flags 0x0010
done

# test CMPI.B d0 (0x0c00)
start cmpi.b d0, take 3
set mem 0x002000 = 0x0c00
set mem 0x002002 = 0x0055
set reg d0 = 0xffffff00
set pc 0x002000
set cycles 8
set flags 0x000f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffffff00
check flags 0x0009
done

#
# Test CMPI instruction (CMPI.W)
#

# test CMPI.W d0 (0x0c40)
start cmpi.w d0, take 1
set mem 0x002000 = 0x0c40
set mem 0x002002 = 0x55aa
set reg d0 = 0xffff55aa
set pc 0x002000
set cycles 8
set flags 0x000f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffff55aa
check flags 0x0004
done

# test CMPI.W d0 (0x0c40)
start cmpi.w d0, take 2
set mem 0x002000 = 0x0c40
set mem 0x002002 = 0x0000
set reg d0 = 0xffff55aa
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffff55aa
check flags 0x0010
done

# test CMPI.W d0 (0x0c40)
start cmpi.w d0, take 3
set mem 0x002000 = 0x0c40
set mem 0x002002 = 0x55aa
set reg d0 = 0xffff0000
set pc 0x002000
set cycles 8
set flags 0x001f
run
check cycles 0
check pc 0x002004
check reg d0 = 0xffff0000
check flags 0x0019
done

#
# Test CMPI instruction (CMPI.L)
#

# test CMPI.L d0 (0x0c80)
start cmpi.l d0, take 1
set mem 0x002000 = 0x0c80
set mem 0x002002 = 0x55aa
set mem 0x002004 = 0xaa55
set reg d0 = 0x55aaaa55
set pc 0x002000
set cycles 14
set flags 0x000f
run
check cycles 0
check pc 0x002006
check reg d0 = 0x55aaaa55
check flags 0x0004
done

# test CMPI.L d0 (0x0c80)
start cmpi.l d0, take 2
set mem 0x002000 = 0x0c80
set mem 0x002002 = 0x0000
set mem 0x002004 = 0x0000
set reg d0 = 0x55aa55aa
set pc 0x002000
set cycles 14
set flags 0x001f
run
check cycles 0
check pc 0x002006
check reg d0 = 0x55aa55aa
check flags 0x0010
done

# test CMPI.L d0 (0x0c80)
start cmpi.l d0, take 3
set mem 0x002000 = 0x0c80
set mem 0x002002 = 0xaa55
set mem 0x002004 = 0x55aa
set reg d0 = 0x00000000
set pc 0x002000
set cycles 14
set flags 0x001f
run
check cycles 0
check pc 0x002006
check reg d0 = 0x00000000
check flags 0x0013
done

#
# $Log$
#
