wokwi / avr8js

Arduino (8-bit AVR) simulator, written in JavaScript and runs in the browser / Node.js
https://blog.wokwi.com/avr8js-simulate-arduino-in-javascript/
MIT License
462 stars 73 forks source link

Incorrect memory address for RAMPZ / EIND (affects ATmega2560) #61

Closed urish closed 3 years ago

urish commented 3 years ago

Currently, the code assumes the RAMPZ is at 0x3b, and EIND is at 0x3c. These are the I/O address space addresses of the registers. However, we are using the data address space to address these registers. This means we need to access RAMPZ at 0x5b, and EIND at 0x5c.

These issue only affect devices with >64KB of flash memory, such as the ATmega2560. It affects the following instructions:

These instructions were introduced by #31.