Author Topic: Variable problems  (Read 15490 times)

nobody

  • Guest
Variable problems
« on: December 23, 2007, 09:54:15 PM »
Hey everyone,

just started using nasm but I've got a problem with variables not storing the values that I'm trying to put in them. Here's the code as an example:

mov byte cl,[variable]
inc cl
mov byte [variable],cl

It reads it but it doesn't store it correctly. The byte is in the current data segment and the ds register is loaded with the data segment if that has anything to do with it. Thanks in advance,

Chris

nobody

  • Guest
Re: Variable problems
« Reply #1 on: December 23, 2007, 10:50:27 PM »
mov byte cl,[variable]
inc cl
mov byte [variable],cl

I don't see any bug, OTOH:

inc byte [variable]