Обновить lab2/README.md
This commit is contained in:
@@ -40,64 +40,5 @@ int main(){
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
```
|
|
||||||
|
|
||||||
Код компилятора:
|
|
||||||
```asm
|
|
||||||
"makeFloat":
|
|
||||||
push rbp
|
|
||||||
mov rbp, rsp
|
|
||||||
mov DWORD PTR [rbp-20], edi
|
|
||||||
mov BYTE PTR [rbp-21], sil
|
|
||||||
mov DWORD PTR [rbp-28], edx
|
|
||||||
mov eax, DWORD PTR [rbp-20]
|
|
||||||
sal eax, 31
|
|
||||||
mov edx, eax
|
|
||||||
movzx eax, BYTE PTR [rbp-21]
|
|
||||||
sal eax, 23
|
|
||||||
or edx, eax
|
|
||||||
mov eax, DWORD PTR [rbp-28]
|
|
||||||
and eax, 8388607
|
|
||||||
or eax, edx
|
|
||||||
mov DWORD PTR [rbp-4], eax
|
|
||||||
movss xmm0, DWORD PTR [rbp-4]
|
|
||||||
pop rbp
|
|
||||||
ret
|
|
||||||
.LC0:
|
|
||||||
.string "Custom 1.0f = %f\n"
|
|
||||||
.LC1:
|
|
||||||
.string "Custom -2.5f = %f\n"
|
|
||||||
"main":
|
|
||||||
push rbp
|
|
||||||
mov rbp, rsp
|
|
||||||
sub rsp, 16
|
|
||||||
mov edx, 0
|
|
||||||
mov esi, 127
|
|
||||||
mov edi, 0
|
|
||||||
call "makeFloat"
|
|
||||||
movd eax, xmm0
|
|
||||||
mov DWORD PTR [rbp-4], eax
|
|
||||||
pxor xmm1, xmm1
|
|
||||||
cvtss2sd xmm1, DWORD PTR [rbp-4]
|
|
||||||
movq rax, xmm1
|
|
||||||
movq xmm0, rax
|
|
||||||
mov edi, OFFSET FLAT:.LC0
|
|
||||||
mov eax, 1
|
|
||||||
call "printf"
|
|
||||||
mov edx, 2097152
|
|
||||||
mov esi, 128
|
|
||||||
mov edi, 1
|
|
||||||
call "makeFloat"
|
|
||||||
movd eax, xmm0
|
|
||||||
mov DWORD PTR [rbp-8], eax
|
|
||||||
pxor xmm2, xmm2
|
|
||||||
cvtss2sd xmm2, DWORD PTR [rbp-8]
|
|
||||||
movq rax, xmm2
|
|
||||||
movq xmm0, rax
|
|
||||||
mov edi, OFFSET FLAT:.LC1
|
|
||||||
mov eax, 1
|
|
||||||
call "printf"
|
|
||||||
mov eax, 0
|
|
||||||
leave
|
|
||||||
ret
|
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user