B,C,F
This commit is contained in:
parent
70c3756257
commit
83862fb7bc
4 changed files with 95 additions and 0 deletions
28
nasm/B.asm
Normal file
28
nasm/B.asm
Normal file
|
@ -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
|
29
nasm/C.asm
Normal file
29
nasm/C.asm
Normal file
|
@ -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
|
34
nasm/F.asm
Normal file
34
nasm/F.asm
Normal file
|
@ -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
|
* return 0
|
||||||
* Очистить стек
|
* Очистить стек
|
||||||
|
|
||||||
|
# O
|
||||||
|
|
||||||
|
* int 80h
|
||||||
*
|
*
|
||||||
|
|
||||||
# Notices
|
# Notices
|
||||||
|
|
Reference in a new issue