Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Cecil Bayona <cbayona@cbayona.com> |
|---|---|
| Newsgroups | alt.lang.asm, alt.os.assembly, alt.os.development |
| Subject | Re: Little Big Mode |
| Date | 2016-06-14 10:08 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <njp6lr$h75$1@dont-email.me> (permalink) |
| References | <nj3hgq$1nvk$1@gioia.aioe.org> <nj436b$gmj$1@dont-email.me> <njocm8$1u8n$1@gioia.aioe.org> |
Cross-posted to 3 groups.
On 6/14/2016 2:45 AM, wolfgang kern wrote: > > Cecil Bayona wrote: > ... >> Let me start by saying that I know zip about Intel Assembler code on >> modern CPUs (used to work with the I8085 CPU eons ago) but I'm >> interested in the subject. > >> I will soon need to write a preamble to a compilers output to set >> things right for the code to follow which is in Protected mode code. >> Eventually I will be looking for a snippet of code to setup the CPU in >> Protected Mode, setup a stack and then proceed to run the compiler code. > >> At this point I know nothing on the subject and I don't even know if >> other than setting up the Stack Pointer is needed in a Windows >> program, later today I will be looking for books so I can learn about >> the subject of Intel Real/Protected mode assembly language. > >> I read through the post and the responses and it seems that in >> accessing 1 MB in Real Mode the behavior is not consistent on every >> CPU, so my question will display my less than newbie status. Are there >> instructions or registers in the CPU/MMU that can be used to make sure >> all machines work by setting the segment length to be 1 MB in Real Mode? > > After checking I can say that all (386+) Intel/AMD CPUs work identical > in TrueRealMode, that mean segments are limited to 64Kb (aka 16bit). > There aren't single instructions to override this limits, but we got the > well known trick to have Unreal Mode: > > 1. check if A20 is ON (only 1 MB available if OFF) 2. enter PM32 and set > segment limits, ie: base 0 and full 4GB range. > 3. switch to PM16 (just far jump) for a 16-bit code-segment limit *). > 4. go back to RM without restoring the data segment limits. > > in this mode all memory up to 4GB is accessible by 32-bit addressing. > > *) to add to the confusion there is also BIG real 32-bit code-segment > possible, but I wont recommend to use it. > >> It seems that there should be as there is a discussion on maybe the >> Bios leaving the segment length to 1 MB in some cases. > > No, I wont blame the BIOS, it seems to come from bootloaders, emulators > and tools (like in my case). >> By the way are there any books recommended for a newbie to learn about >> Intel Assembly language and Windows/Linux programming? > > I haven't seen books which talk about modern CPUs ... > You might find ASM-tutorials in FASM and NASM foren. Both Intel and AMD > support us with pdf-books about all available instructions for free. > __ > wolfgang So what would be the advantage in Unreal Mode over using Protected Mode? Does it save code space compared to Protected Mode? One advantage I can see is that you can still access the Bios calls without going through an act of congress, while accessing a lot more memory, so it benefits small to medium size programs, I'm inferring this but not 100% sure. I have purchased several books on x86 Assembly language and most of these books barely mention Windows Protected Mode programming, one does in one chapter out of 24 chapters. It basically mentions that I don't have to do much of anything, Windows sets things up, and all I have to do is setup the assembler to use the .586 instructions set, use the Flat model, and use the Windows DLLs to do the interaction to the OS, no mention of access to the Bios. I will keep searching, but some of the other books I have coming deal specifically with Windows and Win32 programs, one is about Windows/Linux Protected Mode assembler usage. Is this the right forum? or should I use the c.l.a.x86 instead, I see a lot of subjects there, this one is empty. -- Cecil - k5nwa
Back to alt.lang.asm | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Little Big Mode "Mike Gonta" <mikegonta@gmail.com> - 2016-06-06 05:58 -0400
Re: Little Big Mode Cecil Bayona <cbayona@cbayona.com> - 2016-06-06 10:00 -0500
Re: Little Big Mode "wolfgang kern" <nowhere@never.at> - 2016-06-14 09:45 +0200
Re: Little Big Mode Cecil Bayona <cbayona@cbayona.com> - 2016-06-14 10:08 -0500
Re: Little Big Mode "wolfgang kern" <nowhere@never.at> - 2016-06-14 21:18 +0200
Re: Little Big Mode Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-06-14 17:14 -0400
Re: Little Big Mode "wolfgang kern" <nowhere@never.at> - 2016-06-15 10:00 +0200
Re: Little Big Mode JJ <jj4public@vfemail.net> - 2016-06-07 13:21 +0700
Re: Little Big Mode CN <qmbmnp3799@pacbell.net> - 2016-06-15 03:08 -0700
csiph-web