| | |
Help:sum two number in asm with API
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
mov byte ptr num[eax],0
Memory access can be direct from memory
Assembly Syntax (Toggle Plain Text)
mov num,al ; 8-bit mov num,ax ;16-bit mov num,eax ; 32-bit mov num,rax ; 64-bit memory can use a register offset mov num[ebx],ax num+value in ebx is new memory location mov num[ebx*4],ax num+(value *4) You can use a scalar In your particular case mov num[ eax ],0 <-- undefined 0 is an undertermined size so it needs a data type pointer byte ptr byte index word ptr word index dword ptr dword index qword ptr qword index oword ptr oword index so... mov byte ptr num[ eax ],0 ...store a zero as a byte at location num+eax
•
•
Join Date: Aug 2009
Posts: 9
Reputation:
Solved Threads: 0
•
•
•
•
Did your instructor tell you to use the API that comes with masm32 or do it yourself?
I'm interested in system and virus protected
and I'm programmer c++,for that I want to learn Assembly
thanks for help me
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!
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!
![]() |
Similar Threads
- The sum of digits of a number (C)
- Average and sum with array (C++)
- how to multiply 2 float number in asm(x86)? (Assembly)
- Windows API equivalent in Linux (C)
- Help with finding perfect number (C++)
- need help with getting average using java servlet (Java)
- Sum of digits (C)
Other Threads in the Assembly Forum
- Previous Thread: mips asm to c
- Next Thread: Kernel problem
| Thread Tools | Search this Thread |
Tag cloud for Assembly





