nasm Kompilierungsproblem



  • Hey Leute
    hab ein kleines Kompilierungsproblem mit nasm 😕
    Die Version:

    NASM version 2.07 compiled on Jul 19 2009

    the source:

    org 100h
    start:
    mov dx,hello_world
    mov ah,09h
    int 21h
    mov al, 0
    mov ah,4Ch
    int 21h
    section .data
    hello_world: db ’hello, world’, 13, 10, ’$’
    

    Das Problem beim kompilieren

    C:\Programme\NASM>nasm HelloW.asm -f bin -o HelloW.com
    HelloW.asm:10: error: expression syntax error

    Ich bedank mich scho mal im voraus für eure Unterstützung und freu mich scho auf eure Antworten

    greetz



  • Strings gehoeren in ".



  • Hey
    erstmal vielen dank für deine Antwort^^

    Ich krieg aber leider immer noch eine Fehlermeldung 😡
    Hier mal der Geänderte source:

    org 100h
    start:
    mov dx,hello_world
    mov ah,09h
    int 21h
    mov al, 0
    mov ah,4Ch
    int 21h
    section .data
    hello_world: db "hello, world", 13, 10, ’$’
    

    selbst bei diesem Versuch klappts nicht:

    org 100h
    start:
    mov dx,"hello_world" ;obwohl eigentlich vollkommen falsch :D 
    mov ah,09h
    int 21h
    mov al, 0
    mov ah,4Ch
    int 21h
    section .data
    hello_world: db "hello, world", 13, 10, ’$’
    

    C:\Programme\NASM>nasm HelloW.asm -f bin -o HelloW.com
    HelloW.asm:10: error: expression syntax error

    Freu mich schon auf deine Antwort 😉

    glg



  • So assembliert es bei mir ohne Probleme. Wie gesagt habe ich nur alle ' durch " ersetzt:

    org 100h
    start:
    mov dx,hello_world
    mov ah,09h
    int 21h
    mov al, 0
    mov ah,4Ch
    int 21h
    section .data
    hello_world: db "hello, world", 13, 10, "$"
    

    BTW noch ein Hinweis: Du solltest es wann immer moeglich vermeiden, Subregister desselben Registers einzeln direkt nacheinander zu veraendern, wie das zB. in Zeile 6-7 passiert (al und ah bilden ax).
    Besser waere einfach mov ax, 4C00h zu schreiben.


Anmelden zum Antworten