test/TestMemory.c
void testIndirectXAddr() {
	word addr = 0;
	// First test
	zero_ram();
	wmem_w(112, 0xAC30);
	X = 100;
	addr = indirectx_addr(12);
	assert(addr == 0xAC30);

	// Second test. Example got from here http://www.emulator101.com/6502-addressing-modes.html
	zero_ram();
	wmem_w(126, 0x2074);
	X = 100;
	addr = indirectx_addr(26);
	assert(addr == 0x2074);

	printf("Test IndirectXAddr passed!\n");
}
/**
 * Tests how the indexed indirect mode works
 */
Tests how the indexed indirect mode works
Tests how the indexed indirect mode works
void testIndirectXAddr() {
	word addr = 0;
	zero_ram();
	wmem_w(112, 0xAC30);
	X = 100;
	addr = indirectx_addr(12);
	assert(addr == 0xAC30);
	zero_ram();
	wmem_w(126, 0x2074);
	X = 100;
	addr = indirectx_addr(26);
	assert(addr == 0x2074);
	printf("Test IndirectXAddr passed!\n");
}
void testIndirectXAddr ( ) { word addr = 0 ; zero_ram ( ) ; wmem_w ( 112 , 0xAC30 ) ; X = 100 ; addr = indirectx_addr ( 12 ) ; assert ( addr == 0xAC30 ) ; zero_ram ( ) ; wmem_w ( 126 , 0x2074 ) ; X = 100 ; addr = indirectx_addr ( 26 ) ; assert ( addr == 0x2074 ) ; printf ( " \n " ) ; }
Tests how the indexed indirect mode works
Tests how the indexed indirect mode works
// First test // Second test. Example got from here http://www.emulator101.com/6502-addressing-modes.html