Tuesday, March 16, 2021

INC and DEC Instructions

  • Adds or subtracts 1 from the target operand

inc ax
dec ax


  • If there the target operand is a smaller register, the other parts of a larger resgister will not be affected.

mov eax,1002FFFFh
; eax = 1002FFFFh

inc ax
; FFFFh + 1 will be 10000h but the higher 16 bits will not
; be affected so eax = 10020000h

mov eax,30020000h
; Same true for subtracting, the higher bits will not be
; affected. eax = 3002FFFFh

No comments:

Post a Comment