c++/rgb-assembler/commands/GotoCompare.h
changeset 33 ff150572e8c0
parent 31 b997cbf9e30b
     1.1 --- a/c++/rgb-assembler/commands/GotoCompare.h	Mon Dec 25 00:34:27 2017 +0100
     1.2 +++ b/c++/rgb-assembler/commands/GotoCompare.h	Mon Dec 25 01:27:44 2017 +0100
     1.3 @@ -34,13 +34,8 @@
     1.4  		address_t gt = memory.read<address_t>();
     1.5  		address_t lt = memory.read<address_t>();
     1.6  
     1.7 -		address_t originalAddress = memory.getIndex();
     1.8 -		// TODO: add to Memory methods read(address_t) and write(address_t, T)
     1.9 -		memory.setIndex(aa);
    1.10 -		octet_t a = memory.read<octet_t>();
    1.11 -		memory.setIndex(ab);
    1.12 -		octet_t b = memory.read<octet_t>();
    1.13 -		memory.setIndex(originalAddress);
    1.14 +		octet_t a = memory.read<octet_t>(aa);
    1.15 +		octet_t b = memory.read<octet_t>(ab);
    1.16  
    1.17  		address_t index;
    1.18  
    1.19 @@ -48,7 +43,7 @@
    1.20  		else if (a > b) index = gt;
    1.21  		else index = lt;
    1.22  
    1.23 -		memory.setIndex(index);
    1.24 +		memory.setAddress(index);
    1.25  
    1.26  		wprintf(L"GOTO COMPARE  a = %02X, b = %02X, eq = %d, gt = %d, lt = %d → %d\n", a, b, eq, gt, lt, index);
    1.27  	}