The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: anjali dhasmana on January 29, 2010, 04:35:36 AM

Title: 32 bit code in masm 6.11
Post by: anjali dhasmana on January 29, 2010, 04:35:36 AM
i am using pheonix 486 procesor and writing code in masm 6.11.
in general we can access 32bit by eax,ebx,ecx,edx registers, but masm is showing error when i am compiling my code.

also can anyone please help me that how can we switch between protected and real mode.

some one please help me
Title: Re: 32 bit code in masm 6.11
Post by: hutch-- on January 29, 2010, 09:00:34 AM
anjali,

Its a very old processor. Tell us what OS its running as that will dictate what instructions can be run.
Title: Re: 32 bit code in masm 6.11
Post by: dedndave on January 29, 2010, 10:17:57 AM
welcome to the forum anjali
is this an embedded system ?
you need a processor directive in your asm file

        .486

for example

as for switching between protected/real - use the forum search tool (and google)
that one has been covered hundreds of times   :U
Title: Re: 32 bit code in masm 6.11
Post by: anjali dhasmana on January 29, 2010, 12:45:43 PM
thanks all

yes its embedded ques.

OS is win 98, we are using PC/104. code written in masm 611 and we run it on command prompt as exe file of through masm cv command

as am a beginner so i really nead your help

plz tell me how to switch between real and protected mode
Title: Re: 32 bit code in masm 6.11
Post by: redskull on January 29, 2010, 01:00:54 PM
Quote from: anjali dhasmana on January 29, 2010, 12:45:43 PM
plz tell me how to switch between real and protected mode

If you are writing for Win98, you are already in protected mode.  If you are trying to do your own boot loader or something, then you need to be writing real-mode code, which generally doesn't use the 32-bit registers and uses different linkers and such (and perhaps the source of your errors?  In real-mode code, you need explicit changes to access the extended registers).  Also, be warned that such code won't really run right under Windows; the results are often hit-or-miss.

-r

Title: Re: 32 bit code in masm 6.11
Post by: hutch-- on January 29, 2010, 03:17:29 PM
anjali,

What we need to know is if you are trying to build 16 bit or 32 bit code. MASM 6.11 would not build 32 bit code without a specialised linker that was only available in an early NT3.5 SDK and its not what you need. Use a later version of ML to build 32 bit code.

RE: Swapping between16 and 32 bit code which is usually boot code, it cannot be safely done from within Win98, you need to boot the machine from a floppy disk with your code on the floppy disk so that you can start in real mode and switch to protected mode. There are a number of members in the forum who are experienced in this area.