byte ptr usage (nasm assembly)

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

Join Date: Jan 2008
Posts: 49
Reputation: flash121 is an unknown quantity at this point 
Solved Threads: 0
flash121 flash121 is offline Offline
Light Poster

byte ptr usage (nasm assembly)

 
0
  #1
Dec 3rd, 2008
Hello!

I want to go through a string char by char and i've heard a byte ptr is the way to do this, but i'm having problems with using it.

I tried with the code below, but i get an error saying: "comma or end of line expected" at the byte ptr line.
  1. BITS 32
  2. extern printf
  3. global main
  4.  
  5. section .data
  6. string db "string",10,0
  7.  
  8. section .text
  9.  
  10. main:
  11. push dword string
  12. call fun
  13. add esp,4
  14.  
  15. ret
  16.  
  17.  
  18. fun:
  19.  
  20. mov ebx,dword[esp+4]
  21. mov al,byte ptr[ebx]
  22. ..
  23. ..
  24. ..
  25. ret

Any advice would be much appriciated.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC