Skip to content

Commit

Permalink
Int comparators
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-M-Lucas committed Jun 20, 2024
1 parent fb9bb67 commit 5c7d213
Show file tree
Hide file tree
Showing 10 changed files with 335 additions and 192 deletions.
73 changes: 39 additions & 34 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 13 additions & 22 deletions build/out.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,17 @@ section .text
main:
push rbp
mov rbp, rsp
mov qword [rbp-9], 2
mov qword [rbp-17], 3
mov rax, qword [rbp-17]
cmp rax, qword [rbp-9]
jg __5_0
mov byte [rbp-1], 0
mov rax, rbp
add rax, -1
mov qword [rbp-9], rax
jmp __5_1
__5_0:
mov byte [rbp-1], 1
__5_1:
mov al, byte [rbp-1]
mov byte [rbp-11], al
mov al, byte [rbp-11]
cmp al, 0
jz __7_0
mov byte [rbp-10], 0
jmp __7_1
__7_0:
mov byte [rbp-10], 1
__7_1:
mov rdx, qword [rbp-9]
mov al, byte [rbp-10]
mov byte [rdx], al
mov al, byte [rbp-1]
mov byte [rbp-12], al
mov al, byte [rbp-12]
cmp al, 0
jz __7_2
mov rdi, __7_t_fstr
Expand All @@ -34,12 +25,12 @@ main:
__7_3:
mov rsi, 0
mov al, 0
sub rsp, 12
sub rsp, 17
extern printf
call printf
add rsp, 12
mov qword [rbp-20], 2
mov rax, qword [rbp-20]
add rsp, 17
mov qword [rbp-25], 2
mov rax, qword [rbp-25]
leave
ret

Expand Down
Binary file modified build/out.o
Binary file not shown.
Binary file modified build/out.out
Binary file not shown.
5 changes: 1 addition & 4 deletions main.why
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
fn main() -> int {
let a: bool = true;
&a = !a;

printb(a);
printb(2 < 3);

return 2;
}
Loading

0 comments on commit 5c7d213

Please sign in to comment.