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
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 03 Sep 2017, 07:47
system error wrote:
"Syntax" is a BIG CONCERN in language rules.
Instructions violation translates to "faults".

The error: "invalid instructions" is syntax error. Not an instruction fault. FASM enforces that syntax rules and will not let it pass the compilation process.

Unless of course, you want to hard-coded it straight via DB or Hex Editor, ignoring FASM syntax rules altogether. Then it is just you, the CPU and the manual. You probably need a calculator too to manually calculate those far and near jumps.

Good luck.
Syntax rules are concerned with the textual representation of the code. All assemblers enforce their own particular syntax rules, unless they have bugs. But this has nothing to do with the available instructions. Instructions are defined by the CPU manufacturers, not the assembler. Using a hex editor is an alternative to using an assembler, but it won't give you any extra instructions, it is just a different syntax used to encode the instructions you want.
Post 03 Sep 2017, 07:47
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 03 Sep 2017, 07:49
Furs wrote:
system error wrote:
No, I don't want to hear about "the same way" expert garbage. Just tell me how is one beginner's ("ADD EAX,BX") supposed to pass the compilation phase SYNTAX RULES and producing a "runtime" executable directly?
Read the title of the thread again. Nobody asked why it doesn't compile/assemble. Only in your imagination was such question posed.

I don't know what else can I say, I've said it 3-4 times already. You're too ignorant or fail horribly at english to understand I guess.

Also FASMG has no built-in instructions AFAIK, it's all macros. So your "assembly rules" means nothing, you can change them to whatever you want and have "add eax, bx" compile if you wish -- just not to a sensible operation because it doesn't exist.


Of course, he's a beginner. Many times, a beginner doesn't even know the correct /valid questions to ask.. You need to apply some common sense.

So use your brain when attending to beginners questions. Not with your "expert attitude".

Got it?
Post 03 Sep 2017, 07:49
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 03 Sep 2017, 07:54
revolution wrote:
system error wrote:
"Syntax" is a BIG CONCERN in language rules.
Instructions violation translates to "faults".

The error: "invalid instructions" is syntax error. Not an instruction fault. FASM enforces that syntax rules and will not let it pass the compilation process.

Unless of course, you want to hard-coded it straight via DB or Hex Editor, ignoring FASM syntax rules altogether. Then it is just you, the CPU and the manual. You probably need a calculator too to manually calculate those far and near jumps.

Good luck.
Syntax rules are concerned with the textual representation of the code. All assemblers enforce their own particular syntax rules


It is true in High-level language. But in Assembly language, syntax rules cater to both machine rules and symbolic rules.

add eax,bx ==> violates machine rules "operands must be of same size"
addy eax,ebx ==> violates symbolic rules. "invalid instruction"
Post 03 Sep 2017, 07:54
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 03 Sep 2017, 11:56
system error wrote:
Of course, he's a beginner. Many times, a beginner doesn't even know the correct /valid questions to ask.. You need to apply some common sense.
That's your opinion. You've no proof for it so... I'm answering questions based on what they actually are, cause I'm not his dad to know what he "wants" to ask. (you aren't either, it's simply your assumption)
Post 03 Sep 2017, 11:56
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 03 Sep 2017, 13:20
Furs wrote:
system error wrote:
Of course, he's a beginner. Many times, a beginner doesn't even know the correct /valid questions to ask.. You need to apply some common sense.
That's your opinion. You've no proof for it so... I'm answering questions based on what they actually are, cause I'm not his dad to know what he "wants" to ask. (you aren't either, it's simply your assumption)


No "master of everything". Look at his second response.

Quote:
It requires space from the CPU Register's memory or from the RAM ?

Thanks for the answer!


Does this sound like an advanced question to you? No. This is genuine kind of beginners questions and that is just natural. There's no need for a rocket scientist opinion to figure that out.

The problem is with YOUR "expert garbage" attitude, extending your garbage to the moon and pluto kind of explanations.

But funny how that attitude got knocked out cold when dealing with some advanced programmers. hahahaha xD
Post 03 Sep 2017, 13:20
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 03 Sep 2017, 13:26
Nope. The guy clearly thinks that a CPU can execute any sort of operation and it's not bound by implementation and opcodes. Like in HLLs where you can add 16-bit number to 32-bit since there are no opcodes there.
Post 03 Sep 2017, 13:26
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 03 Sep 2017, 13:50
Furs wrote:
Nope. The guy clearly thinks that a CPU can execute any sort of operation and it's not bound by implementation and opcodes. Like in HLLs where you can add 16-bit number to 32-bit since there are no opcodes there.


Nope too. The simplest explanation is "operands sizes are not equal".

