Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:manual:contrib:developer_collection [2024/03/02 00:28]
throgh [Assembler instructions]
en:manual:contrib:developer_collection [2024/03/02 01:31] (current)
throgh [Assembler instructions]
Line 54: Line 54:
 ! movl $4, %rax;\\ idivl %r11; ! movl $4, %rax;\\ idivl %r11;
 ! mov rax, 4;\\ idiv 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;
 +|-
 +! colspan="4"|  
 +|-
 +! and
 +! val &= 1;
 +! andl $1, %r11;
 +! and r11, 1;
 +|-
 +! not
 +! val = ~val;
 +! notl %r11;
 +! not r11;
 +|-
 +! or
 +! val |= 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;
 +|-
 +! colspan="4"|  
 +|-
 +! 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;
 +|-
 +! colspan="4"|  
 +|-
 +! 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;
 |- |-
 |} |}