|
From: Wolfgang Kern on 21 Jun 2008 06:41 we stumbled over a syntax-issue in AOD. BASM interpretes quoted data in bytewise little Endian order while NASM, RosAsm and afaik also FASM treat them as literal text strings. ie: mov eax,'GOOD' NASM: B8 47 4F 4F 44 BASM: B8 44 4F 4F 47 So this is just a question (no need for a change): Got NASM an option (command-line/directive) to interprete quoted text data 'not backwards' ? The manual seem to say No. __ wolfgang
From: Frank Kotler on 21 Jun 2008 15:42 Wolfgang Kern wrote: > we stumbled over a syntax-issue in AOD. Hi, AOD! > BASM interpretes quoted data in bytewise little Endian order > while NASM, RosAsm and afaik also FASM treat them as > literal text strings. > > ie: mov eax,'GOOD' > NASM: > B8 47 4F 4F 44 > BASM: > B8 44 4F 4F 47 > > So this is just a question (no need for a change): > > Got NASM an option (command-line/directive) to > interprete quoted text data 'not backwards' ? > The manual seem to say No. I don't think so. I've encountered this issue "translating" from Herbert's "Lindela" assembler, too. Some do it one way, some another. AFAIK, the only thing to do is "just change 'em"... and hope there aren't too many. :) Best, Frank
From: H. Peter Anvin on 23 Jun 2008 01:24 Wolfgang Kern wrote: > we stumbled over a syntax-issue in AOD. > > BASM interpretes quoted data in bytewise little Endian order > while NASM, RosAsm and afaik also FASM treat them as > literal text strings. > I would argue BASM is interpreting in bytewise *bigendian* order. This obviously doesn't make much sense for a littleendian machine. > So this is just a question (no need for a change): > > Got NASM an option (command-line/directive) to > interprete quoted text data 'not backwards' ? > The manual seem to say No. It wouldn't be very hard to implement, but there would have to be a good motivation. -hpa
From: Benjamin David Lunt on 23 Jun 2008 02:34 "H. Peter Anvin" <hpa(a)zytor.com> wrote in message news:485F33A7.6010005(a)zytor.com... > Wolfgang Kern wrote: >> we stumbled over a syntax-issue in AOD. >> >> BASM interpretes quoted data in bytewise little Endian order >> while NASM, RosAsm and afaik also FASM treat them as >> literal text strings. Hi guys, I am pretty sure Wolfgang is talking about NBASM, he just forgot the N. I had to actually go look up BASM to see if it was for real. (http://dennishomepage.gugs-cats.dk/BASM-filer/BASMForBeginners.htm) He and I were having a small discussion on the following instruction syntax: mov eax,'SLOT' Should an assembler output that as B8 54 4F 4C 53 ; B8 T O L S or should it output it as B8 53 4C 4F 54 ; B8 S L O T In my opinion, the following instructions should be identical. mov eax,'SLOT' mov eax,534C4F54h mov eax,1397509972d mov eax,12323047524o mov eax,1010011010011000100111101010100b However, NASM treats the 'SLOT' as quoted string and outputs it as the 2nd choice above. B8 53 4C 4F 54 ; B8 S L O T In NASM, you would have to do: mov eax,'TOLS' mov eax,534C4F54h which IMHO is backward. In the first line NASM writes the 'T' first, with the 'S' last. However, in the next line, NASM writes the 54h first and the 53h last. Just the opposite. In NBASM, a single quoted string the size of or smaller than the operand is treated as an immediate value just as if it was given as a hex, dec, oct, or bin value. NASM does not. We aren't trying to say one is better than the other, nor are we trying to start a war here. We were just asking if NASM had an option to do the same. At one time I thought I had made NBASM to behave as NASM does if the string was double quotes. e.g.: mov eax,"SLOT" ; behaves like NASM, the S first and the T last. mov eax,'SLOT' ; the T first and the S last. But I guess I hadn't. It is now on the TODO list. > I would argue BASM is interpreting in bytewise *bigendian* order. This > obviously doesn't make much sense for a littleendian machine. > >> So this is just a question (no need for a change): >> >> Got NASM an option (command-line/directive) to >> interprete quoted text data 'not backwards' ? >> The manual seem to say No. > > It wouldn't be very hard to implement, but there would have to be a good > motivation. Just my opinion. Please don't take it as anything else. The last thing I want to do here is start an assembler war. I have nothing against NASM. I am just bias to NBASM, and most of you know why :-) Ben -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Forever Young Software http://www.frontiernet.net/~fys/index.htm To reply by email, please remove the zzzzzz's Batteries not included, some assembly required.
From: Herbert Kleebauer on 23 Jun 2008 07:31 Benjamin David Lunt wrote: > "H. Peter Anvin" <hpa(a)zytor.com> wrote in message > > In my opinion, the following instructions should be identical. > > mov eax,'SLOT' > mov eax,534C4F54h > mov eax,1397509972d > mov eax,12323047524o > mov eax,1010011010011000100111101010100b Don't think so. In a well designed assembler the following should be identical: mov 'SLOT',eax mov 534C4F54h,eax But when an assembler use a crazy operand order (opcode dest,src), then it also should use a crazy character order in a character constant. You shouldn't mix the logical with the illogical. Either do it all the correct way or completely stay with the incorrect way.
|
Next
|
Last
Pages: 1 2 3 4 5 6 7 Prev: a compainion book for aoa? Next: Opening for Process Engineer @ Pune |