Главная страница
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.065 c
14-1107207759
Logun
2005-02-01 00:42
2005.02.20
ВАС ИЗ ДАС .NET


4-1104852362
Эдик
2005-01-04 18:26
2005.02.20
Как получить список модомов Win 95/98/2000/XP


1-1107845162
Ega23
2005-02-08 09:46
2005.02.20
Финальная сборка DLL


1-1107726203
Barbos
2005-02-07 00:43
2005.02.20
Добавление эл-в в TreeView


4-1104318307
Pavlik_Morozov
2004-12-29 14:05
2005.02.20
Как вызвать DPtoLP для точек из метафайла (TMetaFile)?