-1
这里是我的代码:x86的实模式:从一个阵列将数据移动到另一个
data segment
gio db 1,2,3,4,5,6
ricxvi db 1
jami db 0
x db ?
ends
stack segment
db 128 dup(0)
ends
code segment
start:
MOV AX,DATA
MOV DS,AX
mov cx, 6
lea si, gio
mov ah, 0
n1:
mov al, [si]
cmp ricxvi, 3
je n2
jmp n3
n2:
add jami, al
mov ricxvi, 1
jmp n4
n3:
add ricxvi, 1
push ax
n4:
add si, 1
add di, 1
loop n1
mov ricxvi, 1
mov ax, 0
mov cx, 6
lea si, gio
n5:
cmp ricxvi, 3
je n6
jmp n7
n6:
mov ricxvi, 1
add si, 1
loop n5
n7:
pop [si]
add si, 1
loop n5
mov ax, 4c00h
int 21h
ends
end start
我有一个名为阵列和gio
我试图扭转这种阵列但保留每3TH元素上的立场。意思我想得到这样的输出,但是当我检查变量时,在数组中我有5,4,2,1,B8
。我注意到,当程序第一次碰到pop [si]
整个数组的变化,探索变量显示我的5, NULL, 3, 4, 5, 6
应该不是5,2,3,4,5,6
?我正在使用emu8086。问题可能听起来很愚蠢,因为我是新装配。谢谢。
非常感谢你:) – Rasty