/[gxemul]/upstream/0.3.2/tests/test_addu.S
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /upstream/0.3.2/tests/test_addu.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (hide annotations)
Mon Oct 8 16:18:06 2007 UTC (12 years ago) by dpavlin
File size: 696 byte(s)
0.3.2
1 dpavlin 2 /*
2     * $Id: test_addu.S,v 1.1 2004/08/22 21:22:30 debug Exp $
3     *
4     * Instruction: 'addu' (32-bit add, no overflow exception)
5     */
6    
7     .rdata
8     .align 3
9     $NL: .ascii "\n"
10    
11     .text
12     .align 4
13     .globl testmain
14     .ent testmain
15     testmain:
16     /* Save the return address: */
17     addiu $29,$29,-16
18     sd $31,0($29)
19    
20    
21     dli $6, 0x12345678
22     dli $7, 0x9abcdef0
23     addu $4, $6, $7
24    
25     addiu $5, $0, 8
26     jal printhex
27    
28     dla $4, $NL
29     jal printstr
30    
31    
32     dli $6, 0x12345678
33     dli $7, -0x9abcdef0
34     addu $4, $6, $7
35    
36     addiu $5, $0, 8
37     jal printhex
38    
39     dla $4, $NL
40     jal printstr
41    
42    
43     /* Return value: */
44     li $2, 0x1212fefe
45    
46     /* Restore the return address: */
47     ld $31,0($29)
48     addiu $29,$29,16
49    
50     /* ... and return. */
51     jr $31
52    
53     .end testmain
54    

  ViewVC Help
Powered by ViewVC 1.1.26