943,677 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 2082
  • Assembly RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Aug 11th, 2009
0

Re: Help:sum two number in asm with API

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DarkC0de is offline Offline
17 posts
since Aug 2009
Aug 11th, 2009
0

Re: Help:sum two number in asm with API

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
Assembly Syntax (Toggle Plain Text)
  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
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009
Aug 12th, 2009
0

Re: Help:sum two number in asm with API

Quote ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DarkC0de is offline Offline
17 posts
since Aug 2009
Aug 12th, 2009
0

Re: Help:sum two number in asm with API

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!
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009
Aug 12th, 2009
0

Re: Help:sum two number in asm with API

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!
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: mips asm to c
Next Thread in Assembly Forum Timeline: Kernel problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC