/home/mandrake/rpm/BUILD/sc68-2.2.1/emu68/inst68.h File Reference


Detailed Description

68k arithmetic and logical instruction emulation.

Author:
Ben(jamin) Gerard <ben@sashipa.com>
Date:
13/03/1999
Version:
Id
inst68.h,v 2.1 2003/09/30 06:29:57 benjihan Exp

Logical and arithmetical instructions are emulated with functions instead of macros to prevent from excessive code size generation that hurt processor cache. By the way these functions could easily be written in assembler and improve emulator execution time. All these functions work with 32 bit values. To perform other size instructions, operands must be left shifted in order to locate operands most signifiant bit at the 31st bit.

#include "emu68/type68.h"

Go to the source code of this file.

Functions

Arithmetic instructions.
s32 add68 (s32 a, s32 b, s32 c)
 Addition.
s32 sub68 (s32 a, s32 b, s32 c)
 Subtraction.
s32 muls68 (s32 a, s32 b)
 Signed multiplication.
s32 mulu68 (u32 a, u32 b)
 Unsigned multiplication.
s32 divs68 (s32 a, s32 b)
 Signed divide.
s32 divu68 (u32 a, u32 b)
 Unsigned divide.
Logical instructions.
s32 and68 (u32 a, u32 b)
 Bitwise AND.
s32 orr68 (u32 a, u32 b)
 Bitwise OR.
s32 eor68 (u32 a, u32 b)
 Bitwise exclusif OR.
s32 not68 (s32 s)
 First complement.


Function Documentation

s32 add68 ( s32  a,
s32  b,
s32  c 
)

Addition.

Returns:
a+b+c

s32 sub68 ( s32  a,
s32  b,
s32  c 
)

Subtraction.

Returns:
a-b-c

s32 muls68 ( s32  a,
s32  b 
)

Signed multiplication.

Returns:
(a>>16)*(b>>16)

s32 mulu68 ( u32  a,
u32  b 
)

Unsigned multiplication.

Returns:
(a>>16)*(b>>16)

s32 divs68 ( s32  a,
s32  b 
)

Signed divide.

Returns:
MSW:a%(b>>16) LSW:a/(b>>16)

s32 divu68 ( u32  a,
u32  b 
)

Unsigned divide.

Returns:
MSW:a%(b>>16) LSW:a/(b>>16)

s32 and68 ( u32  a,
u32  b 
)

Bitwise AND.

Returns:
a&b

s32 orr68 ( u32  a,
u32  b 
)

Bitwise OR.

Returns:
a|b

s32 eor68 ( u32  a,
u32  b 
)

Bitwise exclusif OR.

Returns:
a^b

s32 not68 ( s32  s  ) 

First complement.

Returns:
~s


Generated on Tue Jul 29 02:05:24 2008 for sc68fordevelopers by  doxygen 1.5.6