flat assembler
Message board for the users of flat assembler.
Index
> Main > Why this operation is not possible ? Goto page Previous 1, 2, 3, 4, 5, 6 Next |
Author |
|
Furs 30 Aug 2017, 10:33
Tomasz can write whatever he wants. In this case, he wanted to show a more descriptive error message so the programmer knows what to fix. "Invalid encoding" is not helpful error message, you'll have to look at Intel Manuals to see why that is so (by itself). But the error message doesn't answer why it's invalid.
More "rule breakers": Code: movd eax, mm0 ; 64 bit operand to 32 bit operand movd eax, xmm0 ; 128 bit operand to 32 bit operand movzx/movsx already take two bytes just for the opcode (no operands) because they couldn't fit it into one byte -- all the opcode space was taken by other insns they added before. Where would they add "add eax, bx" then? AMD even removed some less-used 1-byte opcodes in x64 or re-purposed them (I'm NOT talking about REX prefix, but about arpl->movsx 64 mode), so yes, don't give me bullshit like they don't care about it. |
|||
30 Aug 2017, 10:33 |
|
revolution 30 Aug 2017, 10:43
system error wrote: 1. Rule 1 and Rule 2 are never broken. There are only few exceptions. |
|||
30 Aug 2017, 10:43 |
|
system error 30 Aug 2017, 10:53
Furs wrote: Tomasz can write whatever he wants. In this case, he wanted to show a more descriptive error message Any error message should reflect the nature of the syntax being violated. That rule being violated is "Operands are not of the same size". Quote: More "rule breakers": I don't see no rule-breaker there. MOVD itself defines the transfer rule. It's a DWORD transfer. And FASM is smart enough to pick up a DWORD from the source because you can't DIVIDE A MM0 or an XMM register like you do with variables by using a size override. I don't know where you learned assembly language but you do need a serious education on this or else you'll keep on misleading people under the pretense of an "master of everything". |
|||
30 Aug 2017, 10:53 |
|
system error 30 Aug 2017, 10:56
revolution wrote:
Maybe my quantifier "never" is incorrect. But that doesn't mean Tomasz is wrong when he uses "Error: Operands sizes not equal". He got that one right because he knows the Rule very well. You don't? |
|||
30 Aug 2017, 10:56 |
|
Furs 30 Aug 2017, 11:12
system error wrote: Any error message should reflect the nature of the syntax being violated. That rule being violated is "Operands are not of the same size". You can even assemble raw bytes with db. Syntax means nothing. You won't be able to make a "add eax, bx" instruction with db because it doesn't exist. You can make "add eax, ebx" though. system error wrote: I don't see no rule-breaker there. Size override happens only with 32-bit -> 16-bit operand, because they have the same opcode. 8-bit has no size override because it has a totally separate opcode. I know you'll say I speak nonsense, but you brought size override up which makes *zero* sense. Of course movd defines the transfer rule, every instruction defines the transfer rule in Intel Manuals. Every one of them. There is no implied "golden rule". Another rule-breaker: Code: add rax, imm32 ; 12345678901234 gives error sorry Code: mov rax, 12345678901234 |
|||
30 Aug 2017, 11:12 |
|
revolution 30 Aug 2017, 11:18
system error wrote: Maybe my quantifier "never" is incorrect. system error wrote: But that doesn't mean Tomasz is wrong when he uses "Error: Operands sizes not equal". He got that one right because he knows the Rule very well. You don't? |
|||
30 Aug 2017, 11:18 |
|
system error 30 Aug 2017, 11:24
Furs wrote: Every assembler has a different syntax. Syntax means nothing. AT&T asm is completely different. Heck even MASM has a different syntax. (dword ptr and stuff) Syntax means everything in a Programming Language. OMG!! Syntax means nothing?? You can't produce executable without the correct syntax!! IDIOT!! Hahahaha xD Quote: Of course movd defines the transfer rule Yes. Now you finally understand it. That quick huh? xD Quote: Another rule-breaker: Here we are assuming 32-bit CPU as suggested by the original post from OP. 64-bit code requires a slightly different topic. Don't play your extended "master of everything" garbage with me because you know how it always ends. hahahaha xD |
|||
30 Aug 2017, 11:24 |
|
system error 30 Aug 2017, 11:30
revolution wrote:
There's always a set of rules to define the characteristics of x86 intel instruction set architecture. Without these set of rules, you can't call it an architecture and all hell will break loose. You can't build an assembler on top of it if you can't oblige to these rules or if a set of rules are not defined. OMG! You too! hahahaha xD |
|||
30 Aug 2017, 11:30 |
|
revolution 30 Aug 2017, 11:39
system error wrote: There's always a set of rules to define the characteristics of x86 intel instruction set architecture. |
|||
30 Aug 2017, 11:39 |
|
system error 30 Aug 2017, 11:53
revolution wrote:
Rule 4. Little Endian Rule 5. Left Side operand is the Destination. Right side Operand is the Source. Rule 6. Byte-addressable addressing Now don't tell me that these rules and defining characteristics don't exist in X86 ISA or that you don't know they exist. Because I will be extremely dissappointed by the level of basic knowledge on this board ... |
|||
30 Aug 2017, 11:53 |
|
revolution 30 Aug 2017, 12:04
Hmm, all of those additional rules are also broken.
4. BSWAP, there is no clear endian for this. 5. POP, no destination is given. 6. Many of the vector loads and stores have alignment restrictions. Plus your claim of the rules being in the manuals is false. No such rules are stated by either Intel or AMD (but you are welcome and encouraged to point out the page number or paragraph number to show my error). Unless you consider general characteristics are "rules"? If so then I think your claim is misleading at best. |
|||
30 Aug 2017, 12:04 |
|
Furs 30 Aug 2017, 12:04
@system error: You might want to check out the movbe instruction then.
|
|||
30 Aug 2017, 12:04 |
|
system error 30 Aug 2017, 12:15
revolution wrote: Hmm, all of those additional rules are also broken. 4. BSWAP is used to emulate a BIG-ENDIAN machine. I don't see no problem with that. 5. Of course, it's a single operand instruction. Two-operands RULES don't apply. What is your problem? 6. And what's your point with vectored instructions?? The rules on their usage is in the manuals. Quote: Plus your claim of the rules being in the manuals is false. No such rules are stated by either Intel or AMD (but you are welcome and encouraged to point out the page number or paragraph number to show my error So it is allowed then for a programmer to think that left side operand is the SOURCE and the right operand is the DESTINATION? So the rule of MOV in FASM is now; MOV <source>, <destination> It's never explicitly stated in the manual either. Do you agree with this new rule?? |
|||
30 Aug 2017, 12:15 |
|
system error 30 Aug 2017, 12:20
Furs wrote: @system error: You might want to check out the movbe instruction then. You mean like, movbe <source>, <destination> ?? or movbe <destination>, <source> ?? I checked MOVBE instruction entry and I don't see no rules on source/operand on it. So according to revolution, since there's no rule explicitly stated in the manual, both versions are semantically correct. |
|||
30 Aug 2017, 12:20 |
|
revolution 30 Aug 2017, 12:26
Presenting strawman arguments doesn't make your case. I pointed out that POP doesn't have an explicit destination ([--esp]), you then say (paraphrasing) "rule doesn't apply to POP". But POP does have a destination, it's just that it isn't stated using the normal methods, and thus breaks your "rule". You said "Left Side operand is the Destination" but POP fails to accept [--esp] as the destination, it is implied.
You can't claim rules and then go on to say "oh but there are exceptions" because that makes it not-a-rule-at-all. If you want to say they are general characteristics then I have no argument against that. |
|||
30 Aug 2017, 12:26 |
|
system error 30 Aug 2017, 12:33
revolution wrote: Presenting strawman arguments doesn't make your case. I pointed out that POP doesn't have an explicit destination ([--esp]), you then say (paraphrasing) "rule doesn't apply to POP". But POP does have a destination, it's just that it isn't stated using the normal methods, and thus breaks your "rule". You said "Left Side operand is the Destination" but POP fails to accept [--esp] as the destination, it is implied. Push <operand> Pop <operand> When does the POP 's operand have in contact with a source operand? I am eager to know. "Error: Operand sizes are not equal" The OP's original post is about two operands instruction. Not a POP or a PUSH. They are no two-operands instructions. |
|||
30 Aug 2017, 12:33 |
|
Tomasz Grysztar 30 Aug 2017, 12:41
revolution wrote: Hmm, all of those additional rules are also broken. And arguing whether to call the simple rules a "general characteristics" is a hair-splitting, in my opinion. Both can mean the same, we need to at least consider that we may not always be on the same page in understanding some phrases. Furs wrote: Another rule-breaker: |
|||
30 Aug 2017, 12:41 |
|
system error 30 Aug 2017, 12:41
revolution wrote: You can't claim rules and then go on to say "oh but there are exceptions" because that makes it not-a-rule-at-all. If you want to say they are general characteristics then I have no argument against that. There are always exceptions to rules. You have a logical fallacy there. Just because there are exceptions, that doesn't mean there are no rules. x86 architecture will lose it's identity and characteristics if there are no rules defining and enforcing it as one. FASM1 is an example where all of those rules are observed, enforced and preserved. FASMG is a good example where you can define your own set of rules not bound to x86 architecture rules. Now it's up to you to tell the beginners that MOV <source>, <destination> is also correct in FASM. The rule is never defined in the Manual anyway. Well, GOOD LUCK!! Hahahaha xD |
|||
30 Aug 2017, 12:41 |
|
system error 30 Aug 2017, 12:43
Big boss is coming. I am out of here. ;p
|
|||
30 Aug 2017, 12:43 |
|
Goto page Previous 1, 2, 3, 4, 5, 6 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.