wcl $(FLAGS) scroll.$(OBJ) 16.lib mapread.$(OBJ) jsmn.$(OBJ) dos_kb.$(OBJ)
scroll.$(OBJ): $(SRC)scroll.c
wcl $(FLAGS) -c $(SRC)scroll.c
+sega.exe: sega.$(OBJ)
+ wcl $(FLAGS) -c sega.$(OBJ)
+sega.$(OBJ): $(SRC)sega.c
+ wcl $(FLAGS) -c $(SRC)sega.c
test.exe: test.$(OBJ) gfx.lib
wcl $(FLAGS) test.$(OBJ) gfx.lib
//==========================================================================
//I hope this is correct!
-typedef void __based(void)* memptr;
+// void __segment(void)* memptr;
//__segment sega;
//__self
-//typedef void __based( sega ) * memptr;
+typedef void __based(__self) * memptr;
typedef struct
{
--- /dev/null
+#include <stdio.h>
+#include <dos.h>
+#include <malloc.h>
+
+typedef struct {
+ struct a __based( __self ) *next;
+ int number;
+}a_t;
+
+void PrintLastTwo( a_t far *list );
+
+void
+main(int argc, char *argv[])
+{
+ a_t far *list;
+ PrintLastTwo(list);
+}
+
+ void PrintLastTwo( a_t far *list )
+ {
+ __segment seg;
+ a_t __based( seg ) *aptr;
+
+ seg = FP_SEG( list );
+ aptr = FP_OFF( list );
+ for( ; aptr != _NULLOFF; aptr = aptr->next ) {
+ if( aptr->next == _NULLOFF ) {
+ printf( "Last item is %d\n",
+ aptr->number );
+ } else if( aptr->next->next == _NULLOFF ) {
+ printf( "Second last item is %d\n",
+ aptr->number );
+ }
+ }
+ }
+
\ No newline at end of file