汇编基础中int 21h中断例程中的9号子程序怎样实现hello world

汇编基础中int 21h中断例程中的9号子程序怎样实现hello world,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

    IDE : Masm for Windows 集成实验环境 2015
      OS : Windows 10 x64
typesetting : Markdown
  

code

datas segment
    ;数据段代码
    db 'hello world','$'   ;$不显示,但是要作为要显示字符串的结束标志,必须有

datas ends

stacks segment
    ;堆栈段代码

stacks ends

codes segment
    assume cs:codes,ds:datas,ss:stacks
start:
    mov ax,datas
    mov ds,ax

    mov ah,2     ;进行放置光标的设定
    mov bh,0     ;0页
    mov dh,5     ;5行
    mov dl,12    ;12列
    int 10h      ;调用的是int 10h中断例程中的子程序

    mov dx,0

    mov ah,9     ;调用的是int 21h中断例程中的第九号子程序,其实管他叫函数更好些吧
    int 21h

    mov ah,4ch
    int 21h
codes ends
    end start

    ; 只要好好看书,这个代码就可以看懂.
    ; 自学的人加油呀.

debug

汇编基础中int 21h中断例程中的9号子程序怎样实现hello world

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注行业资讯频道,感谢您对亿速云的支持。