|
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
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
|
-
-
|