diff --git a/.gitignore b/.gitignore index 1530978..579ea38 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -*.o \ No newline at end of file +*.o +main +derle \ No newline at end of file diff --git a/002-comparation.s b/002-comparation.s new file mode 100644 index 0000000..95da462 --- /dev/null +++ b/002-comparation.s @@ -0,0 +1,48 @@ +.global _start +.intel_syntax noprefix + +_start: + mov rax, 1 + mov rdi, 1 + lea rsi, [hello_world] + mov rdx, 13 + syscall + + mov ax, 3 + cmp ax, 4 + jb less_goto + ja great_goto + je equal_goto + less_goto: + mov rax, 1 + mov rdi, 1 + lea rsi, [below] + mov rdx, 6 + syscall + jmp continue + great_goto: + mov rax, 1 + mov rdi, 1 + lea rsi, [above] + mov rdx, 6 + syscall + jmp continue + equal_goto: + mov rax, 1 + mov rdi, 1 + lea rsi, [equal] + mov rdx, 6 + syscall + continue: + //exit + mov rax, 60 + syscall + +hello_world: + .asciz "Hello World\n" +above: + .asciz "Above\n" +below: + .asciz "Below\n" +equal: + .asciz "Equal\n"