开发者

Assembler Problem

开发者 https://www.devze.com 2023-03-16 22:48 出处:网络
I have MASM assembler to \"compile\" 16 bit programs. When I tried to \"compile\" my sample, the MASM throw me some errors:

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.


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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号