URL
https://opencores.org/ocsvn/amber/amber/trunk
Subversion Repositories amber
[/] [amber/] [trunk/] [hw/] [tests/] [ldm1.S] - Rev 66
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 the standard form of ldm. //// //// 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:@ ------------------------------------------@ 1. ldmda r14!, {r0-r12}@ ------------------------------------------ldr r14, StaticEndldmda r14!, {r0-r12}@ check that the base register, r14 was correctly updatedldr r13, StaticEndsub r13, r13, #52 @ 13 x 4cmp r13, r14movne r10, #10bne testfail@check the values loaded into r0 to r12@r0mov r13, #0x05cmp r13, r0movne r10, #20bne testfail@r1mov r13, #0x06cmp r13, r1movne r10, #30bne testfail@r2mov r13, #0x07cmp r13, r2movne r10, #40bne testfail@r3mov r13, #0x08cmp r13, r3movne r10, #50bne testfail@r4mov r13, #0x09cmp r13, r4movne r10, #60bne testfail@r5mov r13, #0x0acmp r13, r5movne r10, #70bne testfail@r6mov r13, #0x0bcmp r13, r6movne r10, #80bne testfail@r7mov r13, #0x0ccmp r13, r7movne r10, #90bne testfail@r8mov r13, #0x0dcmp r13, r8movne r10, #100bne testfail@r9mov r13, #0x0ecmp r13, r9movne r10, #110bne testfail@r10mov r13, #0x0fcmp r13, r10movne r10, #120bne testfail@r11mov r13, #0x10cmp r13, r11movne r10, #130bne testfail@r12mov r13, #0x11cmp r13, r12movne r10, #140bne testfail@ ------------------------------------------@ 2. ldmia r0, {pc}@ Test loading the pc@ ------------------------------------------ldr r0, StoreBaseldr r1, =jump2str r1, [r0]ldmia r0, {pc} @ causes a jump to 'jump2'@ these should never be executedb testfailb testfailb testfailb testfailjump2: b start3@ ------------------------------------------@ 2. ldmia r0, {r5, pc}@ Test loading the pc, as part of a group@ ------------------------------------------start3:ldr r0, StoreBasemov r1, #17str r1, [r0], #4ldr r1, =jump3str r1, [r0]ldr r0, StoreBaseldmia r0, {r5, pc} @ causes a jump to 'jump2'@ these should never be executedb testfailb testfailb testfailb testfail@ Check that r5 was loaded with the correct valuejump3: mov r7, #17cmp r5, r7movne r10, #200bne testfail@ ------------------------------------------@ ------------------------------------------b 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_STATUSStoreBase: .word 0x800StaticBase: .word Data1StaticEnd: .word Data18Data1: .word 0x00.word 0x01.word 0x02.word 0x03.word 0x04.word 0x05.word 0x06.word 0x07.word 0x08.word 0x09.word 0x0a.word 0x0b.word 0x0c.word 0x0d.word 0x0e.word 0x0f.word 0x10Data18: .word 0x11/* ========================================================================= *//* ========================================================================= */
Go to most recent revision | Compare with Previous | Blame | View Log
