#include "copyright.h"#include "machine.h"#include "addrspace.h"#include "system.h"Go to the source code of this file.
Functions | |
| unsigned int | WordToHost (unsigned int word) |
| unsigned short | ShortToHost (unsigned short shortword) |
| unsigned int | WordToMachine (unsigned int word) |
| unsigned short | ShortToMachine (unsigned short shortword) |
|
|
Definition at line 56 of file translate.cc. Referenced by main, Machine::ReadMem, and ShortToMachine.
00056 {
00057 #ifdef HOST_IS_BIG_ENDIAN
00058 register unsigned short result;
00059 result = (shortword << 8) & 0xff00;
00060 result |= (shortword >> 8) & 0x00ff;
00061 return result;
00062 #else
00063 return shortword;
00064 #endif /* HOST_IS_BIG_ENDIAN */
00065 }
|
|
|
Definition at line 71 of file translate.cc. References ShortToHost. Referenced by Machine::WriteMem.
00071 { return ShortToHost(shortword); }
|
|
|
Definition at line 42 of file translate.cc. Referenced by AddrSpace::AddrSpace, main, Machine::ReadMem, SwapHeader, and WordToMachine.
00042 {
00043 #ifdef HOST_IS_BIG_ENDIAN
00044 register unsigned long result;
00045 result = (word >> 24) & 0x000000ff;
00046 result |= (word >> 8) & 0x0000ff00;
00047 result |= (word << 8) & 0x00ff0000;
00048 result |= (word << 24) & 0xff000000;
00049 return result;
00050 #else
00051 return word;
00052 #endif /* HOST_IS_BIG_ENDIAN */
00053 }
|
|
|
Definition at line 68 of file translate.cc. References WordToHost. Referenced by Machine::WriteMem.
00068 { return WordToHost(word); }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002