-
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.
Archival checkin of the non-functional cowasm2 variable-sized-instruc…
…tion stuff.
- Loading branch information
1 parent
ca85667
commit 6aec0ce
Showing
7 changed files
with
122 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
record SizeRecord is | ||
array: uint8[256]; | ||
next: [SizeRecord]; | ||
end record; | ||
|
||
var firstSizeRecord_s: SizeRecord; | ||
var firstSizeRecord := &firstSizeRecord_s; | ||
var currentSizeRecord: [SizeRecord]; | ||
var currentOffset: uint8; | ||
|
||
sub RewindSizePointer() is | ||
currentSizeRecord := firstSizeRecord; | ||
currentOffset := 0; | ||
end sub; | ||
|
||
sub GetNextSizeRecord(): (result: [uint8]) is | ||
result := ¤tSizeRecord.array[currentOffset]; | ||
|
||
print_hex_i32(result as intptr as uint32); | ||
print(" "); | ||
print_hex_i8([result]); | ||
print_nl(); | ||
currentOffset := currentOffset + 1; | ||
if currentOffset == 0 then | ||
var next := currentSizeRecord.next; | ||
if next == (0 as [SizeRecord]) then | ||
next := Alloc(@bytesof SizeRecord) as [SizeRecord]; | ||
currentSizeRecord.next := next; | ||
end if; | ||
currentSizeRecord := next; | ||
end if; | ||
end sub; | ||
|
||
sub SizeInvariantError() is | ||
SimpleError("variable-size instruction tried to get bigger"); | ||
end sub; | ||
|
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