Assembler Problem

一曲冷凌霜 提交于 2019-12-11 07:31:19

问题


I have MASM assembler to "compile" 16 bit programs. When I tried to "compile" my sample, the MASM throw me some errors:

error A2004: symbol type conflict
 warning A4023: with /coff switch, leading underscore required for start address : START

my code is:

STA SEGMENT STACK
    DB 100H DUP(0)
STA ENDS

    CODE SEGMENT
        ASSUME CS:CODE, DS:CODE,SS:STA
    START:MOV AX,CODE
           MOV DS, AX
           MOV DX, OFFSET BOKER
           MOV AH, 8
           INT 21H
           MOV AX, 4C00H
           INT 21H
           BOKER DB 'Hello world!$'

    CODE ENDS
    END START

Please help! Thanks.


回答1:


The error literally says what's wrong... warning A4023: with /coff switch, leading underscore required for start address : START

So change START:MOV AX,CODE to _START:MOV AX,CODE

And A2004 Problem With MASM32 here you can find a fix for the A2004 error




回答2:


STA SEGMENT STACK
    DB 100H DUP(0)
STA ENDS

CODE SEGMENT
ASSUME CS:CODE, DS:CODE,SS:STA

_START:
    MOV  AX,CODE
    MOV  DS, AX
    MOV  DX, OFFSET BOKER
    MOV  AH, 8
    INT  21H
    MOV  AX, 4C00H
    INT  21H
    BOKER DB 'Hello world!$'

CODE ENDS
END _START


来源:https://stackoverflow.com/questions/6570140/assembler-problem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!