flat assembler
Message board for the users of flat assembler.

Index > Heap > 28-bit segment registers possible?

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 311
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
what would be if segment registers were instead of 16-bit 28-bit? addressing would be possible entire 4 GB of the memory in the real mode. there is a difference after all between "mov ax,cs" and "mov eax,cs".
switching over between the existing mode and extended will be missing.
what are you thinking about it?

_________________
smaller is better
Post 12 Sep 2016, 16:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
You need to convince Intel, AMD, etc. if you really want this.

But, IMO, segment registers are a terrible idea anyway, and extending them is just making a bad thing even worse.
Post 12 Sep 2016, 17:13
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
CandyMan wrote:
... entire 4 GB of the memory ...
Many systems have more than 4GB. Perhaps you want to extend the segment registers to 64-bit instead? Then you can cover up to 256EB of address space. Should be enough for anyone. It could be implemented with something like:
Code:
mov rdsl,eax ;lower 32-bits of RDS (64-bit extended DS register)
mov rdsh,edx ;upper 32-bits of RDS    
It still doesn't fix the awfulness of segments registers, but at least it could provide a path forward for the remaining three people in the world that still use DOS. Razz
Post 13 Sep 2016, 08:21
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
I think they already considered this (e.g. 24-bit). But since the IBM PC initially only came with 64 kb (and there would be RAM shortages for many years, which was too expensive even when available), it wasn't worth it to them. Besides, it would actually waste more RAM (I think?) because of extra initial segment alignment. So wasting more than needed when none is on the horizon would be a bad idea. (The 286 [1982??] didn't come long after the original IBM PC, and look how many years it took for that to be well-supported! When was OS/2 1.0, 1987??)

But there were some (non-Intel brand) embedded 186s that did indeed extend support to 24-bits.

Minix 2 (32-bit) used segmentation, but they eventually removed that with later versions of Minix 3.

BTW, haven't I linked to this several times before?

How retiring segmentation in AMD64 long mode broke VMware
Post 13 Sep 2016, 22:33
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> Perhaps you want to extend the segment registers to 64-bit instead?

NO. I want this:

Code:
    xchg fs,gs    


> How retiring segmentation in AMD64 long mode broke VMware

Virtualization sucks even more than bad old segmentation.
Post 23 Sep 2016, 18:33
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
DOS386 wrote:
> Perhaps you want to extend the segment registers to 64-bit instead?

NO.
But then we keep falling into the same trap again in a few years time. Make something only just big enough for now, and then in a few years time complain that we are being limited yet again. Forward thinking FTW. Smile
Post 23 Sep 2016, 18:39
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
FTW <> WTF ??

> segment registers are a terrible idea anyway

There is only one thing more horrible than segment registers: mixing segmentation and paging.

> Make something only just big enough for now

I have not yet heard about problems addressing more than 16 EiO memory Very Happy
Post 23 Sep 2016, 18:57
View user's profile Send private message Reply with quote
Grom PE



Joined: 13 Mar 2008
Posts: 114
Location: i@grompe.org.ru
Grom PE
Segmented model is really good at obfuscation. Every time I try to debug or reverse engineer 16-bit DOS/Windows 3.11 programs, I get lost =(
Post 23 Sep 2016, 19:01
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
DOS386 wrote:
FTW <> WTF ??
FTW: look it up.
DOS386 wrote:
I have not yet heard about problems addressing more than 16 EiO memory Very Happy
You said NO to 64-bit segments registers, suggesting you prefer the original 28-bit size? Why limit yourself to 4GB only!


Last edited by revolution on 23 Sep 2016, 20:03; edited 1 time in total
Post 23 Sep 2016, 19:02
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
maybe a programmable multi byte register design can be cool...

Code:
segl es,10 ;set es size to 10 bytes
segl zs,1000;set zs size to 8000 bits, enough?

regl eax,1024*1024;maybe the eax register can be one mega byte?
    
Post 23 Sep 2016, 19:52
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
edfed wrote:
maybe a programmable multi byte register design can be cool...

Code:
segl es,10 ;set es size to 10 bytes
segl zs,1000;set zs size to 8000 bits, enough?

regl eax,1024*1024;maybe the eax register can be one mega byte?
    
In a way we can already do that with FPGAs. Set your register size to whatever you want. But remember not to include segment registers in your FPGA design (:
Post 23 Sep 2016, 20:05
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
sure (:
segments are some uneeded security when working in low level... good old harvard architecture heritage
Post 23 Sep 2016, 23:25
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
This has some interesting info. (Can you imagine a 50 Mhz? That's like that one guy with 64 MB of RAM on his 386, heh. EDIT: Or the guy who's old 386 laptop only had 512 kb [sic]!!)
Post 24 Sep 2016, 22:05
View user's profile Send private message Visit poster's website 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.