Главная страница
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.041 c
1-1107431444
Ega23
2005-02-03 14:50
2005.02.20
Динамическая загрузка DLL


14-1107047827
olookin
2005-01-30 04:17
2005.02.20
Все таки штучка Земфиры - это что-то...


1-1107340311
frEE)stylEr
2005-02-02 13:31
2005.02.20
Реестр


8-1099917444
Змей
2004-11-08 15:37
2005.02.20
конец файла


9-1073144322
DDS
2004-01-03 18:38
2005.02.20
Где хранить ресурсы?