鱼C论坛

 找回密码
 立即注册
查看: 3433|回复: 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

  1. assume cs:codesg, ds:datasg
  2. datasg segment
  3.     db 'welcome to masm! Iam learnint assembly, please give us your'
  4.     db ' advice, thanks! ABCD'
  5.     db 2h, 24h, 41h
  6. datasg ends
  7. codesg segment
  8. start:
  9.     mov ax, datasg
  10.     mov ds, ax
  11.     mov bx, 0
  12.     mov ax, 0b800h
  13.     mov es, ax
  14.     mov si, 0
  15.     mov di, 0

  16.     mov cx, 8
  17. s1:
  18.     push cx
  19.     mov cx, 3h
  20. s0:
  21.     push cx
  22.     push bx
  23.     push si
  24.     push di
  25.     mov cx, 50h
  26. s:
  27.     mov al, ds:[bx]
  28.     mov es:[si], al
  29.     mov al, ds:50h[di]
  30.     mov es:[si+1], al
  31.     inc bx
  32.     add si, 2
  33.     loop s

  34.     pop di
  35.     pop si
  36.     pop bx
  37.     pop cx
  38.     inc di
  39.    
  40.    
  41.         cmp        di, 3
  42.         jb        l0
  43.         xor        di, di
  44. l0:
  45.    
  46.    
  47.    
  48.    
  49.     add si, 0a0h
  50.     loop s0
  51.   
  52.     pop cx
  53.     loop s1

  54.     mov ax, 4c00h
  55.     int 21h
  56. codesg ends
  57. end start
复制代码
111.png
111.png
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2019-12-10 17:11:29 | 显示全部楼层    本楼为最佳答案   

  1. assume cs:codesg, ds:datasg
  2. datasg segment
  3.     db 'welcome to masm! Iam learnint assembly, please give us your'
  4.     db ' advice, thanks! ABCD'
  5.     db 2h, 24h, 41h
  6. datasg ends
  7. codesg segment
  8. start:
  9.     mov ax, datasg
  10.     mov ds, ax
  11.     mov bx, 0
  12.     mov ax, 0b800h
  13.     mov es, ax
  14.     mov si, 0
  15.     mov di, 0

  16.     mov cx, 8
  17. s1:
  18.     push cx
  19.     mov cx, 3h
  20. s0:
  21.     push cx
  22.     push bx
  23.     push si
  24.     push di
  25.     mov cx, 50h
  26. s:
  27.     mov al, ds:[bx]
  28.     mov es:[si], al
  29.     mov al, ds:50h[di]
  30.     mov es:[si+1], al
  31.     inc bx
  32.     add si, 2
  33.     loop s

  34.     pop di
  35.     pop si
  36.     pop bx
  37.     pop cx
  38.     inc di
  39.    
  40.    
  41.         cmp        di, 3
  42.         jb        l0
  43.         xor        di, di
  44. l0:
  45.    
  46.    
  47.    
  48.    
  49.     add si, 0a0h
  50.     loop s0
  51.   
  52.     pop cx
  53.     loop s1

  54.     mov ax, 4c00h
  55.     int 21h
  56. codesg ends
  57. end start
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2019-12-10 17:12:24 | 显示全部楼层
图片一直传不上,没想到发表了居然都上了,三张都是一样的
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

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

   
        cmp        di, 3
        jb        l0
        xor        di, di
l0:
这几个没学到,可以麻烦您解释下吗?谢谢
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

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

继续往后学
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2019-12-11 13:43:44 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 18:48

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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