Error a2006 undefined symbol dgroup

I am trying to assembly this code, but it returns an error. Could you please help me to fix it? Thanks. INCLUDE irvine16.inc .data array db 31h,32h,33h,34h ;use db to define array COUNT...

I am trying to assembly this code, but it returns an error. Could you please help me to fix it? Thanks.

INCLUDE irvine16.inc
.data
    array db 31h,32h,33h,34h    ;use db to define array
    COUNT = ($-array)       ;The $ operator gives the value of the location counter.
.code
main proc
    mov ax, @data       ;copy the address of the data segment  
    mov ds, ax      ;@data into the DS register
    mov bx, offset array    ;the offset operator returns the 16-bit offset of a label
    mov cx, COUNT   ;set up cx register as a counter register.  
    mov ah, 02      ;use function 2 of int 21h - display char stored in dl on screen
LP1: mov    dl, [bx]        ;LP1 is a label
    int 21h
    inc bx
    loop    LP1     ;decrement cx;  if cx not =0,loop back to label LP1.  
    mov ax, 4c00h
    int 21h
main endp
end main

rkhb's user avatar

rkhb

14k7 gold badges31 silver badges60 bronze badges

asked Nov 12, 2011 at 19:15

Waleed Ehsan's user avatar

2

DGROUP is a 16-bits concept, so the remark in pmod’s link (it is 16-bit code, DGROUP is a 16-bit concept, make sure you use the 16-bit linker) is true.

If that doesn’t resolve it, play with your memory model (.model), Dos is 16 years ago for me, but IIRC some segments only existed in some memory models.

answered Nov 18, 2011 at 8:12

Marco van de Voort's user avatar

Содержание

  1. Error a2006 undefined symbol dgroup
  2. ASM Community
  3. Error a2006 undefined symbol dgroup

Error a2006 undefined symbol dgroup

Ругается так- D:MYPROGНовая папка(2)Prg_3_1.asm(10) : error A2004: symbol conflict

Подскажите, обьясните причину.

Вот и прога от dorr не компилитя по тем же причинам.

D:MYPROGMass.asm(32) : error A2006: undefined symbol : DGROUP
D:MYPROGMass.asm(35) : error A2006: undefined symbol : DGROUP
D:MYPROGMass.asm(238) : warning A4023: with /coff switch, leading underscore required for start address : start

То- есть, строки
(32)assume ds:@data,es:@data
(35)mov ax, @data

Вот и прога от dorr не компилитя по тем же причинам.

D:MYPROGMass.asm(32) : error A2006: undefined symbol : DGROUP
D:MYPROGMass.asm(35) : error A2006: undefined symbol : DGROUP
D:MYPROGMass.asm(238) : warning A4023: with /coff switch, leading underscore required for start address : start

То- есть, строки
(32)assume ds:@data,es:@data
(35)mov ax, @data

Источник

now i’m new to ASM
now i want to run assebler with tasm.exe and tlink.exe
I dont know what different with tasm32,tlink32,masm32?
Can i use them to assembly with my homework
But the first homework that just print «Hello»
I assembler with masm32(that i installed before RadASM) then i got this message:

C:Documents and SettingsHai HoangMy Documentscecs325FIRST.asm(17) : error A2006: undefined symbol : DGROUP
C:Documents and SettingsHai HoangMy Documentscecs325FIRST.asm(27) : warning A4023: with /coff switch, leading underscore required for start address : Hello

On the 2nd try :
i got this message:
Fatal: 16 bit segments not supported in module test1.asm

Any one help me please??

This is for tasm,

hope this helps. If not, tell here.

therock cakmak posted a link for you to click 🙂

i did what u said Cakmak : all 3 step he said
should i edit anything else beside??
I tasm32.exe is fine
but when Link.exe
I got message: Make errors occurs.
Dos screen just go up and flash very quick..but i see somthing message like: «. bad argument..»

Any one can help please??

well the errors are

you use DGROUP somewhere which is probably either a structure or a constant and it has not been defined. You need to define it first so that your assembler knows what it substitutes.

apparantly when making a coff app tasm wants your entry point to be named like _ ? It’s too long since I even looked at tasm, sorry.

I get the impression that you’re mixing 16 bit code with 32 bit code.

