Add 6502 TSX and TXS instructions

This commit is contained in:
g1n 2021-10-14 16:02:15 +03:00
parent 7e5e9d5e30
commit 94b94c611d
3 changed files with 14 additions and 0 deletions

View File

@ -9,10 +9,18 @@ void tay(FILE *outfile) {
fwrite(TAY, 1, 1, outfile);
}
void tsx(FILE *outfile) {
fwrite(TSX, 1, 1, outfile);
}
void txa(FILE *outfile) {
fwrite(TXA, 1, 1, outfile);
}
void txs(FILE *outfile) {
fwrite(TXS, 1, 1, outfile);
}
void tya(FILE *outfile) {
fwrite(TYA, 1, 1, outfile);
}

View File

@ -15,7 +15,9 @@
void tax(FILE *outfile);
void tay(FILE *outfile);
void tsx(FILE *outfile);
void txa(FILE *outfile);
void txs(FILE *outfile);
void tya(FILE *outfile);
void inx(FILE *outfile);

View File

@ -47,6 +47,10 @@ void parser(char lexed_buf[512][128][128], FILE *outfile) { // outfile is needed
txa(outfile);
} else if (!strcmp(lexed_buf[i][j], "TYA")) {
tya(outfile);
} else if (!strcmp(lexed_buf[i][j], "TSX")) {
tsx(outfile);
} else if (!strcmp(lexed_buf[i][j], "TXS")) {
txs(outfile);
} else {
printf("Unrecognized command: %s\n", lexed_buf[i][j]);
break;