Thread overview | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 19, 2004 What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
My guess is that they handle what the class does when used in an operater (like '==', '+', etc.). Is that so, and how do you use them? |
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | kinghajj wrote: > My guess is that they handle what the class does when used in an operater (like > '==', '+', etc.). Is that so, and how do you use them? Thanks to the power of Google, I'll submit my guess. http://www.wlug.org.nz/OpCodes Op Codes The names given to individual instructions in AssemblyLanguage. Different CPU families have different op codes, and assembler has mnemonic names for the different instructions (which to the CPU are just 1s and 0s). For Intel x86 machines, common codes include JMP, AND, XOR, INT, MOVL, PUSH, POP, CALL, and so on. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/ |
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | J C Calvarese wrote:
> kinghajj wrote:
>
>> My guess is that they handle what the class does when used in an operater (like
>> '==', '+', etc.). Is that so, and how do you use them?
>
>
> Thanks to the power of Google, I'll submit my guess.
>
> http://www.wlug.org.nz/OpCodes
>
> Op Codes
>
> The names given to individual instructions in AssemblyLanguage. Different CPU families have different op codes, and assembler has mnemonic names for the different instructions (which to the CPU are just 1s and 0s).
>
> For Intel x86 machines, common codes include JMP, AND, XOR, INT, MOVL, PUSH, POP, CALL, and so on.
>
>
Wasn't he just asking about operator overloading? You know... opCmp opEquals, opAdd, and such...
|
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | In article <cg1mdh$12mg$1@digitaldaemon.com>, John Reimer says... > >J C Calvarese wrote: > >> kinghajj wrote: >> >>> My guess is that they handle what the class does when used in an >>> operater (like >>> '==', '+', etc.). Is that so, and how do you use them? >> >> >> Thanks to the power of Google, I'll submit my guess. >> >> http://www.wlug.org.nz/OpCodes >> >> Op Codes >> >> The names given to individual instructions in AssemblyLanguage. Different CPU families have different op codes, and assembler has mnemonic names for the different instructions (which to the CPU are just 1s and 0s). >> >> For Intel x86 machines, common codes include JMP, AND, XOR, INT, MOVL, PUSH, POP, CALL, and so on. >> >> > >Wasn't he just asking about operator overloading? You know... opCmp opEquals, opAdd, and such... Yes, I was, and I've already answered my own question (by reading the documentation "Operator Overloading"). It's a nice feature : I can see how it's so usefull! |
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | In article <cg1oah$18br$1@digitaldaemon.com>, kinghajj says... > >In article <cg1mdh$12mg$1@digitaldaemon.com>, John Reimer says... >> >>J C Calvarese wrote: >> >>> kinghajj wrote: >>> >>>> My guess is that they handle what the class does when used in an >>>> operater (like >>>> '==', '+', etc.). Is that so, and how do you use them? >>> >>> >>> Thanks to the power of Google, I'll submit my guess. >>> >>> http://www.wlug.org.nz/OpCodes >>> >>> Op Codes >>> >>> The names given to individual instructions in AssemblyLanguage. Different CPU families have different op codes, and assembler has mnemonic names for the different instructions (which to the CPU are just 1s and 0s). >>> >>> For Intel x86 machines, common codes include JMP, AND, XOR, INT, MOVL, PUSH, POP, CALL, and so on. >>> >>> >> >>Wasn't he just asking about operator overloading? You know... opCmp opEquals, opAdd, and such... > >Yes, I was, and I've already answered my own question (by reading the documentation "Operator Overloading"). It's a nice feature : I can see how it's so usefull! > > OK, now another question about the 'op' codes. You know how C++ has the cout stream, and it workd like this: cout << "Whatever, " << variable << " again"; How could you do that in D? |
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | In article <cg1mdh$12mg$1@digitaldaemon.com>, John Reimer says... > >J C Calvarese wrote: > >> kinghajj wrote: >> >>> My guess is that they handle what the class does when used in an >>> operater (like >>> '==', '+', etc.). Is that so, and how do you use them? >> >> >> Thanks to the power of Google, I'll submit my guess. >> >> http://www.wlug.org.nz/OpCodes >> >> Op Codes >> >> The names given to individual instructions in AssemblyLanguage. Different CPU families have different op codes, and assembler has mnemonic names for the different instructions (which to the CPU are just 1s and 0s). >> >> For Intel x86 machines, common codes include JMP, AND, XOR, INT, MOVL, PUSH, POP, CALL, and so on. >> >> > >Wasn't he just asking about operator overloading? You know... opCmp opEquals, opAdd, and such... Apparently so. If he would've asked what op functions like opCmp were I would've answered a whole other question. In the future, I guess I'll leave the psychic hotline questions to Miss Cleo.... jcc7 |
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj |
> OK, now another question about the 'op' codes.
>
> You know how C++ has the cout stream, and it workd like this:
> cout << "Whatever, " << variable << " again";
>
> How could you do that in D?
>
>
Operator overloading...
You can do the exact same thing in D if the library you are using has overloaded those operators in such a fashion. Although overloading shift operators in such a way is not popular to everyone in D (I don't like it).
The only library that currently lets you do it that way, that I know of, is mango on its io streams. But mango also gives an alternative way to do the same thing, thankfully.
Later,
John
|
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | J C Calvarese wrote:
>
> Apparently so. If he would've asked what op functions like opCmp were I would've
> answered a whole other question.
>
> In the future, I guess I'll leave the psychic hotline questions to Miss Cleo....
>
> jcc7
Hey, what are you saying, Justin? You looking for a fight with me and my psychic abilities?
j/k :-)
|
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | In article <cg294n$1v55$2@digitaldaemon.com>, John Reimer says... > >J C Calvarese wrote: > >> >> Apparently so. If he would've asked what op functions like opCmp were I would've answered a whole other question. >> >> In the future, I guess I'll leave the psychic hotline questions to Miss Cleo.... >> >> jcc7 > >Hey, what are you saying, Justin? You looking for a fight with me and my psychic abilities? LOL, no. I'm just tired of when people ask a vague question, and I get criticized for answering the wrong question. Just too thin skinned, I suppose. I wasn't mad at you. > >j/k :-) jcc7 |
August 19, 2004 Re: What are 'op' codes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | kinghajj wrote:
> You know how C++ has the cout stream, and it workd like this:
> cout << "Whatever, " << variable << " again";
>
> How could you do that in D?
Hopefully you can't.
The thing is, you aren't going to find many, or any, in this group of people that believe that overloading operator << to deal with stream output is a good idea.
Personally, I suggest you forget you ever saw that in C++.
--Steve
|
Copyright © 1999-2021 by the D Language Foundation