var keystone = require('.')
console.log('Using keystone ' + keystone.version.major + '.' + keystone.version.minor)
var ks, assembly, result
if (! keystone.is_arch_supported(keystone.ARCH_X86)) {
throw 'Warning: X86 architecture not supported by keystone.'
}
ks = new keystone.Ks(keystone.ARCH_X86, keystone.MODE_64)
assembly = 'inc rcx; dec rbx'
result = ks.asm(assembly)
console.log('"' + assembly + '"', ':', result.encoding)
assembly = 'lea rax, [label1]\nnop\nnop\nlabel1:'
ks.syntax = keystone.OPT_SYNTAX_NASM
result = ks.asm(assembly)
console.log('"' + assembly.replace(/\n/g, '; ') + '"', ':', result.encoding)
ks.close()