This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public byte ReadByte(ushort seg, ushort offset) | |
{ | |
return memory[(seg << 4) + offset]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Selector | |
{ | |
public byte[] memory; | |
} | |
Selector[] _selectorTable; | |
public byte ReadByte(ushort seg, ushort offset) | |
{ | |
var sel = _selectorTable[seg >> 3]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Selector | |
{ | |
public byte[] memory; | |
bool writable; | |
} | |
Selector[] _selectorTable; | |
public void WriteByte(ushort seg, ushort offset, byte value) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IBus | |
{ | |
byte ReadByte(ushort seg, ushort offset); | |
void WriteByte(ushort seg, ushort offset, byte value); | |
ushort ReadPortWord(ushort port); | |
void WritePortWord(ushort port, ushort value); | |
bool IsExecutableSelector(ushort seg); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void Adc_Eb_Gb() | |
{ | |
WriteByte(0, 100, 40); | |
FlagC = true; | |
al = 20; | |
emit("adc byte [100], al"); | |
run(); | |
Assert.AreEqual(ReadByte(0, 100), 61); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a CPU | |
_cpu = new CPU(); | |
// Setup the memory bus | |
_cpu.Bus = _memoryHeap; | |
// Setup some registers | |
_cpu.cs = 0x10; | |
_cpu.ip = 0x100; | |
_cpu.ax = whatever; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NeFileReader - opens a 16-bit "NE" file | |
public class NeFileReader : IDisposable | |
{ | |
// Constructor, throws exception if error, keeps file open, call IDispose to close | |
public NeFileReader(string filename); | |
// Name of currently open file | |
public string FileName { get; } | |
// Name of the module extract from name table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE DUMP: C:\Users\brad\Dropbox\Win16\Games2\WEPUTIL.DLL | |
App Flags: FullScreeen | WinPMCompat | DLL | |
Auto Data Segment: 3 | |
CS:IP: 0001:19D2 | |
SS:SP: 0000:0000 | |
Stack Size: 0x0000 | |
Imported Name Table: | |
1: KERNEL | |
8: GDI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File Map: | |
00000000 - 0000003E [003E] MZ Header | |
0000003E - 00000080 [0042] - | |
00000080 - 000000C0 [0040] NE Header | |
000000C0 - 000000D8 [0018] Segment Table | |
000000D8 - 000001AB [00D3] Resource table | |
000001AB - 000001AC [0001] - | |
000001AC - 000001BD [0011] Resident name table | |
000001BD - 0000029C [00DF] - | |
0000029C - 000003FB [015F] Non-resident name table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Allocation represents the actual memory behind one or more selectors | |
public class Allocation | |
{ | |
public Allocation(uint bytes, ushort flags) | |
{ | |
this.flags = flags; | |
buffer = new byte[bytes]; | |
} | |
public ushort flags; // GlobalAlloc flags | |
public byte[] buffer; // The actual "memory"! |
OlderNewer