OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [asm/] [wdt.S] - Blame information for rev 39

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 dgisselq
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;
3
; Filename:     wdt.S
4
;
5
; Project:      Zip CPU -- a small, lightweight, RISC CPU soft core
6
;
7
; Purpose:      Test to see whether or not the watchdog timer works.  We'll
8
;               start the watchdog, clear a register, then write as many times
9
;               as we can to memory before the watchdog kicks in.
10
;
11
; Creator:      Dan Gisselquist, Ph.D.
12
;               Gisselquist Tecnology, LLC
13
;
14
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;
16
; Copyright (C) 2015, Gisselquist Technology, LLC
17
;
18
; This program is free software (firmware): you can redistribute it and/or
19
; modify it under the terms of  the GNU General Public License as published
20
; by the Free Software Foundation, either version 3 of the License, or (at
21
; your option) any later version.
22
;
23
; This program is distributed in the hope that it will be useful, but WITHOUT
24
; ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
25
; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26
; for more details.
27
;
28
; License:      GPL, v3, as defined and found on www.gnu.org,
29
;               http://www.gnu.org/licenses/gpl.html
30
;
31
;
32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33
;
34
; Registers:
35
;       R12     Peripheral base
36
;       R11     Address of our one memory variable
37
;
38
start:
39
        CLR     R12             ; Get the address of our peripheral base
40
        LDIHI   $c000h,R12
41
        MOV     $1+PC,R11       ; Get a memory address for a variable
42
        BRA     $1
43
        .DAT    0
44 11 dgisselq
        LDI     $-1,R0  ; Start the watchdog timer
45 10 dgisselq
        STO     R0,$1(R12)
46
        LSR     $1,R0
47
        STO     R0,$4(R12)
48
        LSR     $1,R0
49
        STO     R0,$5(R12)
50
        LSR     $1,R0
51
        STO     R0,$6(R12)
52
        ;
53
        CLR     R0
54
loop:
55
        ADD     $1,R0
56
        LOD     (R11),R1
57
        CMP     R0,R1
58
        STO.LT  R0,(R11)
59
        TST     R0
60
        BLT     $2
61
        BRA     $-7
62
 
63
        HALT

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.