鱼C论坛

 找回密码
 立即注册
查看: 2120|回复: 0

[汇编作业] 练习一下实验10-1

[复制链接]
发表于 2019-9-23 18:55:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
assume cs:code
data segment
        db 'Welcome to masm!',0
data ends

code segment
start:         mov dh, 7                ;line number
                mov dl, 3                ;column number
                mov cl, 2                ;color
                mov ax, data
                mov ds, ax
                mov si, 0                ;ds:[si] = 1st address of str
                call show_str
       
        s:        mov ax, 0
                jmp short s
                mov ax, 4c00h
                int 21h
show_str:
                mov bx, 0
                mov ax, 0B800h
                mov es, ax                ;es 显存地址
               
                mov al, 160                ;bytes per line
                mul dh
                mov bx, ax                ;es:[bx] = 1st address of line8
               
                mov al, dl
                add al, dl
                mov ah, 0
                add bx, ax                ;es:[bx] = 1 target address
               
                mov dl, cl
                push cx
                mov cx, 17
        s0:        jcxz ok
                mov al, ds:[si]
                mov byte ptr es:[bx], al
                mov byte ptr es:[bx+1], dl
                add bx, 2
                inc si
                loop s0

        ok:        pop cx
                ret

code ends
end start
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-7-7 20:03

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表