鱼C论坛

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

[汇编作业] 实验十一(并把字符串显示到屏幕上)

[复制链接]
发表于 2020-4-18 17:17:23 | 显示全部楼层 |阅读模式

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

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

x

这个实验可以结合之前显示字符串的子程序,可以达到验证实验结果的目的

assume cs:codesg
datasg segment
        db "Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends
codesg segment

begin:        
        mov ax,datasg
        mov ds,ax
        mov si,0
        call letterc
               
                mov dh,8
        mov dl,3
        mov cl,2
               
                call show_str      
        mov ax,4c00H
        int 21h
letterc: push si
                mov ax,0
                mov si,0
                s:        mov al,[si]       
                        mov ch,0
                        mov cl,[si]
                        jcxz ok
                        cmp al,97
                        jb s0
                        cmp al,122
                        ja s0
                        and al,11011111b
                        mov [si],al
               
                s0:        inc si
                        jmp short s
                ok:        pop si
                        ret
show_str:       
                        ;push bx
                        ;push cx
                        ;push si

                        mov al,dh
                        mov bl,160
                        mul bl
                       
                        add dl,dl
                        add al,dl
                       
                        mov bx,0B800h
                        mov es,bx
                        mov bx,ax

                        mov ah,cl
                       
                s1:        mov cl,[si]
                        mov ch,0
                        jcxz ok1
                       
                        mov di,1
                        mov al,[si]
                        mov es:[bx],ax
                        inc si
                        add bx,2
                        jmp short s1
                ok1:
                        ;pop si
                        ;pop cx
                        ;pop bx
                        ret                       
codesg ends
end begin
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-16 22:38

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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