1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
7 // static char *VB_Name = "modASM";
13 // --- const int ByteMask = 0xFF;
21 void Mov(int *Var, int Val)
26 void MovLowByte(int *Var, int Val)
28 *Var = (*Var & 0xFF00) | (Val & 0xFF);
31 void MovHighByte(int *Var, int Val)
37 if ((Val & 0x80) != 0)
40 *Var = (*Var & 0xFF) | Tmp;
48 LowByte = (Var & 0xFF);
49 // LowByte = ByteToInt(Tmp)
60 HighByte = ((Var & 0x7FFF) / 0x100) | 0x80;
64 HighByte = Var / 0x100;
70 int SgnHighByte(int Var) // extends the signum to 16 bit
80 SgnHighByte = ((Var & 0x7FFF) / 0x100) | 0xFF80;
84 SgnHighByte = Var / 0x100;
99 boolean GreaterOrEqual()
101 boolean GreaterOrEqual;
103 GreaterOrEqual = (0 <= cmpFlag);
105 return GreaterOrEqual;
112 Equal = (0 == cmpFlag);
117 void CMP(int A, int B)
122 void Add(int *A, int B)
127 void MySub(int *A, int B)
132 int SHR(int *Var, int Count)
140 *Var = ((*Var & 0x7FFF) / 2) | 0x4000;
147 for (i = 2; i <= Count; i++)
155 int SHL(int *Var, int Count)
161 for (i = 1; i <= Count; i++)
163 *Var = *Var & 0x7FFF;
164 if ((*Var & 0x4000) != 0)
166 *Var = (2 * (*Var & 0x3FFF)) | 0x8000;
177 int ByteToInt(byte B)
181 if ((B & 0x80) == 0x80)
183 ByteToInt = -(0xFF - B + 1);
193 byte IntToByte(int i)
197 // IntToByte = CByte(i & 0xFF);
198 IntToByte = (byte)(i & 0xFF);
203 void XCHG(int A, int B)