Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.02.20;
Скачать: CL | DM;

Вниз

Ток не смейтесь!!! Вопрос по асму...   Найти похожие ветки 

 
Луарвик   (2005-01-28 23:49) [0]

А никто случаем не знает, как число перевести в строку. На ассемблере?

.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\user32.lib
includelib \masm32\lib\kernel32.lib

.data
MsgCaption      db "Iczelion"s tutorial no.2",0
MsgBoxText      db "Win32 Assembly is Great!",0
op1 DWORD 150

.code
start:
        MOV EAX, op1
        ADD EAX, op2
invoke MessageBox, NULL,addr MsgBoxText, addr MsgBoxText, NULL ;addr MsgCaption, MB_OK
invoke ExitProcess,NULL
end start

Как в тексте сообщения показать op1?


 
Околокомпьютерный   (2005-01-29 00:10) [1]

ого. а чо эта страшная программа умеет делать?


 
Andy BitOff ©   (2005-01-29 00:35) [2]


 mov ebx,10
 xor ecx,ecx
hex1:  xor edx,edx
 div ebx
 add dl,"0"
 push edx
 inc ecx
 test eax,eax
 jnz short hex1
hex2:  pop eax
 mov byte ptr [edi],al
 inc edi
 loop hex2
 mov byte ptr [edi],0


edi-куда. eax-число


 
Andy BitOff ©   (2005-01-29 05:41) [3]


.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\user32.lib
includelib \masm32\lib\kernel32.lib

.data
MsgCaption      db "Iczelion"s tutorial no.2",0
MsgBoxText      db "Win32 Assembly is Great!"
ttt             db 10 dup(0)
op1 DWORD 150
op2 DWORD 345

.code
start:
       MOV EAX, [op1]
       ADD EAX, [op2]
       mov edi, offset ttt
       call hex
invoke MessageBox, NULL,addr MsgBoxText, addr MsgBoxText, NULL ;addr MsgCaption, MB_OK
invoke ExitProcess,NULL

hex:   mov ebx,10
      xor ecx,ecx
hex1:  xor edx,edx
      div ebx
      add dl,"0"
      push edx
      inc ecx
      test eax,eax
      jnz short hex1
hex2:  pop eax
      mov byte ptr [edi],al
      inc edi
      loop hex2
      mov byte ptr [edi],0
      ret
end start



Проверить возможности не было.



Страницы: 1 вся ветка

Текущий архив: 2005.02.20;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.06 c
14-1106947166
Околокомпьютерный
2005-01-29 00:19
2005.02.20
Про кино


1-1107355160
dim-
2005-02-02 17:39
2005.02.20
Передача данных между MDI формами


14-1106800554
Девушка
2005-01-27 07:35
2005.02.20
Сотовый - подслушивающее устройство?


1-1107330743
Azat
2005-02-02 10:52
2005.02.20
Программное добавление на Chart любого числ графиков (series)


6-1102876092
User_32
2004-12-12 21:28
2005.02.20
Локальная сеть