Compilation Basics: Hello World

Source: Internet
Author: User

"Hello world!" is a classic, the first program to learn every language is it, but for the Assembly, I feel it's getting started with "Hello world!" Words, it is a bit difficult, for assembly language some of the basic knowledge is no longer said, here on the implementation of the assembly language output "Hello world!"

Data    SEGMENT    
    STRING  DB   ' Hello wowrld! ', ' $ '
data    ENDS    
        
STACK1  SEGMENT    PARA STACK    
    DW  20H DUP  (0)    
STACK1  ENDS    
codes   SEGMENT assume Cs:codes  , DS :D Atas, Ss:stack1    
BEGIN:  mov     ax, DATA    
    mov DS, AX-    
    LEA     DX, STRING    
    mov     AH, 9    
    int     21H    
    MOV     AH, 4CH    
    int 21H    
codes   ENDS end    
    BEGIN

After compiling and succeeding the link builds our executable file, this time output we want "Hello world!" note, to display "Hello world!", you need to execute the executable file in cmd

This article is from the "Late Evening" blog, please be sure to keep this source http://yiluohuanghun.blog.51cto.com/3407300/935340

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.