Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Created November 14, 2013 10:24
Show Gist options
  • Save jdiez17/7464586 to your computer and use it in GitHub Desktop.
Save jdiez17/7464586 to your computer and use it in GitHub Desktop.
var af = bc = de = hl = ix = iy = 0;
self.registers = (function() {
var self = this;
var af_ = bc_ = de_ = hl_ = ix_ = iy_ = 0;
var i = r = 0;
var masks = {
'af': 0xFFFF,
'bc': 0xFFFF
};
for(var register in masks) {
self[register.toUpperCase()] = function(value) {
if (typeof value !== 'undefined')
window[register] = value & masks[register];
return window[register];
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment