ReadLeUInt16() 공개 메소드

public ReadLeUInt16 ( Address addr ) : ushort
addr Address
리턴 ushort
예제 #1
0
 private Address ReadSegPtr(MemoryArea mem, uint offset)
 {
     var off = mem.ReadLeUInt16(offset);
     var seg = mem.ReadLeUInt16(offset + 2);
     return Address.SegPtr(seg, off);
 }
예제 #2
0
 public ushort PeekLeUInt16(uint offset)
 {
     return(MemoryArea.ReadLeUInt16(bytes, offset + (uint)off));
 }
예제 #3
0
 public short PeekLeInt16(int offset)
 {
     return((short)MemoryArea.ReadLeUInt16(bytes, offset + (uint)off));
 }
예제 #4
0
		// Unpacks the relocation entries in a LzExe 0.91 binary

		private SegmentMap Relocate91(byte [] abUncompressed, ushort segReloc, MemoryArea pgmImgNew)
		{
            const int CompressedRelocationTableAddress = 0x0158;
            var relocations = pgmImgNew.Relocations;
			int ifile = lzHdrOffset + CompressedRelocationTableAddress;

			int rel_off=0;
			for (;;)
			{
    			ushort span = abUncompressed[ifile++];
				if (span == 0)
				{
					span = abUncompressed[ifile++];
					span |= (ushort) (abUncompressed[ifile++] << 8);
					if (span == 0)
					{
						rel_off += 0x0FFF0;
						continue;
					}
					else if (span == 1)
					{
						break;
					}
				}

				rel_off += span;
				ushort seg = (ushort) (pgmImgNew.ReadLeUInt16((uint)rel_off) + segReloc);
				pgmImgNew.WriteLeUInt16((uint)rel_off, seg);
				relocations.AddSegmentReference((uint)rel_off, seg);
				segmentMap.AddSegment(
                    new ImageSegment(
                        seg.ToString("X4"),
                        Address.SegPtr(seg, 0),
                        this.imgLoaded,
                        AccessMode.ReadWriteExecute));
			}
			return segmentMap;
		}