May be it would be best if you attached your code to the messageboard so that others can have a look at it? 🙂

Here is the file.asm:

I try run in DOS
I work fine with tasm32 and tlink
but in RAdasm it got message: «Make error occur» after linking

I suggest you create a template for this project and use same project options for everyone. This is because of («) signs which radasm use while supporting long filenames.
put the «dos16.exe» in radasm directory and as in example «.rap» file, replace dos16.exe with tlink.exe in linker option.

dos16.exe only removes the quotes («) from filenames then invokes tlink.exe. Very simple util.

I assume you failed to all 🙂

1. Open the zip archive then get the dos16.exe. And put it in your RadAsm directory(c:radasm).

2. Open RadAsm and then open «Help.rap»(RAdasmProject)

3. For test, do a «Build» or «Ctrl+F5».

. if everything is ok then follow the next steps, else.

4. Open tasm.ini in notepad,
* Find this line,

Type=Win32 App,DOS App

and add replace the two line over originals.

Files=1,1,0,0,0
Folders=0,0,0
MenuMake=0,1,1,1,1,1,0,0
;x=FileToDelete/CheckExistsOnExit,
;(O)utput/(C)onsole/0,Command,
;MakeFile1[,MakeFile2[,MakeFile3. ]]
1=4,O,$Bbrcc32.exe -r -i»$I» -v,1
2=3,O,$Btasm32.EXE /I»$I»,2
3=5,C,$RDos16.exe,3
4=0,0,,5
5=
6=*.obj,O,$Btasm32.EXE /I»$I»,*.asm
11=4,O,$Bbrcc32.exe -r -i»$I» -v,1
12=3,O,$Btasm32.EXE /zi /I»$I»,2
13=5,C,$Bdos16.EXE /v /L»$L»,3
14=0,0,,5
15=
16=*.obj,O,$Btasm32.EXE /zi /I»$I»,*.asm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
from now on you will have one more option(Dos App) while creating projects 🙂

5. From project menu click on «Create Template». And when a dialog opened, !!important!! click the button, has «. » on it. Choose a file name then OK.

6. When you will create a new project do these,

* File -> New Project and enter project name, description, Choose «Dos App» radio option and dont forget to click on «. » button(this will open list has the name which you named as template) and click the template and go on to wizard(Next->).

Thats All Folks,

note: Dos16 is the program that invokes «TLink.exe» after removing quotes. This was the main problem to solve is it? So, let it rest in RadAsm directory, of course until KetilO(whose writer of this excellent RAD ide) finds a solution for this 🙂

I hope, didnt forget anything 🙂

i did exactly what u said and put «dos16.exe» in directory radasm where radasm.exe and tasm.ini are located
but when i build Help.rap
It did not go through
Tasm is fine, but when linking got message: Make error(s) occurs

So i tried to ignored this, then i create template from it, and create new project what u said..
then i run project. i got message same as above.

If running help.asm with tasm not working at all, is there any way to run it with masm..like:
ml help.asm
But when i run it, i got this message:
C:Documents and SettingsHai HoangMy Documentscecs325help.asm(10) : error A2006: undefined symbol : DGROUP
C:Documents and SettingsHai HoangMy Documentscecs325help.asm(20) : warning A4023: with /coff switch, leading underscore required for start address : Hello

here my tasm.ini : see reply

strange I have got maked the exe without error. The code which you posted here is working good. Did tested with the project which I posted? Where is DGROUP in code?

You can do this job manual as,

Tasm32 Help.asm
Tlink Help.obj

have try this. Which version do you using?

copy and paste here the DOS output, .rap file, your path(autoexec.bat), tasm.cfg, tlink.cfg

I just got error message because i run it with MASM
Now just forget it

I run ok with tasm32 and tlink in DOS window, but i want to use them in RADasm

I want to use TASM
I using verion tasm 5.0

Источник

Error a2006 undefined symbol dgroup

Welcome, Guest. Please login or register.
January 15, 2023, 01:09:20 AM

The MASM Forum Archive 2004 to 2012
Miscellaneous Forums
16 bit DOS Programming
Undefined Symbol : DGROUP
« previous next »
Pages: [1]
Author Topic: Undefined Symbol : DGROUP (Read 12167 times)
josefalarka

