flash121 0 Light Poster

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.