Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 有效地址计算无效_Assembly - Fatal编程技术网

Assembly 有效地址计算无效

Assembly 有效地址计算无效,assembly,Assembly,请看下面的程序,错误是无效的有效地址计算,我已经提到了这一行,请告诉我为什么它的有效地址计算无效 这是节目单 使用以下公式(对于TASM)更容易记住地址规范: 其中|表示OR(表示BX和BP不能在同一地址规范中)。 常量可以是变量或数值常量。cx在哪里分配?您分配了ax和dx。cx的值是多少?我已经做了更正,请现在检查我应该使用哪个寄存器here@Zia,我发布了一个有效索引列表,来自英特尔手册。别忘了下载并查看它。 [org 0x100] jmp start array1: dw 10,

请看下面的程序,错误是无效的有效地址计算,我已经提到了这一行,请告诉我为什么它的有效地址计算无效 这是节目单


使用以下公式(对于TASM)更容易记住地址规范:

其中|表示OR(表示BX和BP不能在同一地址规范中)。
常量可以是变量或数值常量。

cx在哪里分配?您分配了ax和dx。cx的值是多少?我已经做了更正,请现在检查我应该使用哪个寄存器here@Zia,我发布了一个有效索引列表,来自英特尔手册。别忘了下载并查看它。
[org 0x100]
jmp start


array1: dw 10,15,20,25,30,35,40,45,50,55
array2: dw 15,10,20,35,40,30,55,50,25,45

start:  mov bx,0
    mov cx,0
loop:   mov ax,[array2+bx]
        cmp ax,[array1+cx]//here is the error invalid effective address calculation 
        jne NextElementOfArray1


NextElementOfArray2:    add bx,2
                        cmp bx,20       
            je end
                        mov cx,0
            jmp loop


NextElementOfArray1:    add cx,2        
                        cmp cx,20       
            je NextElementOfArray2   
            jmp loop
end:    mov ax,0x4c00
    int 0x21
start:  mov bx,0
        mov dx,0 ; <-- did you mean "mov cx, 0" ?
loop:   mov ax,[array2+bx]
        cmp ax,[array1+cx]
Effective Address Mod R/M Value of ModR/M Byte (in Hexadecimal)

[BX+SI]
[BX+DI]
[BP+SI]
[BP+DI]
[SI]
[DI]
[BX]
[BX+SI]+disp8
[BX+DI]+disp8
[BP+SI]+disp8
[BP+DI]+disp8
[SI]+disp8
[DI]+disp8
[BP]+disp8
[BX]+disp8
[BX+SI]+disp16
[BX+DI]+disp16
[BP+SI]+disp16
[BP+DI]+disp16
[SI]+disp16
[DI]+disp16
[BP]+disp16
[BX]+disp16
[BX|BP]+[SI|DI]+constant