News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

segmented registers es: bx

Started by ninjarider, September 02, 2005, 05:58:33 PM

Previous topic - Next topic

ninjarider

es = fah
bx = 0fh

es: bx = ?????
im not sure if im correct but, wouldn't it be 0fafh

PBrennick

ninjarider

es:bx is a pointer to a memory address in segment 00fah at offset ofh, and not a pointer to segment 0fa00h at offset 0fh which it looks like you are trying to say, it is 0fa:0fh

hth,
Paul
The GeneSys Project is available from:
The Repository or My crappy website

MichaelW

ninjarider,

For real mode the corresponding physical address would be 0FAFh, but it would be somewhat unusual for a real-mode DOS program to use an address in this range because it would fall somewhere in the memory occupied by the OS. For protected mode the segment registers contain selectors rather than segment addresses, and selector values cannot be used directly in physical address calculations.

eschew obfuscation

PBrennick

Michael,
I do not think you are correct.  That breaks down to 0f and af which is not what is contained in the registers.  It should be 0faofh.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

P1

segment is understand as fa = fa00, so es:bx translate to fa0f in this case.

This is from the 8088, 16 pages of 65536 bytes of addressable memory.

I must be getting old.   :(

Regards,  P1  :8)

PBrennick

P1,
Thank you for confirming that.  I was petty sure that was correct.

I guess we are all getting old.  :bdg

Paul
The GeneSys Project is available from:
The Repository or My crappy website

tenkey

You're getting old. Michael is correct. Start of segment 00FA is physical address 00FA0 (20-bits!)

So 00FA:000F = 00FAF.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

PBrennick

Since there is more than one Michael here and they are making dissimilar claims, saying Michael is right is pretty funny.  :lol

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Gustav


> P1,
> Thank you for confirming that.  I was petty sure that was correct.

You both were wrong. Possibly you should consider to make some real-mode code again, just for fun :).
I'm pretty sure you will learn a lot.



tenkey

Quote from: PBrennick on September 03, 2005, 07:36:05 AMSince there is more than one Michael here and they are making dissimilar claims, saying Michael is right is pretty funny.  :lol
What's odd about the remark is that I see only one Michael, MichaelW, being addressed as Michael in this thread. Did the other one opt out? Or is the other Michael, P1?

This thread should be in the 16-bit DOS forum.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

ninjarider

thnx. i was reading the intel architecture and it didn't have anything about how to calculate the actual physical address.

P1

I was wrong.

I confused the A000:0000 style of the 20 bit address.  So I shifted wrong in my head.

My apologies to those who were correct.

From:http://www.cpu-world.com/Arch/8088.html
Physical memory address pointed by segment:offset pair is calculated as:
address = (<segment> * 16) + <offset>

Regards,  P1  :8)