Welcome to CS374!
int main(void) {
int y = 5;
int y2 = y * y;
printf("%d squared is %d.", y, y2);
}
(define square
(lambda(n)
(* n n)
)
)
(square 5)
movl $5, -4(%rbp)
movl -4(%rbp), %eax
imull %eax, %eax
movl %eax, -8(%rbp)
movl $0, %eax
li $2,5
sw $2,0($fp)
lw $2,0($fp)
mul $2,$2,$2
sw $2,4($fp)
00100000000010100000000000000101 # li t2 5
10101111110010100000000000000000 # sw
10001111110010100000000000000000 # lw
00000001010010100000000000011000 # mult
00000000000000000101000000010010 # mflo t2
10101111110010100000000000000100 # sw 4(fp)
The evolution of programming languages from assembly language to intermediate languages to our favorite high level languages
Programming paradigms