Help:sum two number in asm with API

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2009
Posts: 9
Reputation: DarkC0de is an unknown quantity at this point 
Solved Threads: 0
DarkC0de DarkC0de is offline Offline
Newbie Poster

Re: Help:sum two number in asm with API

 
0
  #11
Aug 11th, 2009
thanks it's work now

if you please explain The structure of the code

mov byte ptr num[ eax ], 0
Last edited by DarkC0de; Aug 11th, 2009 at 10:05 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: Help:sum two number in asm with API

 
0
  #12
Aug 11th, 2009
First I have a question. Did your instructor tell you to use the API that comes with masm32 or do it yourself?

mov byte ptr num[eax],0

Memory access can be direct from memory
  1. mov num,al ; 8-bit
  2. mov num,ax ;16-bit
  3. mov num,eax ; 32-bit
  4. mov num,rax ; 64-bit
  5.  
  6. memory can use a register offset
  7. mov num[ebx],ax num+value in ebx is new memory location
  8. mov num[ebx*4],ax num+(value *4) You can use a scalar
  9.  
  10. In your particular case
  11. mov num[ eax ],0 <-- undefined
  12. 0 is an undertermined size so it needs a data type pointer
  13. byte ptr byte index
  14. word ptr word index
  15. dword ptr dword index
  16. qword ptr qword index
  17. oword ptr oword index
  18. so...
  19. mov byte ptr num[ eax ],0
  20. ...store a zero as a byte at location num+eax
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 9
Reputation: DarkC0de is an unknown quantity at this point 
Solved Threads: 0
DarkC0de DarkC0de is offline Offline
Newbie Poster

Re: Help:sum two number in asm with API

 
0
  #13
Aug 12th, 2009
Did your instructor tell you to use the API that comes with masm32 or do it yourself?
i didn't studied Assembly but I hear about assembly and I want to learn the assembly .I ask another forum how i can start with assembly they tell me to start with use API
I'm interested in system and virus protected
and I'm programmer c++,for that I want to learn Assembly

thanks for help me
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: Help:sum two number in asm with API

 
0
  #14
Aug 12th, 2009
Find a good book and start working the sample problems. You need to work your way up.
Having the ability to single step your code is best!
Since you have C++ how about starting with inline code!

I prefer an assembly file, but inline is much easier to work with initially!
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: Help:sum two number in asm with API

 
0
  #15
Aug 12th, 2009
There is an author I like that has two books about assembly language.
One is a more advanced book, "Vector Game Math Processors" which I really like. It came with a CD and is out of print but is still available from Amazon.
The other is very complete, is still in print "32/64-Bit 80x86 Assembly Language Architecture" and has downloadable code samples. It has mistakes as I understand the author was rushed but I still like the book.
The files download link...
http://www.jbpub.com/catalog/9781598220025/samples/
The samples are C code that has some inline but has external assembly files that it links with. The best of both worlds. Do your input/output in a higher level language such as C/C++ and call the assembly code directly to do the low level functions.

In your particular case, pick one, compile it and then run it. Set a breakpoint and then single-step following the code into the assembly function. You can use it as a testbench for learning your assembly. The single-stepping with disassembly view and register views turned on will allow you to see the registers and flags changing as the instructions are executed!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Assembly
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC