Compare commits

..

No commits in common. "e9d7a608f011d2ee0fa2481ab0dff734ddaa1004" and "c320371432b9d87142971aa1586ec827675a0a33" have entirely different histories.

3 changed files with 5 additions and 8 deletions

1
8086_sim/.gitignore vendored
View File

@ -1,4 +1,3 @@
sim86
listing_0043_immediate_movs
listing_0044_register_movs
listing_0045_challenge_register_movs

BIN
8086_sim/sim86 Executable file

Binary file not shown.

View File

@ -6,8 +6,6 @@
#include <stdio.h>
#include <string.h>
#define MEM_SIZE (1 << 16)
struct basic_string {
char str[4096];
};
@ -24,9 +22,6 @@ int main(int argc, char *argv[]) {
return 1;
}
u8 memory[MEM_SIZE];
memset((void *)memory, 0, MEM_SIZE);
const char *filename = argv[1];
printf("Filename: %s\n", filename);
@ -42,7 +37,10 @@ int main(int argc, char *argv[]) {
fseek(fp, 0, SEEK_SET);
fread((void *)memory, sizeof(u8), size, fp);
u8 buffer[size + 1];
memset((void *)buffer, 0, size + 1);
fread((void *)buffer, sizeof(u8), size, fp);
fclose(fp);
@ -57,7 +55,7 @@ int main(int argc, char *argv[]) {
while (offset < size) {
instruction decoded;
Sim86_Decode8086Instruction(size - offset, memory + offset, &decoded);
Sim86_Decode8086Instruction(size - offset, buffer + offset, &decoded);
if (decoded.Op) {
offset += decoded.Size;