News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

raw error???

Started by bcddd214, November 27, 2011, 12:28:42 AM

Previous topic - Next topic

bcddd214

I am sure I am leaving out a directive. Normally I use the irvine32 libraries but I think my errors are because I am trying to leave them out and go with raw masm.
Or I am missing something else.

*************basic logic***************

Struct definition
message definition
set cursor position
askUser proc
GetInput proc
   call askUser
putchar
   call writeString
makewin proc
Main proc
   call makewin
   call putchar





***************error**************

Assembling: newDOS1.asm
newDOS1.asm(6) : error A2119: language type must be specified
newDOS1.asm(7) : error A2119: language type must be specified
newDOS1.asm(8) : error A2119: language type must be specified
newDOS1.asm(20) : error A2034: must be in segment block
newDOS1.asm(21) : error A2034: must be in segment block
newDOS1.asm(58) : error A2119: language type must be specified
newDOS1.asm(58) : error A2111: conflicting parameter definition
newDOS1.asm(67) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(69) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(70) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(72) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(73) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(75) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(88) : error A2119: language type must be specified
newDOS1.asm(147) : error A2006: undefined symbol : InName
newDOS1.asm(147) : error A2114: INVOKE argument type mismatch : argument : 3
newDOS1.asm(147) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(147) : error A2006: undefined symbol : Mes1
newDOS1.asm(147) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(148) : error A2006: undefined symbol : InName
newDOS1.asm(148) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(68) : error A2006: undefined symbol : askUser
newDOS1.asm(71) : error A2006: undefined symbol : WriteString
newDOS1.asm(74) : error A2006: undefined symbol : ReadString
newDOS1.asm(96) : error A2006: undefined symbol : WriteString
newDOS1.asm(139) : error A2006: undefined symbol : DGROUP
newDOS1.asm(150) : error A2006: undefined symbol : Crlf
newDOS1.asm(155) : warning A4023: with /coff switch, leading underscore required
for start address : main




******program**************

TITLE The New DOS

.model      small
.stack      100h

GetInput     PROTO :DWORD, :DWORD, :DWORD
StringLength PROTO :DWORD
SwapIt       PROTO :DWORD

WINDESC      STRUCT
         upperRow   BYTE   ?
         leftCol      BYTE   ?
         lowerRow   BYTE   ?
         rightCol   BYTE   ?
         foreColor   BYTE   ?
         backColor   BYTE   ?
WINDESC      ENDS


Mes1    BYTE "Enter a 5 digit string: ", 0
InName  BYTE 6 dup(0)


exit      MACRO
         mov         ax, 4C00h
         int         21h
         ENDM
         
.data
application   WINDESC      <05h, 05h, 15h, 45h, 07h, 10h>

.code

curpos      PROC
         push      bp
         mov         bp, sp
         push      ax
         push      bx
         push      dx
         
         mov         ax, 0200h
         mov         bh, 0
         mov         dx, [bp+4]
; interrupt
         int         10h
         
         pop         dx
         pop         bx
         pop         ax
         pop         bp
         ret         2
curpos      ENDP

        OPTION  PROLOGUE:None
        OPTION  EPILOGUE:None


GetInput PROC   lpszString:DWORD, lpBuffer:DWORD, uLength:DWORD

;Call With: lpszString = pointer to message string
;             lpBuffer = pointer to input buffer
;              uLength = length of input buffer
;
;  Returns: buffer is filled with user input
;           ECX, EDX are destroyed

        push    ebp
      call   askUser
        mov     ebp, esp
        mov     edx, [ebp+8]          ;lpszString
        call    WriteString
        mov     edx, [ebp+12]         ;lpBuffer
        mov     ecx, [ebp+16]         ;uLength
        call    ReadString
        pop     ebp
        ret     12                    ;return and discard 3 dwords

GetInput ENDP

        OPTION  PROLOGUE:PrologueDef
        OPTION  EPILOGUE:EpilogueDef

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

        OPTION  PROLOGUE:None
        OPTION  EPILOGUE:None

putchar      PROC      lpszString:DWORD
         push      bp
         mov         bp, sp
         push      ax
         push      bx
         push      cx
         push      dx
         
         call      WriteString
         
         pop         dx
         pop         cx
         pop         bx
         pop         ax
         pop         bp
         ret         2
putchar      ENDP