What’s wrong with this code, when I assembled this in MASM32 it says Undefined symbol: DGROUP.

.MODEL SMALL
.STACK 100H

.DATA
STR1 DB ‘Enter the First character : $’
STR2 DB ‘Enter the Second character : $’
STR3 DB ‘$ : is first.’

.CODE
MAIN PROC
MOV AX, @DATA ; initialize DS
MOV DS, AX

LEA DX, STR1 ; load and print STR1
MOV AH, 9
INT 21H

MOV AH, 1 ; read a character
INT 21H

MOV BL, AL ; save the input character into BL

MOV AH, 2 ; carriage return
MOV DL, 0DH
INT 21H

MOV DL, 0AH ; line feed
INT 21H

LEA DX, STR2 ; load and print STR2
MOV AH, 9
INT 21H

MOV AH, 1 ; read a character
INT 21H

MOV BH, AL ; save the input character into BH

MOV AH, 2 ; carriage return
MOV DL, 0DH
INT 21H

MOV DL, 0AH ; line feed
INT 21H

LEA DX, STR3 ; load and print STR3
MOV AH, 9
INT 21H

CMP BL, BH ; compare the BL and BH

JNBE @ELSE ; jump to label @ELSE if BL>BH

MOV DL, BL ; move first character into DL
JMP @DISPLAY ; jump to label @DISPLAY

@ELSE: ; jump label
MOV DL, BH ; move second character into DL

@DISPLAY: ; jump label
MOV AH, 2 ; print the character
INT 21H

MOV AH, 4CH ; return control to DOS
INT 21H
MAIN ENDP
END MAIN

Logged

dedndave

Member

Posts: 12523

it is 16-bit code
you need to use a 16-bit linker, rather than the 32-bit linker
you should have one in the masm32bin folder named link16.exe

it assembles ok
i do see a problem with saving the first letter in BL
i do not remember if BX is preserved across INT 21h calls or not, but better to store it or push it onto the stack

Logged

josefalarka

How to use 16-bit linker in masm32? I already have the link16.exe file. I have use this command,

c:masm32link32 compare.asm
Run File [compare.exe] compare
List File [nul.map]: compare
Libraries [.lib]: compare
Definitions File[nul.def]: compare
LINK : fatal error L1092: cannot open module-definition file — compare.def

Is there any way to modify this code in MASM32 32-bit syntax?

Logged

dedndave

Member

Posts: 12523

ok — first — i dunno where you got link32 — lol
this looks like link16 renamed as link32

for the definitions file, just hit enter, as you have no def file

Logged

josefalarka

Logged

dedndave

Member

Posts: 12523

well — in the attachment, i sent a batch file named a16.bat
place it in the masm32bin folder — you may use it to assemble 16-bit code

on the other hand, it is better that you write in 32-bit
not sure what your instructor expects
he may be disappointed if you write 32-bit code that he doesn’t understand — lol
he may also be disappointed if you use the masm32 libraries and macros to accomplish the task

Источник

Adblock
detector

vac9

1 / 1 / 1

Регистрация: 03.03.2011

Сообщений: 96

1

24.09.2012, 14:50. Показов 13243. Ответов 13

Метки нет (Все метки)


помогите откомпилировать в масм32, выдает ошибку hello.asm(7) : error A2006: undefined symbol : DGROUP

Assembler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.model small
.stack 1000h
.data
mesg db "Heloo world!"
.code
main: 
mov ax, @data
mov ds, ax
mov ah, 09
mov dx, offset mesg
int 21h
mov ah, 01
int 21h
mov ax,4c00h
int 21h
end main

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



608 / 406 / 8

Регистрация: 26.04.2012

Сообщений: 2,065

24.09.2012, 14:56

2

на тасме никаких проблем…



0



608 / 406 / 8

Регистрация: 26.04.2012

Сообщений: 2,065

24.09.2012, 15:12

4

Цитата
Сообщение от Charles Kludge
Посмотреть сообщение

И возьмите уж JWASM

это что такое???О_о



0



Клюг

7673 / 3188 / 382

Регистрация: 03.05.2011

Сообщений: 8,380

24.09.2012, 15:16

5

Это форк Watcom Asm, тоже фриварный. На сайте же всё написано.



1



1 / 1 / 1

