nihonium
/
mipt_clang
Archived
1
0
Fork 0
master
nihonium 3 years ago
parent 70c3756257
commit 83862fb7bc
No known key found for this signature in database
GPG Key ID: 0924047F4136012C

@ -0,0 +1,28 @@
extern printf
extern scanf
global main
section .text
main:
push x
push nya1
call scanf
add esp, 8
mov eax, [x]
and eax, 0xFFFF
push eax
push nya
call printf
add esp, 8
xor eax, eax
ret
section .data
nya db "%u", 10, 0
nya1 db "%u", 0
section .bss
x resd 1

@ -0,0 +1,29 @@
extern printf
extern scanf
global main
section .text
main:
push y
push x
push nya1
call scanf
add esp, 12
mov eax, dword [x]
sub eax, dword [y]
push eax
push nya
call printf
add esp, 8
xor eax, eax
ret
section .data
nya db "%d", 10, 0
nya1 db "%d %d", 0
section .bss
x resd 1
y resd 1

@ -0,0 +1,34 @@
extern scanf
extern printf
global main
section .text
main:
push y
push x
push nya
call scanf
add esp, 12
mov eax, [x]
cmp eax, [y]
jle end
mov eax, [y]
end:
push eax
push nya1
call printf
add esp, 8
xor eax, eax
ret
section .data
nya db "%d %d", 0
nya1 db "%d", 10, 0
section .bss
x resd 1
y resd 1

@ -3,6 +3,10 @@
* Есть стандартная библиотека, с которой это будет слинковано
* return 0
* Очистить стек
# O
* int 80h
*
# Notices