makewin      PROC
         push      bp
         mov         bp, sp
         push      ax
         push      bx
         push      cx
         push      dx
         push      si
         
         mov         si, [bp+4]
         
         mov         ax, 0600h
         mov         bh, (WINDESC PTR[si]) .backColor
         mov         ch, (WINDESC PTR[si]) .upperRow
         mov         cl, (WINDESC PTR[si]) .leftCol
         mov         dh, (WINDESC PTR[si]) .lowerRow
         mov         dl, (WINDESC PTR[si]) .rightCol
;interrupt
         int         10h
         
         push      cx
         call      curpos
         
         pop         si
         pop         dx
         pop         cx
         pop         bx
         pop         ax
         pop         bp
         ret         2
makewin      ENDP

main      PROC
         mov         ax, @data
         mov         ds, ax
         
         mov         ax, OFFSET application
         
         push      ax
         call      makewin
         call      putchar
         INVOKE  GetInput, offset Mes1, offset InName, sizeof InName
         INVOKE  SwapIt, offset InName
;         call    WriteString
         call    Crlf         
         
         exit
main      ENDP

         end         main


qWord

- you are not specifying a default calling convention -> .model small, stdcall / c. Otherwise you must specify the calling convention when declaring the prototype and/or the procedure (PROC)
- masm requiring to specify a instruction set. The following lines should be enough:
.686p
.mmx
.xmm
FPU in a trice: SmplMath
It's that simple!

bcddd214

a little bit better!

C:\Users\Brad\DOCUME~1\ASSEMB~1\ASM-PR~1>make16 newDOS1
Assembling: newDOS1.asm
newDOS1.asm(9) : error A2119: language type must be specified
newDOS1.asm(10) : error A2119: language type must be specified
newDOS1.asm(11) : error A2119: language type must be specified
newDOS1.asm(23) : error A2034: must be in segment block
newDOS1.asm(24) : error A2034: must be in segment block
newDOS1.asm(61) : error A2119: language type must be specified
newDOS1.asm(61) : error A2111: conflicting parameter definition
newDOS1.asm(91) : error A2119: language type must be specified
newDOS1.asm(150) : error A2006: undefined symbol : InName
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 3
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(150) : error A2006: undefined symbol : Mes1
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(151) : error A2006: undefined symbol : InName
newDOS1.asm(151) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(71) : error A2006: undefined symbol : askUser
newDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
newDOS1.asm(153) : error A2006: undefined symbol : Crlf
Press any key to continue . . .

qWord

FPU in a trice: SmplMath
It's that simple!

bcddd214

I am stuck on these errors...
I know the readstring and writestring error are from me 'not' calling on the Irvine32 libraries. I am trying not to use them. How do I read and write without them?

********************errors*****************
Assembling: newDOS1.asm
newDOS1.asm(9) : error A2119: language type must be specified
newDOS1.asm(10) : error A2119: language type must be specified
newDOS1.asm(11) : error A2119: language type must be specified
newDOS1.asm(61) : error A2119: language type must be specified
newDOS1.asm(61) : error A2111: conflicting parameter definition
newDOS1.asm(91) : error A2119: language type must be specified
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(151) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
newDOS1.asm(142) : error A2006: undefined symbol : DGROUP
newDOS1.asm(153) : error A2006: undefined symbol : Crlf
newDOS1.asm(158) : warning A4023: with /coff switch, leading underscore required
for start address : main



**************program*****************






TITLE The New DOS

.model      small
.stack      100h
.686p
.mmx
.xmm

GetInput     PROTO :DWORD, :DWORD, :DWORD
SwapIt       PROTO :DWORD
askUser      PROTO :DWORD, :DWORD, :DWORD

WINDESC      STRUCT
         upperRow   BYTE   ?
         leftCol      BYTE   ?
         lowerRow   BYTE   ?
         rightCol   BYTE   ?
         foreColor   BYTE   ?
         backColor   BYTE   ?
WINDESC      ENDS


exit      MACRO
         mov         ax, 4C00h
         int         21h
         ENDM
         
.data
Mes1    BYTE "Enter a 5 digit string: ", 0
InName  BYTE 6 dup(0)

application   WINDESC      <05h, 05h, 15h, 45h, 07h, 10h>

.code


curpos      PROC
         push      bp
         mov         bp, sp
         push      ax
         push      bx
         push      dx
         
         mov         ax, 0200h
         mov         bh, 0
         mov         dx, [bp+4]
; interrupt
         int         10h
         
         pop         dx
         pop         bx
         pop         ax
         pop         bp
         ret         2
curpos      ENDP

        OPTION  PROLOGUE:None
        OPTION  EPILOGUE:None


GetInput PROC   lpszString:DWORD, lpBuffer:DWORD, uLength:DWORD

