0

I need to decrement some bytes on/from the stack at a given address (indexed from esi).

pop esi ; 

Now changing would not be a problem, I simply can do

mov [esi+13], al ;

to store the content from al in esi+13.

But how can I decrement what is in "esi+13".

E.g. value of esi+13 = 0xFF → New value of esi+13 = 0xFE.

I tried different things like

dec [esi+13] ;
sub [esi+13], 1; 
dec esi+13; 

and so on, but I didn't find a solution.

I don't know which bytes will be in "esi+13" so I can't move the "result" to the address, I really have to decrement it.

Cœur
  • 37,241
  • 25
  • 195
  • 267
CFP
  • 359
  • 8
  • 17
  • What do you mean you can't move a result to a location for which you have a pointer in esi? I can understand why you don't *want* to do it in baby steps, but it should be *possible*. – Chris Stratton Jun 25 '13 at 19:05

1 Answers1

1

I think this should work:

dec byte ptr [esi+13]
faffaffaff
  • 3,429
  • 16
  • 27