Simple explanation of input and output

Source: Internet
Author: User

; 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.