⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 include.asm

📁 汇编语言 参考书 包含作业与答案 从入门到精通 通俗易懂
💻 ASM
字号:
; This sample shows
; the use of emu8086.inc
; library of predefined
; macros and procedures.

#make_COM#

INCLUDE 'emu8086.inc'

ORG     100h

; print out some chars,
; using macro:
PUTC    'H'
PUTC    'i'
PUTC    ' '
PUTC    'T'
PUTC    'h'
PUTC    'e'
PUTC    'r'
PUTC    'e'
PUTC    '!'

; new line:
PUTC    13
PUTC    10

; print string using macro
; with carriage return in the end:
PRINTN 'I love Assembly!'

; print string using procedure:
LEA     SI, msg
CALL    print_string

; input a number into CX
; using procedure:
CALL    scan_num

; new line:
PUTC    13
PUTC    10

PRINT "You've entered: "
MOV     AX, CX
; print out the number in AX
; using procedure:
CALL    print_num


RET

msg     DB      'Enter a number: ', 0

;=================================
; here we define the functions
; from emu8086.inc

; SCAN_NUM reads a
; number from the user and stores
; it in CX register:
DEFINE_SCAN_NUM

; PRINT_STRING prints a null
; terminated string, the address
; of the string is in DS:SI 
DEFINE_PRINT_STRING

; PRINT_NUM prints a signed
; number in AX.
; (PRINT_NUM requires the declaration
; of PRINT_NUM_UNS).
; PRINT_NUM_UNS prints an unsigned
; number in AX:

DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS

;=================================

END

⌨️ 快捷键说明

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