Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armv7-cpu.js / ARMv7_CPU.prototype.movt = function(inst, addr) #15

Open
fkuzume opened this issue May 1, 2021 · 0 comments
Open

armv7-cpu.js / ARMv7_CPU.prototype.movt = function(inst, addr) #15

fkuzume opened this issue May 1, 2021 · 0 comments

Comments

@fkuzume
Copy link

fkuzume commented May 1, 2021

MOVT doesn't seem to be working as expected.
Please check the following :

ARMv7_CPU.prototype.movt = function(inst, addr) {
    this.print_inst("MOVT", inst, addr);
    var imm4 = (inst >>> 16) & 0xf;
    var d = (inst >>> 12) & 0xf;
    var imm12 = inst & 0xfff;
    var imm16 = (imm4 << 12) + imm12;

    // this.regs[d] = bitops.set_bits(this.reg(d), 16, 31, imm16);  // Not working as expected
    this.regs[d] = bitops.set_bits(this.reg(d), 31, 16, imm16);  // It works correctly
    //this.print_inst_imm(addr, inst, "movw", false, d, null, imm32);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant