Commit 0ed87a67 authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

from  Benoît Perrot  <benoit@lrde.epita.fr>
        * tests/good/fact.s, tests/good/Makefile.am:
        Add new test.
parent b06225a4
2004-05-08 Benot Perrot <benoit@lrde.epita.fr>
* tests/good/fact.s, tests/good/Makefile.am:
Add new test.
2004-05-08 Benot Perrot <benoit@lrde.epita.fr>
* src/inst/register.hh:
......
......@@ -2,30 +2,20 @@
(Created-By-Prcs-Version 1 3 2)
(Project-Description "")
(Project-Version mipsy 0 94)
(Parent-Version mipsy 0 93)
(Project-Version mipsy 0 95)
(Parent-Version mipsy 0 94)
(Version-Log
"Index: ChangeLog
from Benot Perrot <benoit@lrde.epita.fr>
* src/inst/register.hh:
Add a copy constructor.
* dev/inst-nodes-gen.py:
Copy inst::Registers instead of keeping a pointer on them,
avoiding hazardous memory manipulations.
* dev/inst-builder-gen.py, src/inst/program_builder.cc,
* src/vm/cpu.cc (bubble_):
Prefer copy to reallocation of inst::Registers.
* dev/parse-asm-parse-gen.py:
Once they are copied, delete the inst::Registers created by the
scanner.
* tests/good/fact.s, tests/good/Makefile.am:
Add new test.
")
(New-Version-Log
"")
(Checkin-Time "Sat, 08 May 2004 19:38:13 +0200")
(Checkin-Time "Sat, 08 May 2004 21:23:55 +0200")
(Checkin-Login benoit)
(Files
......@@ -33,7 +23,7 @@ from Beno
;; ./
(AUTHORS (mipsy/0_AUTHORS 1.2 644))
(COPYING (mipsy/1_COPYING 1.1 644))
(ChangeLog (mipsy/2_ChangeLog 1.88 604))
(ChangeLog (mipsy/2_ChangeLog 1.89 604))
(INSTALL (mipsy/b/12_INSTALL 1.1 604))
(Makefile.am (mipsy/3_Makefile.a 1.9 604))
(NEWS (mipsy/b/25_NEWS 1.10 604))
......@@ -143,12 +133,13 @@ from Beno
(tests/mipsy-check (mipsy/b/29_mipsy-chec 1.1 745))
;; ./tests/good/
(tests/good/Makefile.am (mipsy/b/30_Makefile.a 1.2 604))
(tests/good/Makefile.am (mipsy/b/30_Makefile.a 1.3 604))
(tests/good/add-sub.s (mipsy/b/31_add-sub.s 1.2 644))
(tests/good/and-or-nor-xor.s (mipsy/b/32_and-or-nor 1.2 644))
(tests/good/check-good (mipsy/c/9_check-good 1.2 705))
(tests/good/exit.s (mipsy/b/33_exit.s 1.2 644))
(tests/good/extended-euclide.s (mipsy/b/34_extended-e 1.2 644))
(tests/good/fact.s (mipsy/c/26_fact.s 1.1 644))
(tests/good/gtcd.s (mipsy/b/35_gtcd.s 1.2 644))
(tests/good/modular-exponent.s (mipsy/b/36_modular-ex 1.2 644))
(tests/good/neg.s (mipsy/b/37_neg.s 1.2 644))
......
......@@ -10,6 +10,7 @@ ASM_FILES = \
not.s \
seq-sne.s \
shift.s \
fact.s \
gtcd.s \
extended-euclide.s \
modular-exponent.s
......
## This file was originaly generated by gcc,
## then adapted to fit Mipsy's functionalities
.text
fact:
subu $sp,$sp,32
sw $31,28($sp)
sw $fp,24($sp)
move $fp,$sp
sw $4,32($fp)
lw $2,32($fp)
slt $2,$2,2
beq $2,$0,L2
li $2,1 # 0x1
sw $2,16($fp)
j L1
L2:
lw $2,32($fp)
addu $2,$2,-1
move $4,$2
jal fact
move $3,$2
lw $2,32($fp)
mul $2,$3,$2
# mult $3,$2
# mflo $2
sw $2,16($fp)
L1:
lw $2,16($fp)
move $sp,$fp
lw $31,28($sp)
lw $fp,24($sp)
addu $sp,$sp,32
jr $31
.data
eol:
.asciiz "\n"
.text
main:
subu $sp,$sp,24
sw $31,20($sp)
sw $fp,16($sp)
move $fp,$sp
li $4,10 # 0xa
jal fact
# printf("%d\n", fact(10))
move $a0,$v0
li $v0, 1
syscall
la $a0, eol
li $v0, 4
syscall
move $sp,$fp
lw $31,20($sp)
lw $fp,16($sp)
addu $sp,$sp,24
li $a0, 0
li $v0, 10
syscall
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment