Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MASM Problem!!

461 views
Skip to first unread message

kicke...@audiophile.com

unread,
Aug 24, 1998, 3:00:00 AM8/24/98
to
hi, i m a starter in assembly and i use MASM to assemble my program. i have
face the following error:

1. even though i have define a stack using :

STSEG SEGMENT
DB 64 DUP (?)
STSEG ENDS
:
:
COD SEGMENT
MAIN PROC FAR
ASSUME ..... SS:STSEG

when i assemble the file, it says "warning L4021: no stack segment", why this
happens?


2. i want to execute a command like this:

MOV EAX,DOUBLEWORD

it gives me error "...operation is not availabe for current CPU mode.." when
i give a ".386" directive, it compiles perfectly but i hangs when i run the
program.


can anybody help me to solve these problems? your help is very much
appreciated. pls reply via email to choo...@yahoo.com

thanks.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

wbinvd

unread,
Aug 24, 1998, 3:00:00 AM8/24/98
to
kicke...@audiophile.com wrote in message <6rs7mf$a80$1...@winter.news.erols.com>...

|hi, i m a starter in assembly and i use MASM to assemble my program. i have
|face the following error:
|
|1. even though i have define a stack using :
|
|STSEG SEGMENT
| DB 64 DUP (?)
|STSEG ENDS

You must use the "stack" keyword, like:
STSEG SEGMENT STACK


|:
|:
|COD SEGMENT
|MAIN PROC FAR
| ASSUME ..... SS:STSEG
|
|when i assemble the file, it says "warning L4021: no stack segment", why this
|happens?
|
|
|2. i want to execute a command like this:
|
|MOV EAX,DOUBLEWORD
|
|it gives me error "...operation is not availabe for current CPU mode.." when
|i give a ".386" directive, it compiles perfectly but i hangs when i run the
|program.

If you enable 386+ instructions and you create a segment without
specifying its default operand size, MASM will use 32-bits.
Use "use16" for all segments, like:

CODESEG SEGMENT USE16

It crashes since MASM generates 32-bit code, not 16-bit code.
And your program is run in 16-bit mode, not 32-bit mode.


Tor M Halvorsen

unread,
Aug 25, 1998, 3:00:00 AM8/25/98
to

>
>1. even though i have define a stack using :
>
>STSEG SEGMENT
> DB 64 DUP (?)
>STSEG ENDS
>:


STSEG SEGMENT STACK
db 64 DUP (?) ; it should at least be 512 bytes
STSEG ENDS

DATA SEGMENT
....
DATA ENDS

CODE SEGMENT
ASSUME cs:CODE, ds:DATA
start: ; you may name it whatever
you want
....
CODE ENDS
END start


>when i assemble the file, it says "warning L4021: no stack segment", why
this
>happens?

because you have not declared any segment as stack segment (It's an idea to
read the user manual)


>2. i want to execute a command like this:
>
>MOV EAX,DOUBLEWORD
>
>it gives me error "...operation is not availabe for current CPU mode.."
when
>i give a ".386" directive, it compiles perfectly but i hangs when i run the
>program.

hmm...is there any exit to dos function in there?


Tor M

G. Adam Stanislav

unread,
Oct 8, 1998, 3:00:00 AM10/8/98
to
On 24 Aug 1998 17:25:35 GMT, kicke...@audiophile.com wrote:

>1. even though i have define a stack using :
>
>STSEG SEGMENT
> DB 64 DUP (?)
>STSEG ENDS

Well, you have a segment but not a stack segment there. Change the
first line to:

STSEG SEGMENT 'STACK'

Adam

0 new messages