Provide access to CPU memory via V86Starter

This commit is contained in:
Simon Kadisch 2021-04-21 21:58:58 +02:00 committed by Fabian
parent c8581d9ba6
commit 690354e69e

View file

@ -1293,6 +1293,27 @@ V86Starter.prototype.automatically = function(steps)
};
/**
* Reads data from memory at specified offset.
*
* @param {number} offset
* @param {number} length
* @returns
*/
V86Starter.prototype.read_memory = function(offset, length) {
return this.v86.cpu.read_blob(offset, length);
};
/**
* Writes data to memory at specified offset.
*
* @param {Array.<number>|Uint8Array} blob
* @param {number} offset
*/
V86Starter.prototype.write_memory = function(blob, offset) {
this.v86.cpu.write_blob(blob, offset);
};
/**
* @ignore
* @constructor