我无法确定它是一个特定的指令正在做它还是方法。我该改变什么?通常,所有这些说明都适用于所有地方。 但是,当我尝试添加以下内容时: 1 2 3 1 2 3 1 2 3与1 2 3 1 2 3 1 2 3
我明白了:
8 8 8 8 8 8在WinXP 32位机器上, 8 8 8
但我得到
2 3 6 在64位Win7 PC上使用2 3 6。 2 3 6
我需要让它在32位机器上运行。我该如何改变我的方法?出了什么问题?
代码:
.model small
.data
row db ?
col db ?
tot db ?
rows db 10,13,"Enter the no. of rows:$"
cols db 10,13,"Enter the no. of columns:$"
matd1 db 10,13,"Enter the first matrix:",10,13,"$"
matd2 db 10,13,"Enter the second matrix:",10,13,"$"
totald db 10,13,"The sum is:",10,13,"$"
space db " $"
newline db 10,13,"$"
mat1 db 100 dup ("$")
mat2 db 100 dup ("$")
total db 100 dup ("$")
.code
start:
mov ax,@data
mov ds,ax
lea dx,rows
mov ah,09h
int 21h
mov ah,01h
int 21h
sub al,30h
mov row,al
lea dx,cols
mov ah,09h
int 21h
mov ah,01h
int 21h
sub al,30h
mov col,al
mov al,row
mul col
mov tot,al
lea dx,matd1
mov ah,09h
int 21h
mov bl,row
lea si,mat1
top:
mov cl,col
back:
mov ah,01h
int 21h
lea dx,space
mov ah,09h
int 21h
cmp al,41h
jc temp
sub al,07h
temp:
sub al,30h
and al,0fh
mov [si],al
inc si
loop back
lea dx,newline
mov ah,09h
int 21h
dec bl
jnz top
lea dx,matd2
mov ah,09h
int 21h
mov bl,row
lea si,mat2
top1:
mov cl,col
back1:
mov ah,01h
int 21h
lea dx,space
mov ah,09h
int 21h
cmp al,41h
jc temp1
sub al,07h
temp1:
sub al,30h
and al,0fh
mov [si],al
inc si
loop back1
lea dx,newline
mov ah,09h
int 21h
dec bl
jnz top1
lea dx,totald
mov ah,09h
int 21h
lea si,mat1
lea di,mat2
mov bh,row
top2:
mov cl,col
back2:
mov al,[si]
mov bl,[di]
add bl,al
cmp bl,10h
jc temp2
mov dl,31h
mov ah,02h
int 21h
sub bl,10h
cmp bl,0ah
jc ans
add bl,07h
ans:
add bl,30h
mov dl,bl
mov ah,02h
int 21h
jmp temp3
temp2:
mov dl,30h
mov ah,02h
int 21h
cmp bl,0ah
jc ans1
add bl,07h
ans1:
add bl,30h
mov dl,bl
mov ah,02h
int 21h
temp3:
lea dx,space
mov ah,09h
int 21h
inc si
inc di
loop back2
lea dx,newline
mov ah,09h
int 21h
dec bh
jnz top2
mov ah,4ch
int 21h
end start
答案 0 :(得分:1)
只要代码是16位实模式DOS并且在DOSBox 模拟器上运行,问题在于64位和32位Windows上的DOSBox模拟器之间的区别。
然后,您必须在DOSBox错误跟踪器或主页网站中搜索这些差异。