   ASM code giving exception
  Some simple code....it does what I want which is simply to print the 2nd char of the string. But it throws an exception...why?[section .data]string: db 'ABCD',10,0string2: db 'Char of 2nd element = %c',10,0[section .text]global _mainextern _printf_main:movzx eax, byte[string + 1]push eaxpush string2call _printfadd eax, 8mov eax, 0ret   
  Try lea eax, [string + 1] instead of movzx.With movzx you are loading value of second string byte into register, not the address of it.   ;  nah i messed up on this line.  add eax, 8[Edited by - OneThreeThreeSeven on June 3, 2010 6:23:57 PM]