Skip to content

Instantly share code, notes, and snippets.

@evscott
Last active December 2, 2019 19:56
Show Gist options
  • Save evscott/a7d82a612a7c126dedc4e670d3cfb29c to your computer and use it in GitHub Desktop.
Save evscott/a7d82a612a7c126dedc4e670d3cfb29c to your computer and use it in GitHub Desktop.
Short assignment 4 part 1
void copy_loader() {
int dev_addr = START_ADDR;
char *mem_addr = (char *) malloc(length * sizeof(char));
for(int i = 0; i < LOADER_LEN; i++) {
char *byte = dev_read_byte(dev_addr, mem_addr);
dev_write_byte((int) mem_addr, byte);
dev_addr++;
mem_addr++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment