flat assembler
Message board for the users of flat assembler.

Index > Main > a20 line/bit

Author
Thread Post new topic Reply to topic
StarKnightD



Joined: 04 Jul 2007
Posts: 38
StarKnightD
I'd like to code a detection routine into my boot program so that the a20 line is enabled if necessary, however, since my bios does it automatically I have no way of checking it.

to get to the point, does anyone know (and could tell me) which bit people are referring to by A20? i.e., with or without zero-based addressing: bit 0, bit 1, ... , bit 19 = A20? for instance:
Code:
mov eax, [1 shl 19]
mov eax, [1 shl 20]
mov eax, [0]    

when the A20 line is disabled, two of these lines should give the same result.

Thanks.
Post 13 Nov 2008, 22:13
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr


Last edited by windwakr on 13 Nov 2008, 22:51; edited 2 times in total
Post 13 Nov 2008, 22:42
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu
mov eax,[1 shl 20] is the correct answer.

In electronics the address buss does start from A0, A1, A2 ... A19, A20, A21 ... A31 for 32 bits.

IF you would have done a simple calculation THEN you would have noticed that (1 shl 20) is in fact exactly 1 Mega byte.
Post 13 Nov 2008, 22:49
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
bogdanontanu,

Not exactly, to be compliant to SI… Wink
Post 13 Nov 2008, 23:19
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu
Yes, I know but I am not compliant to the SI in terms of binary data units, for me 1 Mega byte is 2^20 (aka 1024Kilo bytes, aka 1024*1024 bytes) and not 10^6.

The reason for this is exactly the physical address buses that go in powers of 2 and not in powers of 10.

Please excuse Wink
Post 14 Nov 2008, 04:08
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
StarKnightD wrote:
my bios does it automatically I have no way of checking it.


Wrong. BIOS does what ? No "work" is needed to get A20 working if it is not crippled in the hardware.

Quote:
to get to the point, does anyone know (and could tell me) which bit people are referring to by A20? i.e., with or without zero-based addressing: bit 0, bit 1, ... , bit 19 = A20? for instance:


Bit 20 of course ... physical address 1 MiB or $0010'0000 Smile

Quote:
when the A20 line is disabled, two of these lines should give the same result.


As when line is enabled ... Sad

The safe way is to CLI, peek value from address 0, save it, INC it, write it to address $0010'0000, recheck address 0, draw the conclusion, and restore original value in address 0, STI.

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 21 Nov 2008, 02:24
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.