![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
M$ "puzzle"
The following asm block performs a common math function, what is it?
cwd xor ax, dx sub ax, dx ps: me? i have no clue what "asm" means... anybody knows how to tackle this thing? ![]() |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Apr 2005
Posts: 96
Rep Power: 4
![]() |
Thats assembly.... thats all I know.
__________________
I had my portable CD player, and took it in the bathroom with me while I went to pee. And the second I whipped my penis out, the theme song to 'Rocky' started playing. I've never felt more manly than in that moment. |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4
![]() |
it's assembly alright, and sub probably stands for substract. So you're first Xoring register ax with dx and then substracting dx from ax, I think.
|
|
|
|
|
|
#4 |
|
Professional Programmer
|
Sorry for answering a question with a question, but if you don't even know what asm means, why are you worrying with this???
__________________
Amateurs built the ark Professionals built the Titanic |
|
|
|
|
|
#5 | |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
Quote:
just being curious... I never seen this before, is there smth wrong with asking? |
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
The cwd converts its operand from a word to a double word. The xor performs that operation on its two operands. Same for the sub. Nopey, not a dam' thang wrong with asking. Technical forum, technical question. Well to the right of the mean, I'd say, as a post.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5
![]() |
out of curiosity, where did you come across this? and why did it trouble you so? was it inline in a C program or something?
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|