CompuServe Thread

#Inheritance in Asm?

2 messages in this thread
#118650From: Thomas HoladaySep 1, 1990 11:18 PM
Gee, now I want a doubly linked list of FileInfoBlocks. In C++ I'd either declare a child class which added *next and *prev pointers or a new class descended from both a List class and the FileInfoBlock class. Using the exec/types.i macros, can I do the same type of thing with STRUCTURE MyFibHeapElement STRUCT FileInfoBlock DS.L Next DS.L Prev LABEL MyFibHeapElement_SIZEOF Or do I completely misunderstand the role of STRUCT? Since all I need it to get enough space, maybe I could use STRUCTURE MyFibHeapElement DS.B fib_SIZEOF DS.L 0 ; to make sure things are long word aligned(?) DS.L Next DS.L Prev LABEL MyFibHeapElement_SIZEOF THol() { cout << "Sir, I exist." ;}
#118679From: Martin MurraySep 2, 1990 2:15 AM
It looks as though you have used STRUCT correctly. I would replace the DS.L lines with DC.L lines, however. I'm not certain what DS.L would do, except perhaps generate an error. DS by itself would Define Storage for the amount of memory indicated in the argument, but would not initialize the memory, and would certainly not store your value in it. Anyway, your first example I think would nicely be able to handle a linked list of FIB structures. Remember to keep the FIBs longword aligned, because they must be that way for DOS.