ivan-pi / fc8

Fortran CHIP-8 interpreter
GNU General Public License v3.0
7 stars 1 forks source link

Out of bounds error #13

Open ivan-pi opened 10 months ago

ivan-pi commented 10 months ago
~/FC8/build$ ./FC8-Xlib ../cartridges/oob_test_2.ch8 
 ../cartridges/oob_test_2.ch8                                                                                                                                                                                                                                    
Open display done.
At line 605 of file /Users/di75yas/FC8/src/FC8_vm-Xlib.f90
Fortran runtime error: Index '4096' of dimension 1 of array 'memory' above upper bound of 4095

This as an out of bounds access in the BCD instruction:

https://github.com/ivan-pi/fc8/blob/225c1a0bebce9ed913f7c6da90e83633156fc011/src/fc8_vm.F90#L629

(I was using an older version of the interpreter.)