You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
740 B
45 lines
740 B
; Parsing branches and jumps.
|
|
|
|
; Jumps with no arguments. The '()' empty argument list is optional.
|
|
function minimal() {
|
|
ebb0:
|
|
jump ebb1
|
|
|
|
ebb1:
|
|
jump ebb0()
|
|
}
|
|
|
|
; Jumps with 1 arg.
|
|
function onearg(i32) {
|
|
ebb0(vx0: i32):
|
|
jump ebb1(vx0)
|
|
|
|
ebb1(vx1: i32):
|
|
jump ebb0(vx1)
|
|
}
|
|
|
|
; Jumps with 2 args.
|
|
function twoargs(i32, f32) {
|
|
ebb0(vx0: i32, vx1: f32):
|
|
jump ebb1(vx0, vx1)
|
|
|
|
ebb1(vx2: i32, vx3: f32):
|
|
jump ebb0(vx2, vx3)
|
|
}
|
|
|
|
; Branches with no arguments. The '()' empty argument list is optional.
|
|
function minimal(i32) {
|
|
ebb0(vx0: i32):
|
|
brz vx0, ebb1
|
|
|
|
ebb1:
|
|
brnz vx0, ebb1()
|
|
}
|
|
|
|
function twoargs(i32, f32) {
|
|
ebb0(vx0: i32, vx1: f32):
|
|
brz vx0, ebb1(vx0, vx1)
|
|
|
|
ebb1(vx2: i32, vx3: f32):
|
|
brnz vx0, ebb0(vx2, vx3)
|
|
}
|
|
|