Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / arch / .unmaintained / ppc-native / exec / getcc.s
blob338a35474dd19eff3d0b34d821986ae0997e5473
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /*****************************************************************************
8 NAME
10 AROS_LH0(UWORD, GetCC,
12 LOCATION
13 struct ExecBase *, SysBase, 88, Exec)
15 FUNCTION
16 Read the contents of the sr in a easy and compatible way.
18 INPUTS
20 RESULT
21 The contents of sr as a UWORD.
23 NOTES
25 EXAMPLE
27 BUGS
29 SEE ALSO
30 SetSR()
32 INTERNALS
33 I don't think this function will have any real use on PPC...
34 This function maps PPC:
35 CA to C
36 OV to V
37 EQ to Z
38 ?? to N
39 CA to X
41 HISTORY
43 ******************************************************************************/
45 #include "machine.i"
47 .text
48 .balign 4
49 .globl AROS_SLIB_ENTRY(GetCC,Exec)
50 .type AROS_SLIB_ENTRY(GetCC,Exec),@function
52 AROS_SLIB_ENTRY(GetCC,Exec):
53 subr
54 push scr
55 li ret,0
56 bne _notequal # Z=0
57 ori ret,ret,4 # Z=1
58 _notequal:
59 bge _positive # N=0
60 ori ret,ret,8 # N=1
61 _positive:
62 mfxer scr
63 rlwinm. scr,scr,1,0,0
64 beq _noovfl # 0? so no Overflow
65 ori ret,ret,2 # V=1
66 _noovfl:
67 mfxer scr
68 rlwinm. scr,scr,2,0,0
69 beq _nocarry # 0? so no Carry
70 ori ret,ret,17 # X=1 C=1
71 _nocarry:
72 pop scr
73 rts