-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
169 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ | |
!*l/samples | ||
!*l/*l_progs/*.*l | ||
!*l/samples/*.*l | ||
!*l/*l_progs/asg* | ||
!*l/*l_progs/asg*/*.*l |
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,26 @@ | ||
//int main() | ||
//{ | ||
// decl | ||
// int a; | ||
// enddecl | ||
// begin | ||
// while(1==1) do | ||
// a=1; | ||
// endwhile; | ||
// return 0; | ||
// end | ||
//} | ||
int main() | ||
{ | ||
decl | ||
int temp,num; | ||
enddecl | ||
begin | ||
num=101; | ||
while ( num <= 200 ) do | ||
temp = exposcall ( "Write" , -2, num ); | ||
num = num + 1; | ||
endwhile; | ||
return 0; | ||
end | ||
} |
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ int main() | |
endwhile; | ||
return 0; | ||
end | ||
} | ||
} |
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,14 @@ | ||
int main() | ||
{ | ||
decl | ||
int temp,num; | ||
enddecl | ||
begin | ||
num=1; | ||
while ( num <= 100 ) do | ||
temp = exposcall ( "Write" , -2, num ); | ||
num = num + 1; | ||
endwhile; | ||
return 0; | ||
end | ||
} |
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,14 @@ | ||
int main() | ||
{ | ||
decl | ||
int temp,num; | ||
enddecl | ||
begin | ||
num=1; | ||
while ( num <= 100 ) do | ||
temp = exposcall ( "Write" , -2, num ); | ||
num = num + 1; | ||
endwhile; | ||
return 0; | ||
end | ||
} |
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,68 @@ | ||
// Load library codes from disk | ||
loadi(63, 13); | ||
loadi(64, 14); | ||
|
||
// Load Timer Interrupt | ||
loadi(4, 17); | ||
loadi(5, 18); | ||
|
||
// Load INT7 | ||
loadi(16, 29); | ||
loadi(17, 30); | ||
|
||
// Load idle program | ||
loadi(69, 11); | ||
loadi(70, 12); | ||
|
||
// Load Init program | ||
loadi(65, 7); | ||
loadi(66, 8); | ||
|
||
// Intrupts | ||
loadi(22, 35); | ||
loadi(23, 36); | ||
loadi(2, 15); | ||
loadi(3, 16); | ||
|
||
// Process table of init program | ||
[PROCESS_TABLE + 1 * 16 + 1] = 1; | ||
[PROCESS_TABLE + 1 * 16 + 4] = CREATED; | ||
[PROCESS_TABLE + 1 * 16 + 11] = 80; | ||
[PROCESS_TABLE + 1 * 16 + 12] = 0; | ||
[PROCESS_TABLE + 1 * 16 + 13] = 8 * 512; | ||
[PROCESS_TABLE + 1 * 16 + 14] = PAGE_TABLE_BASE + 20; | ||
[PROCESS_TABLE + 1 * 16 + 15] = 10; | ||
|
||
//Init Program | ||
//Library | ||
[PAGE_TABLE_BASE + 1 * 20 + 0] = 63; | ||
[PAGE_TABLE_BASE + 1 * 20 + 1] = "0100"; | ||
[PAGE_TABLE_BASE + 1 * 20 + 2] = 64; | ||
[PAGE_TABLE_BASE + 1 * 20 + 3] = "0100"; | ||
|
||
//Heap | ||
[PAGE_TABLE_BASE + 1 * 20 + 4] = 78; | ||
[PAGE_TABLE_BASE + 1 * 20 + 5] = "0110"; | ||
[PAGE_TABLE_BASE + 1 * 20 + 6] = 79; | ||
[PAGE_TABLE_BASE + 1 * 20 + 7] = "0110"; | ||
|
||
//Code | ||
[PAGE_TABLE_BASE + 1 * 20 + 8] = 65; | ||
[PAGE_TABLE_BASE + 1 * 20 + 9] = "0100"; | ||
[PAGE_TABLE_BASE + 1 * 20 + 10] = 66; | ||
[PAGE_TABLE_BASE + 1 * 20 + 11] = "0100"; | ||
[PAGE_TABLE_BASE + 1 * 20 + 12] = -1; | ||
[PAGE_TABLE_BASE + 1 * 20 + 13] = "0000"; | ||
[PAGE_TABLE_BASE + 1 * 20 + 14] = -1; | ||
[PAGE_TABLE_BASE + 1 * 20 + 15] = "0000"; | ||
|
||
//Stack | ||
[PAGE_TABLE_BASE + 1 * 20 + 16] = 76; | ||
[PAGE_TABLE_BASE + 1 * 20 + 17] = "0110"; | ||
[PAGE_TABLE_BASE + 1 * 20 + 18] = 77; | ||
[PAGE_TABLE_BASE + 1 * 20 + 19] = "0110"; | ||
|
||
// Set IP in top of the stack | ||
[76 * 512] = [65 * 512 + 1]; | ||
|
||
return; |
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