mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-25 21:33:44 +00:00
38 lines
639 B
Plaintext
38 lines
639 B
Plaintext
/* Test C02 define directive */
|
|
|
|
#pragma origin 1000
|
|
|
|
char d, i;
|
|
char index, name[8], data[128];
|
|
|
|
//Define Structure
|
|
struct record {
|
|
char name[8];
|
|
char index;
|
|
char data[128];
|
|
};
|
|
|
|
//Declare Structure Variable
|
|
struct record rec;
|
|
|
|
//Set Structure Members
|
|
strdst(&rec.name); strcpy(name);
|
|
rec.index = index;
|
|
for (i = 0; i<=128; i++)
|
|
rec.data[i] = d;
|
|
|
|
//Pass Entire Structure into Function
|
|
blkput(@rec, &rec);
|
|
|
|
//Copy Struct Member
|
|
memdst(&data); memcpy(@rec.data, &rec.data);
|
|
|
|
//Get Structure Members
|
|
index = rec.index;
|
|
for (i = 0; i<129; i++)
|
|
d = rec.data[i];
|
|
|
|
//Treat Structure Like and Array
|
|
for (i = 0; i<140; i++)
|
|
d = rec[i];
|