i've got this code to just print out whatever is in the register ax currently:
.686p 
.xmm
.model flat,c
.stack  4096
; include C libraries
includelib      msvcrtd
includelib      oldnames
includelib      legacy_stdio_definitions.lib
; imported functions
extrn   printf:near
.data ; initialized global vars
IntegerFormat   db  "The result is: %d",0dh,0ah,0
.code
        
public  main
main proc
    ; your logic goes here.
    mov ax, 3
    
    movsx   eax, ax
    push    eax
    push    offset IntegerFormat
    call    printf  ; call printf(IntegerFormat, 3)
    add     esp, 8 
    xor     eax,eax
    ret
main endp
        end
i've created a C++ empty project and added this .asm file.
It didn't run, so I did what's written here:
Compiling assembly in Visual Studio
And it worked.
But now, whenever I update the code and build, for example i changed mov ax, 3 to mov ax, 4
It still prints out 3.
The only way that seems to solve it is setting the item type (in the properites of the .asm file) to does not participate in build, and then do what written in the link I provided again.
Is there any way to change it so it compiles the new code version every time without having to do the process I described above every time?
Thanks in advance!
