-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #115: allow labels in asm blocks
- Loading branch information
Showing
9 changed files
with
315 additions
and
27 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,23 @@ | ||
#ruledef test | ||
{ | ||
ld {x} => | ||
{ | ||
assert(x <= 0x8) | ||
0x11 @ x`16 | ||
} | ||
|
||
ld {x} => | ||
{ | ||
assert(x > 0x8) | ||
0x22 @ x`8 | ||
} | ||
test => asm { | ||
ld label | ||
ld label | ||
ld label | ||
label: | ||
} | ||
} | ||
|
||
test ; error: failed / note:_:15: within / error:_:15: did not converge |
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,13 @@ | ||
#ruledef | ||
{ | ||
ld {addr: u8} => 0xee @ addr | ||
test => asm { | ||
ld 0x11 | ||
ld 0x22 | ||
ld $ | ||
ld 0x33 | ||
} | ||
} | ||
|
||
#d 0xf | ||
test ; error: failed / note:_:4: within / error:_:7: failed / note:_:3: within / error:_:7: not aligned / note: 4 more bits |
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,22 @@ | ||
#ruledef test | ||
{ | ||
ld {x} => | ||
{ | ||
assert(x <= 0x8) | ||
0x11 @ x`16 | ||
} | ||
|
||
ld {x} => | ||
{ | ||
assert(x > 0x8) | ||
0x22 @ x`8 | ||
} | ||
test => asm { | ||
ld label | ||
ld label | ||
label: | ||
} | ||
} | ||
|
||
test ; = 0x110006_110006 |
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,13 @@ | ||
#ruledef | ||
{ | ||
jmp {addr: u8} => 0xee @ addr | ||
loop => asm { | ||
jmp 0x11 | ||
jmp label | ||
label: | ||
jmp 0x22 | ||
jmp 0x33 | ||
} | ||
} | ||
|
||
loop ; = 0xee11_ee04_ee22_ee33 |
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 @@ | ||
#ruledef | ||
{ | ||
jmp {addr: u8} => 0xee @ addr | ||
loop => asm { | ||
jmp 0x11 | ||
label: | ||
jmp 0x22 | ||
jmp label | ||
jmp 0x33 | ||
} | ||
} | ||
|
||
label: | ||
loop ; = 0xee11_ee22_ee02_ee33 |
Oops, something went wrong.