; Assembly instructions, which indicate that the program will be compiled to run on computers in the Intel386 series and above
. 386
; model flat indicates that the program uses protected mode, that is, the program will use a 32-bit address,
; c indicates that the program can be connected to a C or C + + program , you need to run
. Model Flat,c
in the Visual C + + environment;. The stack is in hexadecimal notation, and the following represents a 256-byte
. Stack 100h
; PROTO indicates the prototype of the printf function
; arg1:ptr Byte indicates that the argument to the printf statement is a pointer to a string
printf PROTO arg1:ptr byte,printlist:vararg
; libraries associated with printf
Includelib msvcrt.lib
; data segment
. Data
;p rintf ("%s%d\n", "the Number is:);
msg1fmt byte "%s%d",0ah,0
; use "byte" to declare MSG1 as a string, 0Ah for "\ n", 0 for output string to end
msg1 byte "The number is:", 0
; The variable number is declared as a signed two-word type
number Sdword?
. Code
main1 proc
; number=5
mov number,5
; msg1fmt and MSG1 are preceded by addr, because they are pointers to strings, Number is not required because it is an integer variable
; the Invoke directive is similar to calling a subroutine
Invoke Printf,addr msg1fmt,addr msg1,number
ret
main1  ENDP
end
Input and output simple explanation