;Call With: lpszString = pointer to message string
;             lpBuffer = pointer to input buffer
;              uLength = length of input buffer
;
;  Returns: buffer is filled with user input
;           ECX, EDX are destroyed

        push    ebp
      call   askUser
        mov     ebp, esp
        mov     edx, [ebp+8]          ;lpszString
        call    WriteString
        mov     edx, [ebp+12]         ;lpBuffer
        mov     ecx, [ebp+16]         ;uLength
        call    ReadString
        pop     ebp
        ret     12                    ;return and discard 3 dwords

GetInput ENDP

        OPTION  PROLOGUE:PrologueDef
        OPTION  EPILOGUE:EpilogueDef

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

        OPTION  PROLOGUE:None
        OPTION  EPILOGUE:None

putchar      PROC      lpszString:DWORD
         push      bp
         mov         bp, sp
         push      ax
         push      bx
         push      cx
         push      dx
         
         call      WriteString
         
         pop         dx
         pop         cx
         pop         bx
         pop         ax
         pop         bp
         ret         2
putchar      ENDP

makewin      PROC
         push      bp
         mov         bp, sp
         push      ax
         push      bx
         push      cx
         push      dx
         push      si
         
         mov         si, [bp+4]
         
         mov         ax, 0600h
         mov         bh, (WINDESC PTR[si]) .backColor
         mov         ch, (WINDESC PTR[si]) .upperRow
         mov         cl, (WINDESC PTR[si]) .leftCol
         mov         dh, (WINDESC PTR[si]) .lowerRow
         mov         dl, (WINDESC PTR[si]) .rightCol
;interrupt
         int         10h
         
         push      cx
         call      curpos
         
         pop         si
         pop         dx
         pop         cx
         pop         bx
         pop         ax
         pop         bp
         ret         2
makewin      ENDP

main      PROC
         mov         ax, @data
         mov         ds, ax
         
         mov         ax, OFFSET application
         
         push      ax
         call      makewin
         call      putchar
         INVOKE  GetInput, offset Mes1, offset InName, sizeof InName
         INVOKE  SwapIt, offset InName
;         call    WriteString
         call    Crlf         
         
         exit
main      ENDP

         end         main

Gunner

as pointed out before: RTFM
QuotenewDOS1.asm(9) : error A2119: language type must be specified

this will fix that: .model      small,STDCALL


these:
QuotenewDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString

are Irvine library functions, if you don't want to use Irvine, then write your own  :bg  to get rid of them, include irvine OR just open irvine32.asm and see what code he uses and modify to suit your needs?
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

Gunner

Also, how are you assembling and linking?  if you are going to use @DATA you need to assemble and link as a DOS app not a console app
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

bcddd214

#7


You can be helpful without being rude.

Quote from: Gunner on November 27, 2011, 02:08:33 AM
as pointed out before: RTFM
QuotenewDOS1.asm(9) : error A2119: language type must be specified

this will fix that: .model      small,STDCALL


these:
QuotenewDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString

are Irvine library functions, if you don't want to use Irvine, then write your own  :bg  to get rid of them, include irvine OR just open irvine32.asm and see what code he uses and modify to suit your needs?

bcddd214

secondly, I already stated I was dropping Irvine and a little confuzed about the errors from dropping the usage of the libraries.
You wanna point out where the MIGRATE from IRVINE manual is???

Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I already read irvine for crying out loud. so take your RTFM and shove it somewhere. That is the RUDEST statement one can make when you are trying to weed through little bullsh!t item.
So, I should read ANOTHER 400 pages just because Irvine didn't point out STDCALL
My word, you must be the moron...
Rude, rude RUDE you are!

You can be helpful without being rude.

Quote from: Gunner on November 27, 2011, 02:08:33 AM
as pointed out before: RTFM
QuotenewDOS1.asm(9) : error A2119: language type must be specified

this will fix that: .model      small,STDCALL


these:
QuotenewDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString

are Irvine library functions, if you don't want to use Irvine, then write your own  :bg  to get rid of them, include irvine OR just open irvine32.asm and see what code he uses and modify to suit your needs?

Gunner

Has nothing to do with Irvine, that is just a book and a library that uses MASM.  I didn't need the book but I bought it to help folks with the many problems that you have.  It assumes you have MASM installed via Visual Studio.  Well, you can get samples, a humongous library to do just about everything, manuals, MASM and other various files from this forum up in the top right http://masm32.com/masmdl.htm, since you said you are trying to get away from Irvine, take a look at MASM32
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

mineiro

bcddd214, are you trying to create a code to ms-dos?

jj2007

Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I already read irvine for crying out loud. so take your RTFM and shove it somewhere.

