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_Nasm_X86 16 - Fatal编程技术网

Assembly 我如何解决这个问题;操作数大小不匹配“;错误?

Assembly 我如何解决这个问题;操作数大小不匹配“;错误?,assembly,nasm,x86-16,Assembly,Nasm,X86 16,组装后: as02.asm:10:错误:操作数大小不匹配mov ax,byte[num]编写一个子例程,从VU ID=1821936的数组中查找第一个偶数并计算其阶乘。 [org 0x0100] num: db 0 factorial: dw 1 VUID: db 1,8,2,1,9,3,6 mov bx, 0 jmp start fact: mov ax, byte[num] fact_loop: mul word[factorial] sub ax, 1

组装后:
as02.asm:10:错误:操作数大小不匹配

mov ax,byte[num]
编写一个子例程,从VU ID=1821936的数组中查找第一个偶数并计算其阶乘。
[org  0x0100]

num: db 0
factorial: dw 1

VUID: db 1,8,2,1,9,3,6
    mov bx, 0
jmp start

fact:   mov ax, byte[num]
fact_loop: mul word[factorial]

    sub ax, 1
    cmp ax, 0
    jp fact_loop
    ret

start:  mov bx, 0
    mov cx, [VUID+bx]
    add bx, 1
    shr cx, 1
    jc start
    mov [num], cx

    call fact

mov ax, 0x4c00
int 0x21