Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

x86 instruction cross-reference

This table maps programmer intent. “Sequence” means there is no single direct equivalent.

x86 conceptRISC-VMappingImportant difference
mov reg, regmv pseudodirectexpands to an integer instruction
mov reg, immli pseudodirect intentmay expand to several instructions
mov reg, [mem]lb/lh/lw/ld, unsigned variantsdirectextension behaviour is explicit
mov [mem], regsb/sh/sw/sddirectno general memory-to-memory move
movzx / movsx loadunsigned/signed load variantdirectselected by load mnemonic
addadd / addidirectthree operands; no flags
subsub; addi with negative immediatedirect/nearno subi in the base ISA
inc / decaddi rd, rs, 1/-1direct intentno dedicated opcode; no flags
and / or / xorsame names, or andi/ori/xoridirectimmediate forms are separate
not / negsame-name pseudosdirect intentaliases over base instructions
shl / salsll / sllidirectno carry flag
shrsrl / srlidirectlogical right shift
sarsra / sraidirectarithmetic right shift
lea dst, [a+b]add dst, a, boften directcomplex scale/index forms need a sequence
lea dst, [rip+disp]auipc pair / lanearrelocation-aware sequence
cmp a, b; je/jnebeq / bnefused intentno stored flags
cmp; jl/jgeblt / bgefused intentsignedness in mnemonic
cmp; jb/jaebltu / bgeufused intentunsigned comparison
setl / setb / setccslt / sltu and immediate formsdirectwrites a full register, not a byte; no flags needed
test r, r; jzbeqz r, label pseudofused intentcompares directly with x0
jmp labelj label pseudodirect intentexpands to jal x0
jmp regjr reg pseudodirect intentexpands to jalr x0
callcall pseudo / jal radirect intentreturn address goes in ra, not on stack
retret pseudodirect intentjumps through ra
push / popadjust sp plus stores/loadssequencedeliberately not single instructions
syscallecallenvironment-dependentABI supplies syscall convention
int3ebreakneararchitectural exception model differs
nopnop pseudodirect intentcanonical encoding is addi x0,x0,0
cmovccbranch sequence or Zicond operationssequence/extensionbase ISA has no flags or conditional move
rep movsbloop or vector/library implementationsequenceno base string engine