URL
https://opencores.org/ocsvn/amber/amber/trunk
Subversion Repositories amber
[/] [amber/] [trunk/] [hw/] [tests/] [ldr_str_pc.S] - Rev 64
Go to most recent revision | Compare with Previous | Blame | View Log
/*****************************************************************// //// Amber 2 Core Instruction Test //// //// This file is part of the Amber project //// http://www.opencores.org/project,amber //// //// Description //// Tests lrd and str of r15 //// //// Author(s): //// - Conor Santifort, csantifort.amber@gmail.com //// ////////////////////////////////////////////////////////////////////// //// Copyright (C) 2010 Authors and OPENCORES.ORG //// //// This source file may be used and distributed without //// restriction provided that this copyright statement is not //// removed from the file and that any derivative work contains //// the original copyright notice and the associated disclaimer. //// //// 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 by the Free Software Foundation; //// either version 2.1 of the License, or (at your option) any //// later version. //// //// This source is distributed in the hope that it will be //// useful, but WITHOUT ANY WARRANTY; without even the implied //// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //// PURPOSE. See the GNU Lesser General Public License for more //// details. //// //// You should have received a copy of the GNU Lesser General //// Public License along with this source; if not, download it //// from http://www.opencores.org/lgpl.shtml //// //*****************************************************************/#include "amber_registers.h".section .text.globl mainmain:mov r0, #0x800@ this saves with pc and status bits1: str pc, [r0]nopnopldr r1, [r0]@ Check that the mode (supervisor) was savedand r2, r1, #3cmp r2, #3movne r10, #10bne testfail@ Check that the correct pc value (location + 12) was savedldr r6, FilterPCand r3, r1, r6ldr r4, =1badd r4, r4, #12cmp r3, r4movne r10, #20bne testfail@ loading the pc with ldr only changes the pc values,@ not the status bitsldr pc, =pcxb testfailb testfailb testfailb testfail@ if the jump is 1 ahead or 1 behind the@ test will failpcx: b 2fb testfailb testfailb testfailb testfail@ Check that the pc load did not change the status bits,@ - that we're still in supervisor mode2: mov r1, pcand r2, r1, #3cmp r2, #3movne r10, #30bne testfailb testpasstestfail:ldr r11, AdrTestStatusstr r10, [r11]b testfailtestpass:ldr r11, AdrTestStatusmov r10, #17str r10, [r11]b testpass/* Write 17 to this address to generate a Test Passed message */AdrTestStatus: .word ADR_AMBER_TEST_STATUS/* Mark the location of the pc bits of r15 */FilterPC: .word 0x03fffffcLoadPC: .word =pcx/* ========================================================================= *//* ========================================================================= */
Go to most recent revision | Compare with Previous | Blame | View Log
