flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
randomdude
sorry for this newbie question, but why doesnt this work?
Code: mov dword[eax],<'rb',0,0> |
|||
![]() |
|
randomdude
Code: mov dword[eax],'rb' ;'r','b',0,0 oh, i didnt know it would fill the rest of the string with zeros. thanks ![]() but what if i wanted this instead? Code: mov dword[eax],<'rb',1,2> |
|||
![]() |
|
JohnFound
Code: mov dword [eax], 'rb' or $02010000 But I would use the following: Code: mov dword [eax], $02016272 ; 'rb', 1, 2 The assembly programmer must know the ASCII table after all. ![]() |
|||
![]() |
|
randomdude
lol, really fasm doesnt have a proper way to do it without hardcoding?
![]() |
|||
![]() |
|
JohnFound
randomdude wrote: lol, really fasm doesnt have a proper way to do it without hardcoding? It can by using macro. But it really doesn't worths the effort. Of course, everything is relative. If you need hundreds of such definitions, the macro is a good solution. P.S. In fact, "<'rd', 1, 2>" is "hardcoding" as well. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
cod3b453
You can actually type character 1 and 2 into the string (ALT+001/2 on windows)
Code: mov dword [eax],'rb' ![]() |
|||
![]() |
|
El Tangas
randomdude wrote: lol, really fasm doesnt have a proper way to do it without hardcoding? Or you can hardcode the mov instruction instead ![]() Code: db 0B8h ;mov eax, immediate db 'rb',1,2 Ad, err, sorry for answering with 1 month delay. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.