/*===========================================================================*/
|
/*===========================================================================*/
|
/* Copyright (C) 2001 Authors */
|
/* Copyright (C) 2001 Authors */
|
/* */
|
/* */
|
/* This source file may be used and distributed without restriction provided */
|
/* This source file may be used and distributed without restriction provided */
|
/* that this copyright statement is not removed from the file and that any */
|
/* that this copyright statement is not removed from the file and that any */
|
/* derivative work contains the original copyright notice and the associated */
|
/* derivative work contains the original copyright notice and the associated */
|
/* disclaimer. */
|
/* disclaimer. */
|
/* */
|
/* */
|
/* This source file is free software; you can redistribute it and/or modify */
|
/* This source file is free software; you can redistribute it and/or modify */
|
/* it under the terms of the GNU Lesser General Public License as published */
|
/* it under the terms of the GNU Lesser General Public License as published */
|
/* by the Free Software Foundation; either version 2.1 of the License, or */
|
/* by the Free Software Foundation; either version 2.1 of the License, or */
|
/* (at your option) any later version. */
|
/* (at your option) any later version. */
|
/* */
|
/* */
|
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
|
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
|
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
|
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
|
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
|
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
|
/* License for more details. */
|
/* License for more details. */
|
/* */
|
/* */
|
/* You should have received a copy of the GNU Lesser General Public License */
|
/* You should have received a copy of the GNU Lesser General Public License */
|
/* along with this source; if not, write to the Free Software Foundation, */
|
/* along with this source; if not, write to the Free Software Foundation, */
|
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
/* */
|
/* */
|
/*===========================================================================*/
|
/*===========================================================================*/
|
/* CONDITIONAL JUMP: JC INSTRUCTION */
|
/* CONDITIONAL JUMP: JC INSTRUCTION */
|
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
/* Test the JC instruction. */
|
/* Test the JC instruction. */
|
|
/* */
|
|
/* Author(s): */
|
|
/* - Olivier Girard, olgirard@gmail.com */
|
|
/* */
|
|
/*---------------------------------------------------------------------------*/
|
|
/* $Rev: 17 $ */
|
|
/* $LastChangedBy: olivier.girard $ */
|
|
/* $LastChangedDate: 2009-08-04 23:15:39 +0200 (Tue, 04 Aug 2009) $ */
|
/*===========================================================================*/
|
/*===========================================================================*/
|
|
|
|
|
.global main
|
.global main
|
|
|
main:
|
main:
|
/* -------------- TEST JUMP FORWARD AND BACKWARD ------------------- */
|
/* -------------- TEST JUMP FORWARD AND BACKWARD ------------------- */
|
|
|
mov #0x0001, r2
|
mov #0x0001, r2
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_fwrd1
|
jc test_jc_fwrd1
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_bckwrd:
|
test_jc_bckwrd:
|
mov #0x9abc, r6
|
mov #0x9abc, r6
|
jc test_jc_fwrd2
|
jc test_jc_fwrd2
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r6
|
mov #0x0000, r6
|
mov #0x0000, r6
|
mov #0x0000, r6
|
mov #0x0000, r6
|
mov #0x0000, r6
|
test_jc_fwrd1:
|
test_jc_fwrd1:
|
mov #0x5678, r5
|
mov #0x5678, r5
|
jc test_jc_bckwrd
|
jc test_jc_bckwrd
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
mov #0x0000, r5
|
|
|
test_jc_fwrd2:
|
test_jc_fwrd2:
|
|
|
mov #0x1000, r15
|
mov #0x1000, r15
|
|
|
/* -------------- TEST JUMP FOR ALL FLAG CONFIGURATIONS ------------ */
|
/* -------------- TEST JUMP FOR ALL FLAG CONFIGURATIONS ------------ */
|
|
|
mov #0x0000, r2 ;# {V,N,Z,C} = 4'b0000
|
mov #0x0000, r2 ;# {V,N,Z,C} = 4'b0000
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_0
|
jc test_jc_0
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_0:
|
test_jc_0:
|
mov #0x2000, r15
|
mov #0x2000, r15
|
|
|
mov #0x0001, r2 ;# {V,N,Z,C} = 4'b0001
|
mov #0x0001, r2 ;# {V,N,Z,C} = 4'b0001
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_1
|
jc test_jc_1
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_1:
|
test_jc_1:
|
mov #0x2001, r15
|
mov #0x2001, r15
|
|
|
mov #0x0002, r2 ;# {V,N,Z,C} = 4'b0010
|
mov #0x0002, r2 ;# {V,N,Z,C} = 4'b0010
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_2
|
jc test_jc_2
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_2:
|
test_jc_2:
|
mov #0x2002, r15
|
mov #0x2002, r15
|
|
|
mov #0x0003, r2 ;# {V,N,Z,C} = 4'b0011
|
mov #0x0003, r2 ;# {V,N,Z,C} = 4'b0011
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_3
|
jc test_jc_3
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_3:
|
test_jc_3:
|
mov #0x2003, r15
|
mov #0x2003, r15
|
|
|
mov #0x0004, r2 ;# {V,N,Z,C} = 4'b0100
|
mov #0x0004, r2 ;# {V,N,Z,C} = 4'b0100
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_4
|
jc test_jc_4
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_4:
|
test_jc_4:
|
mov #0x2004, r15
|
mov #0x2004, r15
|
|
|
mov #0x0005, r2 ;# {V,N,Z,C} = 4'b0101
|
mov #0x0005, r2 ;# {V,N,Z,C} = 4'b0101
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_5
|
jc test_jc_5
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_5:
|
test_jc_5:
|
mov #0x2005, r15
|
mov #0x2005, r15
|
|
|
mov #0x0006, r2 ;# {V,N,Z,C} = 4'b0110
|
mov #0x0006, r2 ;# {V,N,Z,C} = 4'b0110
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_6
|
jc test_jc_6
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_6:
|
test_jc_6:
|
mov #0x2006, r15
|
mov #0x2006, r15
|
|
|
mov #0x0007, r2 ;# {V,N,Z,C} = 4'b0111
|
mov #0x0007, r2 ;# {V,N,Z,C} = 4'b0111
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_7
|
jc test_jc_7
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_7:
|
test_jc_7:
|
mov #0x2007, r15
|
mov #0x2007, r15
|
|
|
mov #0x0100, r2 ;# {V,N,Z,C} = 4'b1000
|
mov #0x0100, r2 ;# {V,N,Z,C} = 4'b1000
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_8
|
jc test_jc_8
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_8:
|
test_jc_8:
|
mov #0x2008, r15
|
mov #0x2008, r15
|
|
|
mov #0x0101, r2 ;# {V,N,Z,C} = 4'b1001
|
mov #0x0101, r2 ;# {V,N,Z,C} = 4'b1001
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_9
|
jc test_jc_9
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_9:
|
test_jc_9:
|
mov #0x2009, r15
|
mov #0x2009, r15
|
|
|
mov #0x0102, r2 ;# {V,N,Z,C} = 4'b1010
|
mov #0x0102, r2 ;# {V,N,Z,C} = 4'b1010
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_A
|
jc test_jc_A
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_A:
|
test_jc_A:
|
mov #0x200A, r15
|
mov #0x200A, r15
|
|
|
mov #0x0103, r2 ;# {V,N,Z,C} = 4'b1011
|
mov #0x0103, r2 ;# {V,N,Z,C} = 4'b1011
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_B
|
jc test_jc_B
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_B:
|
test_jc_B:
|
mov #0x200B, r15
|
mov #0x200B, r15
|
|
|
mov #0x0104, r2 ;# {V,N,Z,C} = 4'b1100
|
mov #0x0104, r2 ;# {V,N,Z,C} = 4'b1100
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_C
|
jc test_jc_C
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_C:
|
test_jc_C:
|
mov #0x200C, r15
|
mov #0x200C, r15
|
|
|
mov #0x0105, r2 ;# {V,N,Z,C} = 4'b1101
|
mov #0x0105, r2 ;# {V,N,Z,C} = 4'b1101
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_D
|
jc test_jc_D
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_D:
|
test_jc_D:
|
mov #0x200D, r15
|
mov #0x200D, r15
|
|
|
mov #0x0106, r2 ;# {V,N,Z,C} = 4'b1110
|
mov #0x0106, r2 ;# {V,N,Z,C} = 4'b1110
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_E
|
jc test_jc_E
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_E:
|
test_jc_E:
|
mov #0x200E, r15
|
mov #0x200E, r15
|
|
|
mov #0x0107, r2 ;# {V,N,Z,C} = 4'b1111
|
mov #0x0107, r2 ;# {V,N,Z,C} = 4'b1111
|
mov #0x1234, r4
|
mov #0x1234, r4
|
jc test_jc_F
|
jc test_jc_F
|
mov #0x0000, r4
|
mov #0x0000, r4
|
test_jc_F:
|
test_jc_F:
|
mov #0x200F, r15
|
mov #0x200F, r15
|
|
|
|
|
/* ---------------------- END OF TEST --------------- */
|
/* ---------------------- END OF TEST --------------- */
|
mov #0x5000, r15
|
mov #0x5000, r15
|
end_of_test:
|
end_of_test:
|
nop
|
nop
|
br #0xffff
|
br #0xffff
|
|
|
|
|
|
|
/* ---------------------- INTERRUPT VECTORS --------------- */
|
/* ---------------------- INTERRUPT VECTORS --------------- */
|
|
|
.section .vectors, "a"
|
.section .vectors, "a"
|
.word end_of_test ; Interrupt 0 (lowest priority)
|
.word end_of_test ; Interrupt 0 (lowest priority)
|
.word end_of_test ; Interrupt 1
|
.word end_of_test ; Interrupt 1
|
.word end_of_test ; Interrupt 2
|
.word end_of_test ; Interrupt 2
|
.word end_of_test ; Interrupt 3
|
.word end_of_test ; Interrupt 3
|
.word end_of_test ; Interrupt 4
|
.word end_of_test ; Interrupt 4
|
.word end_of_test ; Interrupt 5
|
.word end_of_test ; Interrupt 5
|
.word end_of_test ; Interrupt 6
|
.word end_of_test ; Interrupt 6
|
.word end_of_test ; Interrupt 7
|
.word end_of_test ; Interrupt 7
|
.word end_of_test ; Interrupt 8
|
.word end_of_test ; Interrupt 8
|
.word end_of_test ; Interrupt 9
|
.word end_of_test ; Interrupt 9
|
.word end_of_test ; Interrupt 10 Watchdog timer
|
.word end_of_test ; Interrupt 10 Watchdog timer
|
.word end_of_test ; Interrupt 11
|
.word end_of_test ; Interrupt 11
|
.word end_of_test ; Interrupt 12
|
.word end_of_test ; Interrupt 12
|
.word end_of_test ; Interrupt 13
|
.word end_of_test ; Interrupt 13
|
.word end_of_test ; Interrupt 14 NMI
|
.word end_of_test ; Interrupt 14 NMI
|
.word main ; Interrupt 15 (highest priority) RESET
|
.word main ; Interrupt 15 (highest priority) RESET
|
|
|