generating code for casts!
This commit is contained in:
parent
bba56d2b51
commit
017a70ee7e
8 changed files with 423 additions and 101 deletions
14
README.md
14
README.md
|
@ -119,6 +119,12 @@ ax bx cx dx sp bp si di
|
|||
│ mov r8, rax │ 49 89 c0 │ set r8 to rax (only used for syscalls) │
|
||||
│ mov r9, rax │ 49 89 c1 │ set r9 to rax (only used for syscalls) │
|
||||
│ mov r10, rax │ 49 89 c2 │ set r10 to rax (only used for syscalls)│
|
||||
| movsx rax, al | 48 0f be c0 | sign-extend al to rax |
|
||||
| movsx rax, ax | 48 0f bf c0 | sign-extend ax to rax |
|
||||
| movsx rax, eax | 48 63 c0 | sign-extend eax to rax |
|
||||
| movzx rax, al | 48 0f b6 c0 | zero-extend al to rax |
|
||||
| movzx rax, ax | 48 0f b7 c0 | zero-extend ax to rax |
|
||||
| mov eax, eax | 89 c0 | zero-extend eax to rax |
|
||||
│ xchg rax, rbx │ 48 93 │ exchange the values of rax and rbx │
|
||||
│ mov [rbx], rax │ 48 89 03 │ store rax as 8 bytes at address rbx │
|
||||
│ mov rax, [rbx] │ 48 8b 03 │ load 8 bytes from address rbx into rax │
|
||||
|
@ -175,6 +181,14 @@ ax bx cx dx sp bp si di
|
|||
│ ja IMM32 │ 0f 87 IMM32 │ jump if "above" (like jg but unsigned) │
|
||||
│ jbe IMM32 │ 0f 86 IMM32 │ jump if below or equal to │
|
||||
│ jae IMM32 │ 0f 83 IMM32 │ jump if above or equal to │
|
||||
│ movss xmm0, [rax] │ f3 0f 10 00 │ load the float at *rax into xmm0 │
|
||||
│ movsd xmm0, [rax] │ f2 0f 10 00 │ load the double at *rax into xmm0 │
|
||||
│ movss [rax], xmm0 │ f3 0f 11 00 │ store the float in xmm0 at *rax │
|
||||
│ movsd [rax], xmm0 │ f2 0f 11 00 │ store the double in xmm0 at *rax │
|
||||
| cvtss2sd xmm0, xmm0 | f3 0f 5a c0 | convert xmm0 from float to double |
|
||||
| cvtsd2ss xmm0, xmm0 | f2 0f 5a c0 | convert xmm0 from double to float |
|
||||
| cvttsd2si rax, xmm0 | f2 48 0f 2c c0 | convert double in xmm0 to int in rax |
|
||||
| cvtsi2sd xmm0, rax | f2 48 0f 2a c0 | convert int in rax to double in xmm0 |
|
||||
│ call rax │ ff d0 │ call the function at address rax │
|
||||
│ ret │ c3 │ return from function │
|
||||
│ syscall │ 0f 05 │ execute a system call │
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue