鱼C论坛

 找回密码
 立即注册
查看: 2766|回复: 5

[已解决]求助求助

[复制链接]
发表于 2019-12-10 17:11:28 | 显示全部楼层 |阅读模式
20鱼币
本帖最后由 李兵 于 2019-12-10 17:11 编辑

这个不应该是3乘8共24行三种颜色交替吗?怎么乱跳的,实在不懂哪里问题,请求帮助,路过的大神帮忙看看,谢谢!

assume cs:codesg, ds:datasg
datasg segment
    db 'welcome to masm! Iam learnint assembly, please give us your'
    db ' advice, thanks! ABCD'
    db 2h, 24h, 41h
datasg ends
codesg segment
start:
    mov ax, datasg
    mov ds, ax
    mov bx, 0
    mov ax, 0b800h
    mov es, ax
    mov si, 0
    mov di, 0

    mov cx, 8
s1:
    push cx
    mov cx, 3h
s0:
    push cx
    push bx
    push si
    push di
    mov cx, 50h
s:
    mov al, ds:[bx]
    mov es:[si], al
    mov al, ds:50h[di]
    mov es:[si+1], al
    inc bx
    add si, 2
    loop s

    pop di
    pop si
    pop bx
    pop cx
    inc di
    add si, 0a0h
    loop s0
  
    pop cx
    loop s1

    mov ax, 4c00h
    int 21h
codesg ends
end start
最佳答案
2019-12-10 17:11:29
assume cs:codesg, ds:datasg
datasg segment
    db 'welcome to masm! Iam learnint assembly, please give us your' 
    db ' advice, thanks! ABCD'
    db 2h, 24h, 41h
datasg ends
codesg segment
start:
    mov ax, datasg
    mov ds, ax
    mov bx, 0
    mov ax, 0b800h
    mov es, ax
    mov si, 0
    mov di, 0

    mov cx, 8
s1:
    push cx
    mov cx, 3h
s0: 
    push cx
    push bx
    push si
    push di
    mov cx, 50h
s:
    mov al, ds:[bx]
    mov es:[si], al
    mov al, ds:50h[di]
    mov es:[si+1], al
    inc bx
    add si, 2
    loop s

    pop di
    pop si
    pop bx
    pop cx
    inc di
    
    
        cmp        di, 3
        jb        l0
        xor        di, di
l0:
    
    
    
    
    add si, 0a0h
    loop s0
  
    pop cx
    loop s1

    mov ax, 4c00h
    int 21h
codesg ends
end start
111.png
111.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2019-12-10 17:11:29 | 显示全部楼层    本楼为最佳答案   
assume cs:codesg, ds:datasg
datasg segment
    db 'welcome to masm! Iam learnint assembly, please give us your' 
    db ' advice, thanks! ABCD'
    db 2h, 24h, 41h
datasg ends
codesg segment
start:
    mov ax, datasg
    mov ds, ax
    mov bx, 0
    mov ax, 0b800h
    mov es, ax
    mov si, 0
    mov di, 0

    mov cx, 8
s1:
    push cx
    mov cx, 3h
s0: 
    push cx
    push bx
    push si
    push di
    mov cx, 50h
s:
    mov al, ds:[bx]
    mov es:[si], al
    mov al, ds:50h[di]
    mov es:[si+1], al
    inc bx
    add si, 2
    loop s

    pop di
    pop si
    pop bx
    pop cx
    inc di
    
    
        cmp        di, 3
        jb        l0
        xor        di, di
l0:
    
    
    
    
    add si, 0a0h
    loop s0
  
    pop cx
    loop s1

    mov ax, 4c00h
    int 21h
codesg ends
end start
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2019-12-10 17:12:24 | 显示全部楼层
图片一直传不上,没想到发表了居然都上了,三张都是一样的
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2019-12-11 13:31:10 | 显示全部楼层

   
        cmp        di, 3
        jb        l0
        xor        di, di
l0:
这几个没学到,可以麻烦您解释下吗?谢谢
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2019-12-11 13:35:48 | 显示全部楼层
李兵 发表于 2019-12-11 13:31
cmp        di, 3
        jb        l0
        xor        di, di

继续往后学
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2019-12-11 13:43:44 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-29 05:25

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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