URL
https://opencores.org/ocsvn/xulalx25soc/xulalx25soc/trunk
Subversion Repositories xulalx25soc
[/] [xulalx25soc/] [trunk/] [bench/] [asm/] [genlrs.S] - Rev 4
Compare with Previous | Blame | View Log
////////////////////////////////////////////////////////////////////////////////
//
// Filename: genlrs.S
//
// Project: XuLA2 board
//
// Purpose:
//
//
// Creator: Dan Gisselquist, Ph.D.
// Gisselquist Technology, LLC
//
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015, Gisselquist Technology, LLC
//
// This program is free software (firmware): you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// License: GPL, v3, as defined and found on www.gnu.org,
// http://www.gnu.org/licenses/gpl.html
//
//
////////////////////////////////////////////////////////////////////////////////
//
//
entry:
; ; R0 -- used by test_lrs
; ; R1 -- used by test_lrs
; ; R2 -- used by test_lrs
; ; R3 = return address
LDI 0x80000000,R4 ; Taps
LDI 0x00800000,R6 ; Current Memory Address
MOV R6,R7 ; Start of memory
LDI 0x00ffffff,R8 ; End of memory
test_next_lrs:
MOV __HERE__+2(PC),R3
BRA test_lrs
CMP 0,R0
BGE next_tap_set
STO R0,(R6)
ADD 1,R6
AND R8,R6
OR R7,R6
next_tap_set:
ADD 1,R4
BNZ test_next_lrs
HALT
test_lrs:
; R0 = taps on entry
; R0 = length on return
; R3 = return PC address
CLR R1 ; R1 will be our length
LDI 1,R2 ; R2 will be our fill
test_lrs_loop:
LSR 1,R2
XOR.C R0,R2
ADD 1,R1
CMP 1,R2
BNZ test_lrs_loop
MOV R1,R0
MOV R3,PC