Главная страница
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.056 c
14-1107338274
syte_ser78
2005-02-02 12:57
2005.02.20
блин!


3-1106207417
АМБ
2005-01-20 10:50
2005.02.20
DBGrid. Работа скролинга.


4-1104417010
Katy
2004-12-30 17:30
2005.02.20
"Программа не отвечает", но она не виснет, вып незримые действия


3-1106415836
Mortal
2005-01-22 20:43
2005.02.20
Вопрос про Rave Reports


14-1107054763
Бугага
2005-01-30 06:12
2005.02.20
Enterprise Resource Planning