Регистрация: 03.03.2011

Сообщений: 96

24.09.2012, 15:21

 [ТС]

6

а ошибку кто нибудь пояснит hello.asm(7) : error A2006: undefined symbol : DGROUP ?



0



Клюг

7673 / 3188 / 382

Регистрация: 03.05.2011

Сообщений: 8,380

24.09.2012, 15:31

7

Угу.
mov ax, SEG _DATA



0



1 / 1 / 1

Регистрация: 03.03.2011

Сообщений: 96

24.09.2012, 15:50

 [ТС]

8

Цитата
Сообщение от Charles Kludge
Посмотреть сообщение

Угу.
mov ax, SEG _DATA

та же самая ошибка



0



608 / 406 / 8

Регистрация: 26.04.2012

Сообщений: 2,065

24.09.2012, 17:19

9

Цитата
Сообщение от vac9
Посмотреть сообщение

та же самая ошибка

ну возьми тасм и не делай мозг людям со своей ошибкой…

Добавлено через 48 секунд
и вообще: каким масмом собираешь???



0



1 / 1 / 1

Регистрация: 03.03.2011

Сообщений: 96

24.09.2012, 17:50

 [ТС]

10

я хочу с масм разобраться, в консоли с помощью ml все нормально работает
masm32 2011 года



0



199 / 199 / 78

Регистрация: 10.07.2012

Сообщений: 409

24.09.2012, 19:25

11

назвал m7.asm
далее из папки masm32bin:
ml /c m7.asm
link16 m7.obj,m7.exe,,,,

а чтобы ещё и работало как надо, необходимо добавить $ в сообщение:
mesg db «Heloo world!$»



0



1 / 1 / 1

Регистрация: 03.03.2011

Сообщений: 96

24.09.2012, 19:33

 [ТС]

12

а если не из папки , а в редакторе ?



0



Клюг

7673 / 3188 / 382

Регистрация: 03.05.2011

Сообщений: 8,380

24.09.2012, 20:34

13

А кто сказал, что масм32 вообще обязан генерить 16-битный код? Тем паче из

оболочки дешёвой

редактора?



0



1 / 1 / 1

Регистрация: 03.03.2011

Сообщений: 96

25.09.2012, 17:25

 [ТС]

14

Цитата
Сообщение от Charles Kludge
Посмотреть сообщение

А кто сказал, что масм32 вообще обязан генерить 16-битный код? Тем паче из

оболочки дешёвой

редактора?

ну там же есть соответствующие опции



0



it does assemble using MASM, although both versions have little problems    :P

both versions use a .END directive, but do not reference the entry point
your version doesn’t initialize the DS register, nor does it terminate properly

as Jochen mentioned, this is 16-bit code and will build if you use a 16-bit linker

i have never used the .STARTUP or .EXIT directives, so i was curious to see exactly what they do
i figured the .STARTUP directive sets the DS register and .EXIT terminates with INT 21h
well, i was half-right    :P

.EXIT generates the following code, at least when the SMALL model is specified

        mov     ah,4Ch
        int     21h
it may generate something different if the TINY model is specified

the code generated by .STARTUP was a little more surprising
again, this is for a SMALL model program and it undoubtedly generates something different for other models

        mov     ax,@data
        mov     ds,ax

        mov     bx,ss
        sub     bx,ax
        shl     bx,4
        mov     ss,ax
        add     sp,bx

the first 2 lines are pretty simple
they load the data segment into AX, then into DS — very common code for 16-bit EXE’s

the rest of the code forces the SS register to reference the same segment as the DS register
a bit of a mystery for a beginner, probably
but it’s forcing the .DATA segment and .STACK segment into a single GROUP
not really sure why they do that — it isn’t necessary, in many cases

personally, i would write the program to look something like this…

;###############################################################################################

        .MODEL  SMALL
        .386

;###############################################################################################

        .DATA

X       db 3

;###############################################################################################

        .CODE

;***********************************************************************************************

_main   PROC    FAR

        mov     ax,@data
        mov     ds,ax

        MOV     AL,5
        ADD     AL,X

        mov     ah,4Ch
        int     21h

_main   ENDP

;###############################################################################################

        END     _main

