汇编网首页登录博客注册
zhengcong3250的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
  •  何以解忧愁,唯有杜康酒!
  • 『姓名』:
  • 『性别』:男『发送消息
  • 个人说明:http://student.zjzk.cn/course_ware/data_structure/web/shu/shu6.3.2.htm
  • 详细信息『加为好友』
学习动态

[2010-07-27 12:14] 宏汇编实践

;--------------MACRO DEFINELIB-------------
indzh macro
    mov ah,01h
    int 21h
    endm
;------------------------------------------
outzhc macro addr
    mov dx,offset addr
    mov ah,09h
    int 21h
    endm
;---------------宏定义段-----------------------
assume cs:code,ds:data
data segment
str1 db 'input char:$'
str2 db 0dh,0ah,'output srting:'
buf db  10h dup (0),10,13,'$'
data ends
stack segment stack
      dw 100 dup (?)
stack ends
code segment
start:mov ax,data
      mov ds,ax
      outzhc str1  ;调用宏显示str1
      mov di,offset buf    
      mov cx,10h      
 lop1:indzh        ;调用宏从键盘接收字符
      mov [di],al
      inc di
      loop lop1
      outzhc str2
      outzhc buf
      mov ax,4c00h
      int 21h
code ends
end start
评论次数(0)  |  浏览次数(1115)  |  类型(我的程序) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码