. : : Assembly Language : : .  |  首页  |  我提出的问题  |  我参与的问题  |  我的收藏  |  消息中心   |  游客  登录  | 
刷新 | 提问 | 未解决 | 已解决 | 精华区 | 搜索 |
  《汇编语言》论坛 ->CALL和RET指令
  管理员: assembly   [回复本贴] [收藏本贴] [管理本贴] [关闭窗口]
主题 : :  实验10.1 符合题意的程序  [待解决] 回复[ 0次 ]   点击[ 310次 ]  
wjb0001
[帖 主]   [ 发表时间:2012-02-24 19:07 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2011-07-20 08:57
发现很多人忽略了行列的对应,就是说在1列1行时显示不在最左上角上。
DSEG SEGMENT
        db 'welcome to masm!',0
DSEG ENDS

CSEG SEGMENT
        assume  cs:CSEG, ds:DSEG
        
start:          ;主程序入口

        mov ax, dseg
        mov ds, ax
                    mov dl,1
                    mov dh,1
                    mov cl,100100B
                    mov si ,0
              call show_str

       mov ax,4c00h
       int    21h
show_str:
;名称:show_str
;功能:显示一串末尾是0的字符串
;参数:(dh)=行号(0~24),(dl)=列号(0~79),
;           (cl)=颜色,ds:si 指向字符串的首地址
;返回:无
              push cx
              push es
              push ax
              push bx

       mov ax,0b800h
       mov es,ax
       dec dh
       dec dl
       mov al,160
       mul dh
       add dl,dl
        mov dh,0
        add ax,dx
        mov bx,ax
        mov dl,cl
s:     mov cl,[si]
        mov es:[bx],cl
        mov es:[bx+1],dl
        mov ch,0
        jcxz ok
        inc si
        add bx,2
        jmp  s

ok:   pop bx
        pop ax
        pop  es
        pop  cx

       ret
cseg ends
   end  start
需要登录后才能回帖 -->> 请单击此处登录
    Copyright © 2006-2024   ASMEDU.NET  All Rights Reserved