Simple, Assembler-friendly, beginners-friendly response. The most appropriate, shortest and cleanest response you can give to any beginners.

No need to extend the BS to instruction opcodes, instruction length, instruction prefixes and complex memory addressing modes.

Got it?
Post 03 Sep 2017, 13:50
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 03 Sep 2017, 13:51
system error wrote:
The simplest explanation is "operands sizes are not equal".
An explanation he's already aware of, given that he gets the error message. I'm sure he'll appreciate it, Captain Obvious.
Post 03 Sep 2017, 13:51
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 03 Sep 2017, 14:10
Furs wrote:
system error wrote:
The simplest explanation is "operands sizes are not equal".
An explanation he's already aware of, given that he gets the error message. I'm sure he'll appreciate it, Captain Obvious.


Not necessarily. A beginner may not even notice what and where the error message is especially when he's on command-line interface.

The fact that your explanation draws another clueless and unrelated question from him is evident that he's still confused with your explanation about "instruction length".

I came to your rescue and he then thanked all of us for such a beautiful and compact explanation I gave.

Unfortunately, your mistake was when you quoted my posts without thinking about the risks! Are you out of your mind?? Now you're in BIG TROUBLE!! hahahaha xD
Post 03 Sep 2017, 14:10
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 03 Sep 2017, 14:49
system error wrote:
especially when he's on command-line interface.
Funny:
Code:
flat assembler  version 1.71.64  (1310719 kilobytes memory)
test.asm [2]:
add eax, bx
processed: add eax,bx
error: operand sizes do not match.

C:\>    
Message exactly above the input, not obvious enough, makes sense. More excuses.
Post 03 Sep 2017, 14:49
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 03 Sep 2017, 15:01
Furs wrote:
system error wrote:
especially when he's on command-line interface.
Funny:
Code:
flat assembler  version 1.71.64  (1310719 kilobytes memory)
test.asm [2]:
add eax, bx
processed: add eax,bx
error: operand sizes do not match.

C:\>    
Message exactly above the input, not obvious enough, makes sense. More excuses.
That's because you're not a beginner. He is. That kind of question is so natural in beginner's world. Question like --> operand - what is operand? Which one of "add", "eax", "bx" is considered operand. See the whole picture of a beginner's confusions here?

And how's your explanation about SPACE SAVING OPCODE be any help to clear the air of his confusions? See his second posts? "Register's "memory or RAM"?!! That's the result of UNNECESSARY CONFUSIONS that you've got himself into!

If it wasn't because of me, that poor guy would have ditched asm programming altogether after reading your "expert" explanation on INSTRUCTION GROUPINGS TABLE and XOP instruction prefixes! WTF is wrong with you?
Post 03 Sep 2017, 15:01
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 03 Sep 2017, 16:54
So what would repeating the error message do if he doesn't know what an operand is? But anyway, it's still your assumption, until he comes and says something about it, he still asked about the operation. So yeah, that's your opinion, as I said (and you went apeshit).

Nobody said anything about "space saving" opcodes, I don't even know what that means. I said "opcode space", which is what they assign to each opcode (also called "opcode map"). You have only 255 values in a byte, and each insn type requires one. 255 is a finite number of stuff you can fit in there, why waste it on such operations etc was what I meant. In fact, movzx/movsx already deal with the extended (2 byte without operands or Mod R/M) opcode space, because the 255 values were already exhausted.
Post 03 Sep 2017, 16:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 03 Sep 2017, 16:57
2^8 = 256
Post 03 Sep 2017, 16:57
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 03 Sep 2017, 17:02
Well I put aside 1 opcode for the extension (in x86, 0x0F) of the opcode space. Otherwise you'd be stuck.
Post 03 Sep 2017, 17:02
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 05 Sep 2017, 11:25
Furs wrote:
But anyway, it's still your assumption,


No. It's all about your "expert" attitude that FORCED him to ask "register's memory or RAM" in his 2nd post when you went moutfhul about "opcode space".

Opcode space WHAT??? WTF is opcode space? You just made it up to make you look like an "expert", didn't you? xD
Post 05 Sep 2017, 11:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 05 Sep 2017, 11:49
system error wrote:
No. It's all about your "expert" attitude that FORCED him to ask "register's memory or RAM" in his 2nd post when you went moutfhul about "opcode space".
I don't see this as a problem. I find it is better to assume more knowledge than less, and backtrack if the poster doesn't understand. If you assume immediately that someone is a complete newbie and start explaining about how bx is 16bit or something, then people can take that as condescending if they already know such things.

There is no harm if you supply more information that what is asked for. People can choose to ignore it if that don't care about it or don't understand it. It also allows them to ask follow-up questions and learn something they would otherwise might not have known to ask about.

