Big testing update

This commit is contained in:
Scarlett
2025-04-25 23:26:50 -04:00
parent 747a48b211
commit 6e4841f0c1
27 changed files with 262 additions and 8 deletions

View File

@ -0,0 +1,12 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $3, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -16(%rbp), %eax #addition start
movl -16(%rbp), %eax
addl %edx, %eax
movl %eax, -20(%rbp) #addition end
movl -20(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end

View File

@ -0,0 +1,20 @@
movl $-1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $-1, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
cmpl $0, -8(%rbp) #start and
je .L1or2
cmpl $0, -16(%rbp)
je .L1or2
movl $1, %eax
jmp .L1or3
.L1or2:
movl $0, %eax
.L1or3:
movb %al, -20(%rbp)
andb $1, -20(%rbp) #and end
movl -20(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl $1, -24(%rbp) #constant assign

View File

@ -0,0 +1,12 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $3, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -16(%rbp), %eax #division start
cltd
idivl -8(%rbp)
movl %eax, -20(%rbp) #division end
movl -20(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end

View File

@ -0,0 +1,13 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $2, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -8(%rbp), %eax #equal to start
cmpl -16(%rbp), %eax
sete %al
movb %al, -20(%rbp) #equal to end
movl -20(%rbp), %eax #assign start
movl %eax, -24(%rbp) #assign end
movl $1, -28(%rbp) #constant assign

View File

@ -0,0 +1,13 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $2, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -8(%rbp), %eax #less than start
cmpl -16(%rbp), %eax
setl %al
movb %al, -20(%rbp) #less than end
movl -20(%rbp), %eax #assign start
movl %eax, -24(%rbp) #assign end
movl $1, -28(%rbp) #constant assign

View File

@ -0,0 +1,12 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $3, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -16(%rbp), %eax #mod start
cltd
idivl -8(%rbp)
movl %edx, -20(%rbp) #mod end
movl -20(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end

View File

@ -0,0 +1,11 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $3, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -16(%rbp), %eax #multiplication start
imull -16(%rbp), %eax
movl %eax, -20(%rbp) #multiplication end
movl -20(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end

View File

@ -0,0 +1,8 @@
movl $3, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl -8(%rbp), %eax #negation start
negl %eax
movl %eax, -12(%rbp) #negation end
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end

View File

@ -0,0 +1,13 @@
movl $-1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movzbl -8(%rbp), %eax #not start
testl %eax, %eax
setne %al
xorl $1, %eax
movzbl %al, %eax
movb %al, -12(%rbp)
andb $1, -12(%rbp) #not end
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl $1, -20(%rbp) #constant assign

View File

@ -0,0 +1,21 @@
movl $-1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $-1, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
cmpl $0, -8(%rbp) #start or
jne .L1or2
cmpl $0, -16(%rbp)
je .L1or3
.L1or2:
movl $1, %eax
jmp .L1or4
.L1or3:
movl $0, %eax
.L1or4:
movb %al, -20(%rbp)
andb $1, -20(%rbp) #or end
movl -20(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl $1, -24(%rbp) #constant assign

View File

@ -0,0 +1,11 @@
movl $1, -4(%rbp) #constant assign
movl -4(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end
movl $3, -12(%rbp) #constant assign
movl -12(%rbp), %eax #assign start
movl %eax, -16(%rbp) #assign end
movl -16(%rbp), %eax #subtraction start
subl -8(%rbp), %eax
movl %eax, -20(%rbp) #subtraction end
movl -20(%rbp), %eax #assign start
movl %eax, -8(%rbp) #assign end

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[integer:x; integer:y]
y := 1;
x := 3;
y := x + y;
return y;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[Boolean:b; Boolean: c; Boolean: d]
c := true;
d := false;
d := c & d;
return 1;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[integer:x; integer:y]
y := 1;
x := 3;
y := x / y;
return y;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[Boolean: b; integer: x; integer: y]
x := 1;
y := 2;
b := x = y;
return 1;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[Boolean: b; integer: x; integer: y]
x := 1;
y := 2;
b := x < y;
return 1;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[integer:x; integer:y]
y := 1;
x := 3;
y := x % y;
return y;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[integer:x; integer:y]
y := 1;
x := 3;
y := x * x;
return y;
}

View File

@ -0,0 +1,9 @@
type main: integer -> integer
function test: main
test (a) := {
[integer:x; integer:y]
x := 3;
y := -x;
return y;
}

View File

@ -0,0 +1,9 @@
type main: integer -> integer
function test: main
test (a) := {
[Boolean: c; Boolean: d]
c := true;
d := !c;
return 1;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[Boolean:b; Boolean: c; Boolean: d]
c := true;
d := false;
d := c | d;
return 1;
}

View File

@ -0,0 +1,10 @@
type main: integer -> integer
function test: main
test (a) := {
[integer:x; integer:y]
y := 1;
x := 3;
y := x - y;
return y;
}