OK, it seems you are getting desperate. Since I get the impression that you seriously want to learn assembler, I will give you some essential reading.

1. See my signature. The tips and tricks contain essential steps to set up your proper non-Irvine environment
2. Download the guide from http://www.masm32.com/board/index.php?topic=5433.0

That is more than enough for the time being. Consider using MasmBasic, it has an extremely powerful macro called deb that allows you to see the contents of variables and registers. Example:

Quoteinclude \masm32\MasmBasic\MasmBasic.inc
.data
MyReal4   REAL4 123.456
MyReal8   REAL8 987.654
MyQword   QWORD 123456789012345678
   Init
   mov eax, 12345
   movlps xmm0, MyReal8
   movlps xmm1, MyQword
   deb 4, "Somewhere in a loop:", eax, MyReal4, MyReal8, f:xmm0, MyQword, xmm1
   Inkey Str$("\nYour puter has run %3f hours since the last boot, give it a break!", Timer/3600000)
   Exit
end start

Output:
Somewhere in a loop:
eax             12345
MyReal4         123.4560
MyReal8         987.6540000000000
f:xmm0          987.6540000000000
MyQword         123456789012345678
xmm1            123456789012345678

Your puter has run 36.6 hours since the last boot, give it a break

This helps to understand how your code works, and is fully compatible with the Masm32 package. However, if you are stuck because your code crashes violently, OllyDbg is the tool to use - more complicated than deb but you can really see what's going on.

:thumbu

bcddd214

I apologize for being jest but RTFD isn't very nice sir.

Quote from: Gunner on November 27, 2011, 02:44:16 AM
Has nothing to do with Irvine, that is just a book and a library that uses MASM.  I didn't need the book but I bought it to help folks with the many problems that you have.  It assumes you have MASM installed via Visual Studio.  Well, you can get samples, a humongous library to do just about everything, manuals, MASM and other various files from this forum up in the top right http://masm32.com/masmdl.htm, since you said you are trying to get away from Irvine, take a look at MASM32

bcddd214

On it, let me get up too par...
RTFDing it AGAIN...
:)
Quote from: jj2007 on November 27, 2011, 07:34:11 AM
Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I already read irvine for crying out loud. so take your RTFM and shove it somewhere.

OK, it seems you are getting desperate. Since I get the impression that you seriously want to learn assembler, I will give you some essential reading.

1. See my signature. The tips and tricks contain essential steps to set up your proper non-Irvine environment
2. Download the guide from http://www.masm32.com/board/index.php?topic=5433.0

That is more than enough for the time being. Consider using MasmBasic, it has an extremely powerful macro called deb that allows you to see the contents of variables and registers. Example:

Quoteinclude \masm32\MasmBasic\MasmBasic.inc
.data
MyReal4   REAL4 123.456
MyReal8   REAL8 987.654
MyQword   QWORD 123456789012345678
   Init
   mov eax, 12345
   movlps xmm0, MyReal8
   movlps xmm1, MyQword
   deb 4, "Somewhere in a loop:", eax, MyReal4, MyReal8, f:xmm0, MyQword, xmm1
   Inkey Str$("\nYour puter has run %3f hours since the last boot, give it a break!", Timer/3600000)
   Exit
end start

Output:
Somewhere in a loop:
eax             12345
MyReal4         123.4560
MyReal8         987.6540000000000
f:xmm0          987.6540000000000
MyQword         123456789012345678
xmm1            123456789012345678

Your puter has run 36.6 hours since the last boot, give it a break

This helps to understand how your code works, and is fully compatible with the Masm32 package. However, if you are stuck because your code crashes violently, OllyDbg is the tool to use - more complicated than deb but you can really see what's going on.

:thumbu

bcddd214

Quote from: jj2007 on November 27, 2011, 07:34:11 AM
Quote from: bcddd214 on November 27, 2011, 02:39:11 AM


I have trouble compiling my first hello world program using the software on that website you sent me too. So I haven't been able to read a lot of the help file (I will go looking manually and a moment) but on that website is very clearly states not to use esp or ebp where as the colleague that is acting as a mentor on the side has me neck deep inside of ebp and esp not because its the right thing to do but to show me how they work.
I saw the RED highlight next to it and I know your are scratching your head as to why this guy insist.
There is a WHOLE bunch of empty space esp leaves behind and ebp is your backdoor. Not for conventional programing I know this.
Also there is no need to refer me to the masmbasic. For this instructional I am pure masm and don't what additional libraries I could accidentally use either my friends so if I appear to be pulling in a direction it for a reason. please work with me and save the rtfd.