NASM Probleme mit MOV und MUL



  • Ich möchte MOV Befehle nach dem
    Schema:

    MOV r/m8,imm8 ; C6 /0 ib [8086] oder
    MOV r/m16,imm16 ; o16 C7 /0 iw [8086] oder
    MOV r/m32,imm32 ; o32 C7 /0 id [386]

    durchführen

    Leider meldet mir der Compiler dass, keine Größenangabe vorgenommen wurde.

    mov Flaeche,ax

    mov [ErgStr],al ;funktioniert
    mov [ErgStr+1],ah ;funktioniert
    ; mov [ErgStr+2],10h ;error: operationsize not spezified
    ; mov [ErgStr+3],13h ;error: operationsize not spezified
    ; mov [ErgStr+3],'$' ;error: operationsize not spezified

    selebisg tritt auch bei MUL auf

    MUL [Wert]

    funktioniert nicht da er meldet:
    error: operationsize not spezified

    kann mir wer helfen?

    Edit:
    so hats funktioniert:

    mov al,[Laenge]

    mul byte[Breite]
    mov [Flaeche],ax

    mov [ErgStr],ax

    mov bx,[Flaeche]
    mov byte [ErgStr+2],10h
    mov byte[ErgStr+3],13h
    mov byte[ErgStr+3],'$'

    ;
    Don't confuse the DWORD prefix outside the square brackets, which controls the size of the data stored at the address, with the one inside the square brackets which controls the length of the address itself. The two can quite easily be different:

    mov word [dword 0x12345678],0x9ABC

    This moves 16 bits of data to an address specified by a 32-bit offset.



  • was ist den ErgStr für eine variable? also wenn ich schreibe:

    ErgStr db "abc"
    mov [ErgStr], 10h
    mov [ErgStr+1], 13h
    mov [ErgStr+2], '$'
    

    funktioniert es.


Anmelden zum Antworten