-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1134 from z88dk/feature/struct_assignment
(sccz80) Struct assignment
- Loading branch information
Showing
11 changed files
with
435 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
|
||
struct test { | ||
char c[10]; | ||
int x; | ||
int y; | ||
}; | ||
|
||
static struct test x; | ||
static struct test y; | ||
static struct test *z; | ||
|
||
void func_global_assign() | ||
{ | ||
x = y; | ||
} | ||
|
||
void func_global_assign_to_pointer() | ||
{ | ||
*z = y; | ||
} | ||
|
||
void func_global_assign_from_pointer() | ||
{ | ||
x = *z; | ||
} | ||
|
||
void func_local_assign() | ||
{ | ||
struct test a; | ||
struct test b; | ||
|
||
a = b; | ||
} | ||
|
||
void func_local_assign_to_pointer() | ||
{ | ||
struct test a; | ||
struct test *b; | ||
|
||
*b = a; | ||
} | ||
|
||
|
||
void func_local_assign_from_pointer() | ||
{ | ||
struct test a; | ||
struct test *b; | ||
|
||
a = *b; | ||
} | ||
|
Oops, something went wrong.