But at the end of the day, simply trying to help is enough to encourage people to ask more and learn more. Even if it is pitched too high the first time around, people appreciate the effort and will feel comfortable clarifying their query further and learning things in the process.
Post 05 Sep 2017, 11:49
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 05 Sep 2017, 11:56
revolution wrote:
system error wrote:
No. It's all about your "expert" attitude that FORCED him to ask "register's memory or RAM" in his 2nd post when you went moutfhul about "opcode space".
I don't see this as a problem. I find it is better to assume more knowledge than less, and backtrack if the poster doesn't understand. If you assume immediately that someone is a complete newbie and start explaining about how bx is 16bit or something, then people can take that as condescending if they already know such things.

There is no harm if you supply more information that what is asked for. People can choose to ignore it if that don't care about it or don't understand it. It also allows them to ask follow-up questions and learn something they would otherwise might not have known to ask about.

But at the end of the day, simply trying to help is enough to encourage people to ask more and learn more. Even if it is pitched too high the first time around, people appreciate the effort and will feel comfortable clarifying their query further and learning things in the process.


You're offering nothing useful in this post I am quoting.

Still mad, broh? xD
Post 05 Sep 2017, 11:56
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 05 Sep 2017, 18:44
system error wrote:
Opcode space WHAT??? WTF is opcode space?
When in doubt, before embarrassing yourself, always check revolution's site first.

First result: https://en.wikipedia.org/wiki/VEX_prefix
Wikipedia wrote:
Five bits named m. Two of the m bits are used for replacing existing escape codes and for specifying the length of the instruction. The remaining three m bits are reserved for future use, such as specifying vector lengths >256 bits, specifying different instruction lengths, or extending the opcode space, however as of 2013, Intel decided to introduce a new encoding scheme, the EVEX prefix, rather than expand the remaining m bits.
Obviously, this is about VEX, it was first hit so I used it, but 2nd (stackoverflow) hit explains it as well. See: https://stackoverflow.com/questions/41720529/is-there-a-pattern-to-x86-op-codes-other-than-direction-and-size-bits:
Margaret Bloom wrote:
Before the opcode space was exhausted [...]
Post 05 Sep 2017, 18:44
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 670
system error 05 Sep 2017, 19:50
Furs wrote:
system error wrote:
Opcode space WHAT??? WTF is opcode space?
When in doubt, before embarrassing yourself, always check revolution's site first.

First result: https://en.wikipedia.org/wiki/VEX_prefix
Wikipedia wrote:
Five bits named m. Two of the m bits are used for replacing existing escape codes and for specifying the length of the instruction. The remaining three m bits are reserved for future use, such as specifying vector lengths >256 bits, specifying different instruction lengths, or extending the opcode space, however as of 2013, Intel decided to introduce a new encoding scheme, the EVEX prefix, rather than expand the remaining m bits.
Obviously, this is about VEX, it was first hit so I used it, but 2nd (stackoverflow) hit explains it as well. See: https://stackoverflow.com/questions/41720529/is-there-a-pattern-to-x86-op-codes-other-than-direction-and-size-bits:
Margaret Bloom wrote:
Before the opcode space was exhausted [...]


I created my own disassembler and instruction length engine. You don't have to sell your GARBAGE to me about instructions prefixes. I know ALL ABOUT instruction prefixes like the back of my hand xD

And no. There's no "opcode space" defined in the official Intel/AMD Manual. Even if they exist, they are just common phrases not amounting to any technical terminologies. So don't push your luck. You'll find yourself in irreversible humiliation in one of these days if you really want to come down to such technical details!

Opcode Space, my ass! HAHAHAHA xD
Post 05 Sep 2017, 19:50
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 05 Sep 2017, 21:45
You obviously haven't or just copy pasted it, and I have a fairly good idea myself based on your behavior Wink But considering you don't even know what opcode space/map is, it's hilarious. And yes it was officially the reason Intel gave when designing the x87 (very long ago).

Heck, even wikipedia says it: https://en.wikipedia.org/wiki/X86#Floating_point_unit
Wikipedia wrote:
Each x87 register, known as ST(0) through ST(7), is 80 bits wide and stores numbers in the IEEE floating-point standard double extended precision format. These registers are organized as a stack with ST(0) as the top. This was done in order to conserve opcode space, and the registers are therefore randomly accessible only for either operand in a register-to-register instruction; ST0 must always be one of the two operands, either the source or the destination, regardless of whether the other operand is ST(x) or a memory operand. However, random access to the stack registers can be obtained through an instruction which exchanges any specified ST(x) with ST(0)
Post 05 Sep 2017, 21:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5, 6  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.