Collection of fragments for development
Within this article we want to provide further information and snippets about our development on HyperbolaBSD.
Assembler instructions
C / C++ | amd64/x86_64 at&t | amd64/x86_64 intel | |
---|---|---|---|
dec | val = –val; | decl $r11; | dec r11; |
inc | val = ++val; | incl $r11; | inc r11; |
mov | val = 1; | movl $1, %r11; | mov r11, 1; |
add | val += 1; | addl $1, %r11; | add r11, 1; |
neg | val = -val; | negl %r11; | neg r11; |
sub | val -= 1; | subl $1, %r11; | sub r11, 1; |
div | uint acc = 4; acc /= val; |
movl $4, %rax; divl %r11; |
mov rax, 4; div r11; |
idiv | int acc = 4; acc /= val; |
movl $4, %rax; idivl %r11; |
mov rax, 4; idiv r11; |
mul | uint acc = 4; acc *= val; |
movl $4, %rax; mull %r11; |
mov rax, 4; mul r11; |
imul | int acc = 4; acc *= val; |
movl $4, %rax; imull %r11; |
mov rax, 4; imul r11; |
and | val &= 1; | andl $1, %r11; | and r11, 1; |
not | val = ~val; | notl %r11; | not r11; |
or | = 1; | orl $1, %r11; | or r11, 1; |
xor | val ^= 1; | xorl $1, %r11; | xor r11, 1; |
test | val & 1 | testl $1, %r11; | test r11, 1; |
call | label(); | call label; | call label; |
cmp | val ⇔ 1 | cmpl $1, %r11; | cmp r11, 1; |
jmp | goto label; | jmp label; | jmp label; |
ret | return; | ret; | ret; |
je | if (val == res) goto label; |
cmpl $r11, %r12; je label; |
cmp $r12, %r11; je label; |
jg | if (val > res) goto label; |
cmpl $r11, %r12; jg label; |
cmp $r12, %r11; jg label; |
jge | if (val >= res) goto label; |
cmpl $r11, %r12; jge label; |
cmp $r12, %r11; jge label; |
jl | if (val < res) goto label; |
cmpl $r11, %r12; jl label; |
cmp $r12, %r11; jl label; |
jle | if (val ⇐ res) goto label; |
cmpl $r11, %r12; jle label; |
cmp $r12, %r11; jle label; |
jne | if (val != res) goto label; |
cmpl $r11, %r12; jne label; |
cmpl $r12, %r11; jne label; |
jz | if (val == res) goto label; |
cmpl $r11, %r12; jz label; |
cmpl $r12, %r11; jz label; |