Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 814 Bytes

label.md

File metadata and controls

46 lines (32 loc) · 814 Bytes

label - Insert Label

label command inserts a Label expression into the code.

const myLabel = _('label', 'label_name');

Store data from memory to RAX register

const asm = X64();

asm.code(_ => {
    const myLabel = _('label', 'label_name');
    _('db', [1, 2, 3, 4]);

    _('mov', ['rax', _('rip').disp(myLabel)]);
});

console.log(String(asm));
asm.compile();
console.log(String(asm));

Custom label lbl

Create a label manually using _.lbl() method and insert it into the code manualy using _.insert() method.

const asm = X64();

asm.code(_ => {
    const myLabel = _.lbl('label_name');

    _('mov', ['rax', _('rip').disp(myLabel)]);

    _.insert(myLabel);
    _('db', [1, 2, 3, 4]);
});

console.log(String(asm));
asm.compile();
console.log(String(asm));