473,802 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ implementation on segment model

As C++ program supports objects with
constructors/destructors/methods and data items, I'll assume
C++ implementation on segment model computer, like a 80286
with different access restrictions on code segment / data
segment / etc., will force all objects to be resided in a
code segment, so that executable code can be there as well
as data. And effectively bypassing all segment model.

Any comments on the above?

Stephen Wong @ Hong Kong.

Jul 22 '05 #1
3 1966

"Stephen S M WONG" <wo****@netviga tor.com> wrote in message
news:Pi******** *************** *******@localho st.localdomain. ..
As C++ program supports objects with
constructors/destructors/methods and data items, I'll assume
C++ implementation on segment model computer, like a 80286
with different access restrictions on code segment / data
segment / etc., will force all objects to be resided in a
code segment, so that executable code can be there as well
as data. And effectively bypassing all segment model.

Any comments on the above?


Code is just code, and will always reside in the code segment. Data is just
data and will always reside in a data segment. You seem to think that
objects carry around little packets of code with them, but you are mistaken.

john
Jul 22 '05 #2
Then, on a segment model computer, methods will be
implemented by a table (virtual) placed in an object in a
data segment, and actual code is resided in code segment.
Am I right?

On a (pure) paging computer, methods (code) and data can be
intermingled in the user memory space. When an object with
inline methods is instantiated, the method code and data are
copied to a new memory location, that's my understanding of
method inheritance, anything wrong?

Stephen Wong @ Hong Kong.

On Tue, 24 Feb 2004, John Harrison wrote:

"Stephen S M WONG" <wo****@netviga tor.com> wrote in message
news:Pi******** *************** *******@localho st.localdomain. ..
As C++ program supports objects with
constructors/destructors/methods and data items, I'll assume
C++ implementation on segment model computer, like a 80286
with different access restrictions on code segment / data
segment / etc., will force all objects to be resided in a
code segment, so that executable code can be there as well
as data. And effectively bypassing all segment model.

Any comments on the above?


Code is just code, and will always reside in the code segment. Data is just
data and will always reside in a data segment. You seem to think that
objects carry around little packets of code with them, but you are mistaken.

john

Jul 22 '05 #3

"Stephen S M WONG" <wo****@netviga tor.com> wrote in message
news:Pi******** *************** *******@localho st.localdomain. ..
Then, on a segment model computer, methods will be
implemented by a table (virtual) placed in an object in a
data segment, and actual code is resided in code segment.
Am I right?
Right.

On a (pure) paging computer, methods (code) and data can be
intermingled in the user memory space. When an object with
inline methods is instantiated, the method code and data are
copied to a new memory location, that's my understanding of
method inheritance, anything wrong?


Code is never copied. One copy of the code is sufficient for the whole
program.

As I said, you seem to think that objects carry code with them, this is not
the case. Perhaps you would be interested in a book called 'Inside the C++
Object Model' by Stanley Lippman. I bit out of date now, but still a good
book apparently (haven't read it myself).

john
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2372
by: Tony Marston | last post by:
For those who you thought my method of implementing OO principles in PHP was totally wrong - see http://www.tonymarston.co.uk/php-mysql/good-bad-oop.html for details, you can now read http://www.tonymarston.co.uk/php-mysql/model-view-controller.html and tell me why my implementation of the MVC design pattern is totally wrong. Go on, I dare you. Make my day. -- Tony (a legend in his own lunchtime) Marston
2
2902
by: James FitzGerald | last post by:
I am building a small memory model DOS exe (does not actually run in dos but in a custom 16bit environment). For complex reasons I am not allowed to have any relocatable items. I have run into a problem where the compiler is putting my vtables into a new segment (COMDAT_SEG1). I would like to force the compiler to stick these into a default segment such as the _TEXT segment or _CODE segment. The classes are defined as far, and need...
2
4483
by: pvinodhkumar | last post by:
I am reading Lippman's Inside C++ object model. I feel lonely because the Microsoft C++ compiler which I use does not provide me an implementation details manual, describing how they implement vtables in case of single inheritance and multiple inheritance. Just to verify what I read is correct I don't have the same from any other compiler vendors also. I do not know where CFront's implementation manuals are.
1
1568
by: P Vinodh Kumar | last post by:
Reposting, please give your ideas/suggestions/comments. I am reading Lippman's Inside C++ object model. I feel lonely because the Microsoft C++ compiler which I use does not provide me an implementation details manual, describing how they implement vtables in case of single inheritance and multiple inheritance. Just to verify what I read is correct I don't have the same from any
65
12629
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
4
1932
by: Griff | last post by:
Two questions really, the first one "conceptual" and the other more involved with design: 1 - There are two schools of thought where I work on the role of the "controller" task. The first is that the business object will provide the business rules and that the controller will implement the rules and then pass the result set to the view (i.e. do most of the grunt work).
5
11364
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget to pass all the necessary object files to the linker. Neither of those are my problem. Please bear with me as the question I ask is rather long and I think it's beyond a CS101 level of linker stupidity. If it is a stupid CS101 mistake I'm making...
5
1303
by: [rob desbois] | last post by:
Consider the following code: try { // throws exceptions of several types Foo(); } catch (out_of_range& ex) { } catch (exception& ex)
3
2156
by: madshov | last post by:
Hi, I have the following: <start> <segment Id="AAA"> <element Id="id">1</element> <element Id="seq">122</element> <element Id="seq2" Composite="yes">
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.