i would also add a couple other directives, but that’s beyond what the teacher wants
you could replace the first 2 lines of code with .STARTUP and the last 2 with .EXIT, just to make him happy    :P

_main   PROC

        .STARTUP

        MOV     AL,5
        ADD     AL,X

        .EXIT

_main   ENDP


the program doesn’t appear to do much when you run it
but, it does return an exit code of 8 (5+X), that could be accessed in a batch file with ERRORLEVEL commands

Hi.

I am trying to compiler my first basic ASM program. I used 16 bits x86 in DOS and used MASM 7.0 (ml.exe) that comes with Visual Studio .NET. Here is the simple code.

——
.MODEL SMALL
586 ; Indicates support for Pentium chip.

.STACK 100h

.DATA
NameOut DB »My name is Kuphryn. Welcome to ASM programming!.», 13, 10, »$»

.CODE
Myname PROC
mov ax, @data
mov dx, ax
mov dx, OFFSET NameOut
mov ah, 9h
int 21h
mov al, 0
mov ah, 4ch
int 21h
Myname ENDP

END Myname
——

Here is the errors MASM outputted.

——
Assembling: myname.asm
myname.asm(21) : error A2006: undefined symbol : DGROUP
myname.asm(31) : warning A4023: with /coff switch, leading underscore required for start address : Myname
——

Does anyone know what the error message indicates?

Thanks,
Kuphryn

I don’t know MASM, but all the keyword thingies you spell with capitals are preceded by a «.» except the «END» which is at line 21.

…Was that it?

[edited by — Kurioes on September 8, 2002 12:12:47 PM]

you should move @data to ds(data segment) not dx:

mov ax, @data
mov ds, ax ; loads address of data segment

[edited by — adamxiii on September 8, 2002 2:05:32 PM]

Thanks.

masm does not like this line.

——
mov ax, @data
——

The error is this:

——
Assembling: myname.asm
myname.asm(21) : error A2006: undefined symbol : DGROUP
——

Kuphryn

for error 2, this means that for the COFF format of binary files, all function and variable names have to have a leading underscore. So where you define your MyName PROC do it like this: _MyName PROC

Also — this program won»t run as is because there is no main entry or exit point to the program. I»m guessing you want to interface it with C++ then? If so, I think you need to make MyName public so that it can be seen by the linker.

Okay. Thanks

The problem was I was using the wrong version of Masm. I was using Masm 7.0 which came with Visual Studio .NET. I downloaded Masm 6.15. Everything works.

The only line I needed to change was this line.

——
mov ds, ax
——

What is ds and why do you have to move register ax to register ds?

Kuphryn

Why not check out the x86 assembly tutorial section. You should find an article that explains the basics of all the registers and how to use them.

Я пытаюсь собрать этот код, но он возвращает ошибку. Не могли бы вы помочь мне это исправить? Спасибо.

INCLUDE irvine16.inc
.data
    array db 31h,32h,33h,34h    ;use db to define array
    COUNT = ($-array)       ;The $ operator gives the value of the location counter.
.code
main proc
    mov ax, @data       ;copy the address of the data segment  
    mov ds, ax      ;@data into the DS register
    mov bx, offset array    ;the offset operator returns the 16-bit offset of a label
    mov cx, COUNT   ;set up cx register as a counter register.  
    mov ah, 02      ;use function 2 of int 21h - display char stored in dl on screen
LP1: mov    dl, [bx]        ;LP1 is a label
    int 21h
    inc bx
    loop    LP1     ;decrement cx;  if cx not =0,loop back to label LP1.  
    mov ax, 4c00h
    int 21h
main endp
end main

1 ответы

DGROUP — это 16-битная концепция, поэтому замечание в ссылке pmod (это 16-битный код, DGROUP — это 16-битная концепция, убедитесь, что вы используете 16-битный компоновщик).

Если это не решит проблему, поиграйте со своей моделью памяти (.model), для меня Dos был создан 16 лет назад, но некоторые сегменты IIRC существовали только в некоторых моделях памяти.

Создан 18 ноя.

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

assembly
x86
masm
irvine16

or задайте свой вопрос.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error a2005 symbol redefinition
  • Error a2004 symbol type conflict
  • Error a12 warning
  • Error a1 4111 samsung c1810w
  • Error a was not declared in this scope перевод

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии