Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 31st, 2006, 4:27 PM   #11
eax
Newbie
 
eax's Avatar
 
Join Date: Mar 2006
Posts: 17
Rep Power: 0 eax is on a distinguished road
Could you point out the flaw in this piece of code also ?

In the mean time i also come up with this code :

mov ecx,32
mov eax,00fffff0h


doshift: shl eax,1
jc setcount
setcount: inc count
loop doshift

But then the result i got in count was 32 ,

Could you point out the flaw in this piece of code ?
eax is offline   Reply With Quote
Old Mar 31st, 2006, 6:25 PM   #12
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Sure. It jumps to 'setcount' if there's a carry, and falls through to 'setcount' if there's no carry. The result is to count, regardless. I recommend that you make a flowchart from your code and analyze it. For instructions like "loop", be sure and break them into their entire function. "loop", for instance, would be, "decrement ecx", "test ecx", and "jnz label operand".
__________________
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
DaWei is offline   Reply With Quote
Old Apr 1st, 2006, 5:57 PM   #13
eax
Newbie
 
eax's Avatar
 
Join Date: Mar 2006
Posts: 17
Rep Power: 0 eax is on a distinguished road
Could you also help me with Context Free Grammar ?

Since its Assembly Language forum ,

Could you also help me with CFG's ( Context Free Grammar) ?

or any other questions on Automata Theory ?
eax is offline   Reply With Quote
Old May 20th, 2006, 6:07 PM   #14
linxis
Programmer
 
Join Date: May 2006
Location: USA
Posts: 52
Rep Power: 0 linxis has a little shameless behaviour in the past
Send a message via ICQ to linxis
be more specific

What language
asembly can be: masm, nasm, tasm, hla, casm, machine, binary, DA, c++
linxis is offline   Reply With Quote
Old May 20th, 2006, 6:17 PM   #15
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You're mistaken. Assembly is not a tool. Assemblers are tools. Please try to contain yourself when it comes to dredging up old threads.
__________________
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC