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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fp/] [implementation/] [mmix/] [fibgo.mms] - Blame information for rev 54

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

Line No. Rev Author Line
1 15 hellwig
* Fibonacci with frame pointers (exercise 1.4.1--15)
2
sp GREG
3
fp GREG
4
n  GREG
5
fn IS n
6
 
7
    LOC #100
8
    GREG  @
9
Fib CMP   $1,n,2
10
    PBN   $1,1F
11
    STO   fp,sp,0
12
    SET   fp,sp
13
    INCL  sp,8*4
14
    STO   $0,fp,8
15
    STO   n,fp,16
16
    SUB   n,n,1
17
    GO    $0,Fib
18
    STO   fn,fp,24 $F_{n-1}$
19
    LDO   n,fp,16
20
    SUB   n,n,2
21
    GO    $0,Fib
22
    LDO   $0,fp,24
23
    ADDU  fn,fn,$0
24
    LDO   $0,fp,8
25
    SET   sp,fp
26
    LDO   fp,sp,0
27
1H  GO    $0,$0,0
28
 
29
Main SETH  sp,Data_Segment>>48
30
     SET   n,5
31
     GO    $0,Fib
32
 
33
 
34
 

powered by: WebSVN 2.1.0

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