954,490 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

byte ptr usage (nasm assembly)

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.

BITS 32
extern printf
global main

section .data
string db "string",10,0

section .text

main:
push dword string
call fun
add esp,4

ret


fun:

mov ebx,dword[esp+4]
mov al,byte ptr[ebx]
..
..
..
ret


Any advice would be much appriciated.

flash121
Light Poster
49 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You