Add 6502 TAX instruction

This commit is contained in:
g1n 2021-10-14 15:45:10 +03:00
parent d3bcbf974a
commit f9b2019e7a
5 changed files with 16 additions and 7 deletions

View File

@ -1,6 +1,10 @@
#include <stdio.h>
#include "6502.h"
void tax(FILE *outfile) {
fwrite(TAX, 1, 1, outfile);
}
void txa(FILE *outfile) {
fwrite(TXA, 1, 1, outfile);
}

View File

@ -13,6 +13,7 @@
#define NOP "\xEA"
void tax(FILE *outfile);
void txa(FILE *outfile);
void tya(FILE *outfile);

View File

@ -39,6 +39,8 @@ void parser(char lexed_buf[512][128][128], FILE *outfile) { // outfile is needed
inx(outfile);
} else if (!strcmp(lexed_buf[i][j], "INY")) {
iny(outfile);
} else if (!strcmp(lexed_buf[i][j], "TAX")) {
tax(outfile);
} else if (!strcmp(lexed_buf[i][j], "TXA")) {
txa(outfile);
} else if (!strcmp(lexed_buf[i][j], "TYA")) {

View File

@ -1,9 +1,11 @@
NOP
INX
INX
INY
TXA
INY
INY
INY
TYA
INY
TAX
INX
INX
TYA
INY
INY
INY

View File

@ -1 +1 @@
кииИЉИИИ<EFBFBD>
ИИ<EFBFBD>ИЄии<EFBFBD>ИИИ