Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.lang.asm > #6660

Re: Little Big Mode

From "wolfgang kern" <nowhere@never.at>
Newsgroups alt.lang.asm, alt.os.assembly, alt.os.development
Subject Re: Little Big Mode
Date 2016-06-14 09:45 +0200
Organization KESYS-development
Message-ID <njocm8$1u8n$1@gioia.aioe.org> (permalink)
References <nj3hgq$1nvk$1@gioia.aioe.org> <nj436b$gmj$1@dont-email.me>

Cross-posted to 3 groups.

Show all headers | View raw


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 

Back to alt.lang.asm | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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