Create tword (10 Bytes) pointer operand (used for 80 bit floating points).
494456
public static final Mem tword_ptr(Register base, Register index, int shift, long disp) {
        return _ptr_build(base, index, shift, disp, SIZE_TWORD);
    }
1290669
void emitX86(INST_CODE code, Operand o1, Operand o2) {
        _emitX86(code, o1, o2, _none);
    }
1236011
def _double_as_bytes(dval):
    ""
    tmp = list(struct.unpack('8B',struct.pack('d', dval)))
    if not _big_endian:
        tmp.reverse()
    return tmp
428039
public static final Mem ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
        return _ptr_build_abs(target, disp, segmentPrefix, 0);
    }
133148
def _bits_to_float(bits, lower=-90.0, middle=0.0, upper=90.0):
  """"""
  for i in bits:
    if i:
      lower = middle
    else:
      upper = middle
    middle = (upper + lower) / 2
  return middle
942079
public final void fstp(Mem dst)
  {
    assert(dst.size() == 4 || dst.size() == 8 || dst.size() == 10);
    emitX86(INST_FSTP, dst);
  }
560794
def int2str(num, radix=10, alphabet=BASE85):
    """"""
    return NumConv(radix, alphabet).int2str(num)
1269678
function(r, ptr, chr, len) {
        var i;
        for (i=0;i<len;i++) {
            r[ptr+i] = chr;
        }
    }
769712
public static final Mem tword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
        return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_TWORD);
    }
625200
public final void fidivr(Mem src)
  {
    assert(src.size() == 2 || src.size() == 4);
    emitX86(INST_FIDIVR, src);
  }
1274044
def _divu16(ins):
    ''' 
    '''
    op1, op2 = tuple(ins.quad[2:])
    if is_int(op1) and int(op1) == 0:  # 0 / A = 0
        if op2[0] in ('_', '$'):
            output = []  # Optimization: Discard previous op if not from the stack
        else:
            output = _16bit_oper(op2)  # Normalize stack

        output.append('ld hl, 0')
        output.append('push hl')
        return output

    if is_int(op2):
        op = int16(op2)
        output = _16bit_oper(op1)

        if op2 == 0:  # A * 0 = 0 * A = 0
            if op1[0] in ('_', '$'):
                output = []  # Optimization: Discard previous op if not from the stack
            output.append('ld hl, 0')
            output.append('push hl')
            return output

        if op == 1:
            output.append('push hl')
            return output

        if op == 2:
            output.append('srl h')
            output.append('rr l')
            output.append('push hl')
            return output

        output.append('ld de, %i' % op)
    else:
        if op2[0] == '_':  # Optimization when 2nd operand is an id
            rev = True
            op1, op2 = op2, op1
        else:
            rev = False
        output = _16bit_oper(op1, op2, rev)

    output.append('call __DIVU16')
    output.append('push hl')
    REQUIRES.add('div16.asm')
    return output
232676
function writeUInt64BE(buf, int64, offset) {
  if (typeof int64 !== 'number'){
    int64 = Number(int64);
  }

  const MAX_UINT32 = 0xFFFFFFFF; // 64 bits / 8 bytes.
  // write
  const big = ~~(int64 / MAX_UINT32); // ~~ is equivalent to Math.floor()
  const low = (int64 % MAX_UINT32) - big;

  if (!offset) {
    buf.writeUInt32BE(big, 0);
    buf.writeUInt32BE(low, 4);
    return buf;
  } else {
    buf.writeUInt32BE(big, offset);
    buf.writeUInt32BE(low, offset + 4);
    return buf;
  }
}
966467
public static int toShort(byte[] b, int off, boolean littleEndian) {
		if (littleEndian) {
			return ((b[off] & 0xFF) | ((b[off + 1] & 0xFF) << 8));
		}
		return (((b[off] & 0xFF) << 8) | (b[off + 1] & 0xFF));
	}
208540
def set_pointer0d(subseqs):
        """"""
        print('            . set_pointer0d')
        lines = Lines()
        lines.add(1, 'cpdef inline set_pointer0d'
                     '(self, str name, pointerutils.PDouble value):')
        for seq in subseqs:
            lines.add(2, 'if name == "%s":' % seq.name)
            lines.add(3, 'self.%s = value.p_value' % seq.name)
        return lines
61636
private static int unsignedBytesToInt(byte b0, byte b1, byte b2, byte b3) {
        return (unsignedByteToInt(b0) + (unsignedByteToInt(b1) << 8))
                + (unsignedByteToInt(b2) << 16) + (unsignedByteToInt(b3) << 24);
    }
1038010
public static void append2digits(StringBuffer buf,int i)
    {
        if (i<100)
        {
            buf.append((char)(i/10+'0'));
            buf.append((char)(i%10+'0'));
        }
    }
766950
def _astore8(ins):
    ''' 
    '''
    output = _addr(ins.quad[1])
    op = ins.quad[2]

    indirect = op[0] == '*'
    if indirect:
        op = op[1:]

    immediate = op[0] == '#'
    if immediate:
        op = op[1:]

    if is_int(op):
        if indirect:
            if immediate:
                op = str(int(op) & 0xFFFF)  # Truncate to 16bit pointer
                output.append('ld a, (%s)' % op)
            else:
                output.append('ld de, (%s)' % op)
                output.append('ld a, (de)')
        else:
            op = str(int(op) & 0xFF)  # Truncate to byte
            output.append('ld (hl), %s' % op)
            return output

    elif op[0] == '_':
        if indirect:
            if immediate:
                output.append('ld a, (%s)' % op)  # Redundant: *#_id == _id
            else:
                output.append('ld de, (%s)' % op)  # *_id
                output.append('ld a, (de)')
        else:
            if immediate:
                output.append('ld a, %s' % op)  # #_id
            else:
                output.append('ld a, (%s)' % op)  # _id
    else:
        output.append('pop af')  # tn

    output.append('ld (hl), a')

    return output