Главная страница
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.05 c
1-1107467537
griban
2005-02-04 00:52
2005.02.20
Zapusk makrosa Excel iz Delphi


3-1105635701
Alex_V
2005-01-13 20:01
2005.02.20
Экспорт в форматированный текст


1-1107715687
Andrey M
2005-02-06 21:48
2005.02.20
несколько вопросов


1-1107857160
vladymyr
2005-02-08 13:06
2005.02.20
hashtable,hashmap,hashset


1-1107363505
БезИмени
2005-02-02 19:58
2005.02.20
Визуальній конструктор