1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
8 void Mov(int *Var, int Val)
13 void MovLowByte(int *Var, int Val)
15 *Var = (*Var & 0xFF00) | (Val & 0xFF);
18 void MovHighByte(int *Var, int Val)
25 if ((Val & 0x80) != 0)
28 *Var = (*Var & 0xFF) | Tmp;
35 LowByte = (Var & 0xFF);
45 HighByte = ((Var & 0x7FFF) / 0x100) | 0x80;
47 HighByte = Var / 0x100;
52 int SgnHighByte(int Var) // extends the signum to 16 bit
61 SgnHighByte = ((Var & 0x7FFF) / 0x100) | 0xFF80;
63 SgnHighByte = Var / 0x100;
68 int SHL(int *Var, int Count)
74 for (i = 1; i <= Count; i++)
78 if ((*Var & 0x4000) != 0)
79 *Var = (2 * (*Var & 0x3FFF)) | 0x8000;
87 int SHR(int *Var, int Count)
94 *Var = ((*Var & 0x7FFF) / 2) | 0x4000;
98 for (i = 2; i <= Count; i++)
104 int ByteToInt(byte B)
108 if ((B & 0x80) == 0x80)
109 ByteToInt = -(0xFF - B + 1);
116 byte IntToByte(int i)
120 IntToByte = (byte)(i & 0xFF);