assembly - The usage of push in 16bit - tasm -


.data         sum dw 250h .text      push sum      call func      ....  func:       mov bp, sp       mov ax, [bp + 2]       inc ax       mov [bp + 2], ax       ..... 

when use push instruction push reference of sum, or value? , sum changes after call func?

you want dereference address pass function

.data         sum dw 250h .text      push [sum]      call func      ....  func:      mov bp, sp      mov bx, [bp + 2]      mov ax,[bx]      inc ax      mov [bx],ax      mov [bp + 2], ax      ..... 

that seems roundabout, , i'm sure there's easier way don't have machine tasm handy. roundabout since can't use [ax] :(


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -