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
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.
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
>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