flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
randomdude 23 Apr 2015, 14:19
sorry for this newbie question, but why doesnt this work?
Code: mov dword[eax],<'rb',0,0> |
|||
![]() |
|
randomdude 23 Apr 2015, 15:41
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 23 Apr 2015, 16:09
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 23 Apr 2015, 17:38
lol, really fasm doesnt have a proper way to do it without hardcoding?
![]() |
|||
![]() |
|
JohnFound 23 Apr 2015, 18:23
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 23 Apr 2015, 21:17
You can actually type character 1 and 2 into the string (ALT+001/2 on windows)
Code: mov dword [eax],'rb' ![]() |
|||
![]() |
|
El Tangas 24 May 2015, 21:00
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.