int10_13.asm

来自「汇编语言 参考书 包含作业与答案 从入门到精通 通俗易懂」· 汇编 代码 · 共 57 行

ASM
57
字号
; This is an example of INT 10h / AH=13h
; function.

#make_COM#

CSEG    SEGMENT

ORG     100h

start:

; set ES (just in case):
PUSH    CS
POP     ES

MOV     BH, 0    ; page.
LEA     BP, msg  ; offset.
MOV     BL, 0F3h ; default attribute.
MOV     CX, 12   ; char number.
MOV     DL, 2    ; col.
MOV     DH, 1    ; row.
MOV     AH, 13h  ; function.
MOV     AL, 1    ; sub-function.
INT     10h

; show current cursor position:
MOV     AL, '<'  
MOV     AH, 0Eh
INT     10h

MOV     BH, 0    ; page.
LEA     BP, cmsg ; offset of string with attributes.
MOV     BL, 0F3h ; default attribute (not used when AL=3).
MOV     CX, 12   ; char number.
MOV     DL, 2    ; col.
MOV     DH, 3    ; row.
MOV     AH, 13h  ; function.
MOV     AL, 3    ; sub-function.
INT     10h

; show current cursor position:
MOV     AL, '<'
MOV     AH, 0Eh
INT     10h

RET

msg DB 'Hello World!'

cmsg DB 'H', 0CFh, 'e', 8Bh, 'l', 0F0h, 'l', 5Fh, 'o', 3Ch, ' ', 0E0h
     DB 'W', 0B3h, 'o', 2Eh, 'r', 0CAh, 'l', 1Ah, 'd', 0ACh, '!', 2Fh


CSEG    ENDS

END     start  ; stop compiler, and set entry point.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?