-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8080: flush register from cache when it's modified by ALU insn
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
regcache1 add: yes | ||
regcache1 sub: yes | ||
regcache1 or: yes | ||
regcache1 xor: yes | ||
regcache1 and: yes |
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,31 @@ | ||
include "cowgol.coh"; | ||
include "tests/_framework.coh"; | ||
|
||
# ALU insns referencing memory should flush cached target register value | ||
sub cache1() is | ||
var a: uint8 := 2; | ||
var b: uint8 := 1; | ||
var c: uint8; | ||
var d: uint8; | ||
|
||
c := a + b; | ||
d := a; | ||
print("regcache1 add"); if c == 3 and d == 2 then yes(); else no(); end if; | ||
|
||
c := a - b; | ||
d := a; | ||
print("regcache1 sub"); if c == 1 and d == 2 then yes(); else no(); end if; | ||
|
||
c := a | b; | ||
d := a; | ||
print("regcache1 or"); if c == 3 and d == 2 then yes(); else no(); end if; | ||
|
||
c := a ^ b; | ||
d := a; | ||
print("regcache1 xor"); if c == 3 and d == 2 then yes(); else no(); end if; | ||
|
||
c := a & b; | ||
d := a; | ||
print("regcache1 and"); if c == 0 and d == 2 then yes(); else no(); end if; | ||
end sub; | ||
cache1(); |