Как вывести отрицательное число на экран? - Assembler
Формулировка задачи:
точное как его поймать? как понять что там отрицательное? или дайте пожалуста кусок кода где это делается может разберусь
Решение задачи: «Как вывести отрицательное число на экран?»
textual
Листинг программы
- .386
- .model flat, stdcall
- option casemap :none
- include \masm32\include\windows.inc
- include \masm32\include\kernel32.inc
- include \masm32\include\user32.inc
- includelib \masm32\lib\kernel32.lib
- includelib \masm32\lib\user32.lib
- .data
- buffer_for_string db 10 dup(0)
- title_string db "Результат: ",0
- szformat db "%d",0Dh,0Ah,0
- massiv dd 0,1,2,-3,5
- .code
- start:
- xor eax,eax
- cmp esi,20
- jge StopD
- mov eax,massiv[esi]
- add esi,4
- test eax,eax
- js vivod
- jmp start
- vivod:
- mov ebx,eax
- StopD:
- ;==============V=Вывод=V==============
- push ebx
- push offset szformat
- push offset buffer_for_string
- call wsprintf
- push 2
- push offset title_string
- push offset buffer_for_string
- push 0
- call MessageBox
- push 0
- call ExitProcess
- end start
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д