section .data
D316 dd 0xD316 ; Значение D316
X dd 0 ; Значение X
Y dd 0 ; Значение Y
Z dd 0 ; Значение Z
F dd 0 ; Результат F
section .text
global _start
_start:
; Загружаем значения в регистры
mov eax, [D316] ; EAX = D316
sub eax, [X] ; EAX = D316 - X
shl eax, 1 ; EAX = (D316 - X) * 2
; Считаем (Y + Z) / 4
mov ebx, [Y] ; EBX = Y
add ebx, [Z] ; EBX = Y + Z
shr ebx, 2 ; EBX = (Y + Z) / 4
; Вычисляем F = (D316 - X) * 2 - (Y + Z) / 4
sub eax, ebx ; EAX = F
; Сохраняем результат в переменную F
mov [F], eax ; F = результат
; Завершение программы (для Linux)
mov eax, 1 ; syscall: exit
xor ebx, ebx ; статус: 0
int 0x80 ; вызов ядра
c2VjdGlvbiAuZGF0YQogICAgRDMxNiBkZCAweEQzMTYgICAgICA7INCX0L3QsNGH0LXQvdC40LUgRDMxNgogICAgWCAgICBkZCAwICAgICAgICAgIDsg0JfQvdCw0YfQtdC90LjQtSBYCiAgICBZICAgIGRkIDAgICAgICAgICAgOyDQl9C90LDRh9C10L3QuNC1IFkKICAgIFogICAgZGQgMCAgICAgICAgICA7INCX0L3QsNGH0LXQvdC40LUgWgogICAgRiAgICBkZCAwICAgICAgICAgIDsg0KDQtdC30YPQu9GM0YLQsNGCIEYKCnNlY3Rpb24gLnRleHQKZ2xvYmFsIF9zdGFydAoKX3N0YXJ0OgogICAgOyDQl9Cw0LPRgNGD0LbQsNC10Lwg0LfQvdCw0YfQtdC90LjRjyDQsiDRgNC10LPQuNGB0YLRgNGLCiAgICBtb3YgZWF4LCBbRDMxNl0gICAgIDsgRUFYID0gRDMxNgogICAgc3ViIGVheCwgW1hdICAgICAgICA7IEVBWCA9IEQzMTYgLSBYCiAgICBzaGwgZWF4LCAxICAgICAgICAgIDsgRUFYID0gKEQzMTYgLSBYKSAqIDIKCiAgICA7INCh0YfQuNGC0LDQtdC8IChZICsgWikgLyA0CiAgICBtb3YgZWJ4LCBbWV0gICAgICA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