-
Notifications
You must be signed in to change notification settings - Fork 1
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 #2 from dhwanish-3/stage18
Stage18 complete
- Loading branch information
Showing
18 changed files
with
1,576 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
int main() { | ||
decl | ||
int temp; | ||
str m; | ||
str fileName; | ||
enddecl | ||
begin | ||
m = "Enter : "; | ||
temp = exposcall("Write", -2, m); | ||
temp = exposcall("Read", -1, fileName); | ||
temp = exposcall("Exec", fileName); | ||
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,100 @@ | ||
0 | ||
2056 | ||
0 | ||
0 | ||
0 | ||
0 | ||
0 | ||
0 | ||
MOV SP,4095 | ||
MOV BP,4096 | ||
PUSH R0 | ||
CALL 2066 | ||
INT 10 | ||
PUSH BP | ||
MOV BP,SP | ||
PUSH R0 | ||
PUSH R0 | ||
PUSH R0 | ||
MOV R0,"Enter : " | ||
MOV R2,BP | ||
MOV R1,2 | ||
ADD R2,R1 | ||
MOV [R2],R0 | ||
MOV R0,"Write" | ||
PUSH R0 | ||
MOV R0,-2 | ||
PUSH R0 | ||
MOV R1,BP | ||
MOV R0,2 | ||
ADD R1,R0 | ||
MOV R0,[R1] | ||
MOV R0,R0 | ||
PUSH R0 | ||
PUSH R0 | ||
PUSH R0 | ||
CALL 0 | ||
SUB SP,5 | ||
MOV R0,5 | ||
MOV R1,SP | ||
ADD R1,R0 | ||
MOV R0,[R1] | ||
MOV R2,BP | ||
MOV R1,1 | ||
ADD R2,R1 | ||
MOV [R2],R0 | ||
MOV R0,"Read" | ||
PUSH R0 | ||
MOV R0,-1 | ||
PUSH R0 | ||
MOV R1,BP | ||
MOV R0,3 | ||
ADD R1,R0 | ||
MOV R0,[R1] | ||
MOV R0,R1 | ||
MOV R0,R0 | ||
PUSH R0 | ||
PUSH R0 | ||
PUSH R0 | ||
CALL 0 | ||
SUB SP,5 | ||
MOV R0,5 | ||
MOV R1,SP | ||
ADD R1,R0 | ||
MOV R0,[R1] | ||
MOV R2,BP | ||
MOV R1,1 | ||
ADD R2,R1 | ||
MOV [R2],R0 | ||
MOV R0,"Exec" | ||
PUSH R0 | ||
MOV R1,BP | ||
MOV R0,3 | ||
ADD R1,R0 | ||
MOV R0,[R1] | ||
MOV R0,R0 | ||
PUSH R0 | ||
PUSH R0 | ||
PUSH R0 | ||
PUSH R0 | ||
CALL 0 | ||
SUB SP,5 | ||
MOV R0,5 | ||
MOV R1,SP | ||
ADD R1,R0 | ||
MOV R0,[R1] | ||
MOV R2,BP | ||
MOV R1,1 | ||
ADD R2,R1 | ||
MOV [R2],R0 | ||
MOV R0,0 | ||
MOV R1,BP | ||
MOV R2,2 | ||
SUB R1,R2 | ||
MOV [R1],R0 | ||
POP R0 | ||
POP R0 | ||
POP R0 | ||
MOV BP,[SP] | ||
POP R0 | ||
RET |
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,25 @@ | ||
breakpoint; | ||
|
||
[PROCESS_TABLE + [SYSTEM_STATUS_TABLE + 1] * 16 + 13] = SP; | ||
SP = [PROCESS_TABLE + [SYSTEM_STATUS_TABLE + 1] * 16 + 11] * 512 - 1; | ||
|
||
backup; | ||
|
||
[DISK_STATUS_TABLE] = 0; | ||
|
||
alias i R2; | ||
i = 1; | ||
while (i < 16) do | ||
if ([PROCESS_TABLE + i * 16 + 4] == WAIT_DISK) then | ||
[PROCESS_TABLE + i * 16 + 4] = READY; | ||
endif; | ||
i = i + 1; | ||
endwhile; | ||
|
||
restore; | ||
|
||
SP = [PROCESS_TABLE + [SYSTEM_STATUS_TABLE + 1] * 16 + 13]; | ||
|
||
breakpoint; | ||
|
||
ireturn; |
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,63 @@ | ||
BRKP | ||
MOV R16, 28672 | ||
MOV R17, 29560 | ||
ADD R17, 1 | ||
MOV R17, [R17] | ||
MUL R17, 16 | ||
ADD R16, R17 | ||
ADD R16, 13 | ||
MOV [R16], SP | ||
MOV R16, 28672 | ||
MOV R17, 29560 | ||
ADD R17, 1 | ||
MOV R17, [R17] | ||
MUL R17, 16 | ||
ADD R16, R17 | ||
ADD R16, 11 | ||
MOV R16, [R16] | ||
MUL R16, 512 | ||
SUB R16, 1 | ||
MOV SP, R16 | ||
BACKUP | ||
MOV [29552], 0 | ||
MOV R2, 1 | ||
_L1: | ||
MOV R16, 16 | ||
GT R16, R2 | ||
JZ R16, _L2 | ||
MOV R16, 28672 | ||
MOV R17, R2 | ||
MUL R17, 16 | ||
ADD R16, R17 | ||
ADD R16, 4 | ||
MOV R16, [R16] | ||
MOV R17, 5 | ||
EQ R16, R17 | ||
JZ R16, _L3 | ||
MOV R16, 28672 | ||
MOV R17, R2 | ||
MUL R17, 16 | ||
ADD R16, R17 | ||
ADD R16, 4 | ||
MOV [R16], 1 | ||
JMP _L4 | ||
_L3: | ||
_L4: | ||
MOV R16, R2 | ||
ADD R16, 1 | ||
MOV R2, R16 | ||
JMP _L1 | ||
_L2: | ||
RESTORE | ||
MOV R16, 28672 | ||
MOV R17, 29560 | ||
ADD R17, 1 | ||
MOV R17, [R17] | ||
MUL R17, 16 | ||
ADD R16, R17 | ||
ADD R16, 13 | ||
MOV R16, [R16] | ||
MOV SP, R16 | ||
BRKP | ||
IRET | ||
HALT |
Oops, something went wrong.