URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
[/] [zipcpu/] [trunk/] [sw/] [lib/] [divu.S] - Diff between revs 45 and 59
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 45 |
Rev 59 |
Line 1... |
Line 1... |
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;
|
;
|
|
; Filename: divu.S
|
|
;
|
|
; Project: Zip CPU -- a small, lightweight, RISC CPU soft core
|
|
;
|
|
; Purpose: Zip assembly file for running doing an unsigned divide.
|
|
; This routine is also called by the signed divide.
|
|
;
|
|
; Creator: Dan Gisselquist, Ph.D.
|
|
; Gisselquist Tecnology, 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
|
|
;
|
|
;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;
|
;
|
;
|
;
|
;
|
;
|
divu: ; Given R0,R1, computer R0 = R0/R1 and R1 = R0%R1
|
divu: ; Given R0,R1, computer R0 = R0/R1 and R1 = R0%R1
|
TST -1,R1
|
TST -1,R1
|
Line 91... |
Line 121... |
|
|
divu_record_result:
|
divu_record_result:
|
MOV R0,R1
|
MOV R0,R1
|
MOV R3,R0
|
MOV R3,R0
|
LOD 1(SP),R3
|
LOD 1(SP),R3
|
|
LOD 2(SP),R2
|
ADD 1,SP
|
ADD 1,SP
|
RETN
|
JMP R2
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.