如何解决“操作数大小不匹配”错误?

时间:2019-11-25 16:28:43

标签: assembly nasm x86-16

[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

组装后: as02.asm: 10: error: mismatch in operand sizes

0 个答案:

没有答案