Assembly 为什么我不能编译?如果错误级别1转到停止;链接/公司

Assembly 为什么我不能编译?如果错误级别1转到停止;链接/公司,assembly,masm,Assembly,Masm,我花了整整一个晚上试图找出编译器先生给我的错误 上面说 0 Warning Errors 0 Severe Errors ...if errorlevel 1 goto stop ...link /co asciihexNew,,,console; 我一直在寻找答案,但是网上没有很多关于MASM的资料。 这是我的密码 page 55,80 .model small .stack 100h .data msg1 db 0DH,0AH, "Enter the any key",0DH

我花了整整一个晚上试图找出编译器先生给我的错误

上面说

0 Warning Errors
0 Severe Errors

...if errorlevel 1 goto stop

...link /co asciihexNew,,,console;
我一直在寻找答案,但是网上没有很多关于MASM的资料。 这是我的密码

page  55,80

.model small
.stack 100h

.data

msg1 db  0DH,0AH, "Enter the any key",0DH,0AH,"$" ; this is a alphanumeric variable
num db 0   ; this is a numeric variable

.code

main proc
    mov   ax,@data       ; set up data segment
    mov   ds,ax
mainloop:
    MOV NUM, 0  
    mov   dx,offset msg1 ; dx gets the location of the variable msg1
    call string_display     ; calls string_display procedure
    call keyin          ;calls keyin procedure

    mov num, al ; saving the first number
    MOV BL, 8

    MOV DL, 3DH  ; DISPLAY THE = SIGN, it has value 3D in hexadecimal , according to ASCII table
    CALL DISPLAY    ; calls procedure DISPLAY

loop1:
     RCL num, 1     ; Rotate Left with Carry Flag by 1 bit
         JNC DISPLAY0         
          MOV DL, 31H
     call display
     DEC BL
     JZ Hex_disp
    JMP LOOP1
DISPLAY0:

         MOV DL, 30H
    call display    
    DEC BL
     JZ Hex_disp
    JMP LOOP1

Hex_disp:
    RCL NUM, 1
    MOV DL, 3DH
    call display    
    MOV BL, NUM
    SHR BL,1
    SHR BL,1
    SHR BL,1
    SHR BL,1

    AND BL,0FH
    MOV DL, BL
    ADD DL, 30H
    call display    
    MOV BL, NUM
    AND BL, 0FH
    MOV DL, BL
    ADD DL, 30H
    CMP DL, 3AH
        JNS ABC
    call display    
    mov dl, 68h
    call display
    JMP MAINLOOP
ABC:
    ADD DL, 7; (dISPLAY HEX CHR)
        CALL DISPLAY    
    mov dl, 68h ; DISPLAY H
    call display
    JMP MAINLOOP
    mov   ax,4C00h       ; return to DOS and terminate the program
     int   21h


display proc ; display of a single character
    mov ah, 6
    int 21h
    ret
    display endp

keyin proc
    mov ah, 1 ; getting a key from the keyboard 
    int 21h 
    ret
keyin endp

string_display proc
    mov   ah,9           ; send message string to the screen
            int   21h 
    ret
string_display endp


main endp
end  main

如果你知道如何修复它,请写一篇帖子!谢谢大家!

您的代码可以正常工作(经过测试)。你是从控制台启动的吗?您是否最终混淆了16位和32位MASM?请至少显示您首先发布的输出批处理文件(
.bat
.cmd
)的源。对于使用MASM的16位可执行文件,我们需要一个16位链接器。[链接]。该文件包括用于生成16位DOS应用程序的链接器版本5.60。我将链接器更改为Dirk Wolfgang Glomp推荐的。但是,我开始在错误:致命错误1093:未找到对象文件中获得额外的行,因此我带回了原始链接器。它仍然给我相同的原始错误,但这次至少输出了有效的文件。这真的很奇怪,但至少它能工作。在它没有创建任何文件之前。似乎问题在于文件名和长度。它是9个字符,当我把它改为6个字符时,它就吐出了编译过的文件。谢谢你的反馈,祝你度过愉快的一天。听起来线程可以关闭,问题解决了。