sc68fordevelopers  2.2.1
Functions
endian68.h File Reference

System byte order. More...

Go to the source code of this file.

Functions

int SC68byte_order (void)
 Get integer byte order. More...
 
int SC68little_endian (void)
 Check if byte order is little endian. More...
 
int SC68big_endian (void)
 Check if byte order is big endian. More...
 

Detailed Description

System byte order.

Author
Benjamin Gerard ben@s.nosp@m.ashi.nosp@m.pa.co.nosp@m.m
Date
2003/08/12
Id
endian68.h,v 2.0 2003/08/21 04:58:35 benjihan Exp

Function Documentation

int SC68byte_order ( void  )

Get integer byte order.

The SC68byte_order() function returns an integer which gives the position of each byte in the memory.

Examples:

  • Intel little endian will return 0x03020100.
  • Motorola big endian will return 0x00010203.
Returns
byte order.
int SC68little_endian ( void  )

Check if byte order is little endian.

The SC68little_endian() function checks if the byte order is little endian.

Returns
little endian test.
Return values
1byte order is little endian.
0byte order is not little endian.
Warning
The function only test if the less signifiant byte is stored at offset 0.
int SC68big_endian ( void  )

Check if byte order is big endian.

The SC68big_endian() function checks if the byte order is big endian. By the way it returns !SC68little_endian().

Returns
big endian test.
Return values
1byte order is big endian.
0byte order is not big endian.
See also
SC68little_endian();