WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Several problems with winasm, error A2074: cannot access label through segment registers - warning A4023: with /coff switch, leading underscore required ...

ilgiaggia
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 63232
Joined: 29-September 14


Hi, I have a problem with this code:

CODE
.MODEL SMALL
.STACK 100H

.DATA
ONE  DB 5
TWO  DB 2
THREE DB ?

.CODE
START:
MOV AL, ONE
ADD AL, TWO
MOV THREE, AL
MOV AH, 4CH
INT 21H
END START


I get this 5 errors:

CODE
C:\masm32\bin\ML /c /coff /Cp /nologo /I"C:\masm32\include" "C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.asm"

Assembling: C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.asm
C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.asm(11) : error A2074: cannot access label through segment registers
C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.asm(12) : error A2074: cannot access label through segment registers
C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.asm(13) : error A2074: cannot access label through segment registers
C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.asm(16) : warning A4023: with /coff switch, leading underscore required for start address : START

C:\masm32\bin\Link @"C:\Users\USER\Documents\WinAsm Project\HelloWorld\link.war"

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/SUBSYSTEM:CONSOLE /RELEASE /VERSION:4.0 "/LIBPATH:C:\Masm32\Lib" "C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.obj" "/OUT:C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.exe"
LINK : fatal error LNK1181: cannot open input file "C:\Users\USER\Documents\WinAsm Project\HelloWorld\helloworld.obj"

Make finished. 5 error(s) occured


Why?? Thanks!

Sponsored Links
PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2342
Member No.: 160
Joined: 22-June 04


look at existing examples first.
address in memory consists of segment base and offset.
"ONE" is offset. to access that memory byte, you should initialise segment register, in this case it is DS:
mov ax, DATA
mov ds,ax

next: look around here for how to build 16-bit project.
PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google