使用
if1--g7_7
;-------------------------------------------------
if1
include macro.mac
endif
;-------------------------------------------------
.model small
.386
.stack 200h ;定义堆栈段
.data ;定义数据段
messg1 db 'Customer name?',13,10,'$'
messg2 db 'Customer address?',13,10,'$'
;--------------------------------------------------
.code ;定义代码段
begin proc far
initz
prompt messg1
prompt messg2
finish
begin endp
;---------------------------------------------------
end begin
;使用
if1--g7_8
;---------------------------------------------------
endif
;---------------------------------------------------
.model small
.386
0200 .stack 200h ;定义堆栈段
0000 .data ;定义数据段
0000 43 75 73 74 6F 6D 65 messg1 db 'Customer name?',13,10,'$'
72 20 6E 61 6D 65 3F
0D 0A 24
0011 43 75 73 74 6F 6D 65 messg2 db 'Customer address?',13,10,'$'
72 20 61 64 64 72 65
73 73 3F 0D 0A 24
;---------------------------------------------------
0000 .code ;定义代码段
0000 begin proc far
initz
0000 B8 ---- R 1 mov ax,@data ;初始化段寄存器
0003 8E D8 1 mov ds,ax ;
0005 8E C0 1 mov es,ax
prompt messg1
0007 B4 09 1 mov ah,09h ;ah中的功能号9表示要显示一串字符
0009 8D 16 0000 R 1 lea dx,messg1 ; dx存放要显示的字符串首地址
000D CD 21 1 int 21h ; 调用DOS
prompt messg2
000F B4 09 1 mov ah,09h ; ah中的功能号9表示要显示一串字符
0011 8D 16 0011 R 1 lea dx,messg2 ; dx存放要显示的字符串首地址
0015 CD 21 1 int 21h ; 调用DOS
finish
0017 B8 4C00 1 mov ax,4c00h ; ah中的功能号4ch表示要返回DOS,al中的00表示无错
001A CD 21 1 int 21h
001C begin endp
;---------------------------------------------------------
001C end begin