diff --git a/doc/marie.js.html b/doc/marie.js.html
index 9b9a3859..8c984b47 100644
--- a/doc/marie.js.html
+++ b/doc/marie.js.html
@@ -426,9 +426,11 @@
Source: marie.js
}
- //this fixes the bug, where the user tries to go beyond HEX-FFFF
- if(this[target] > 32767 || this[target] < -32768){
- throw new MarieSimError("OverFlow Error","the value " + this[target].toString() + " is beyond the calculable range");
+ if(this[target] > 32767) {
+ this[target] -= 65536;
+ }
+ else if(this[target] < -32768) {
+ this[target] += 65536
}
diff --git a/src/js/marie.js b/src/js/marie.js
index 912b4d91..71716299 100644
--- a/src/js/marie.js
+++ b/src/js/marie.js
@@ -398,9 +398,11 @@ var MarieSim,
}
- //this fixes the bug, where the user tries to go beyond HEX-FFFF
- if(this[target] > 32767 || this[target] < -32768){
- throw new MarieSimError("OverFlow Error","the value " + this[target].toString() + " is beyond the calculable range");
+ if(this[target] > 32767) {
+ this[target] -= 65536;
+ }
+ else if(this[target] < -32768) {
+ this[target] += 65536
}