Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .globl main
- .set TYPE_BOOL, 1
- .set TYPE_BOOL_FALSE, 1
- .set TYPE_BOOL_TRUE, 5
- .set TYPE_INT, 0
- .set SHIFT, 2
- .set MASK, 3
- main:
- pushl %ebp
- movl %esp, %ebp
- movl $1, %esi # esi = 1
- sall $SHIFT, %esi # esi = 4
- orl $TYPE_INT, %esi # esi = 4 (1:TYPE_INT)
- movl $MASK, %eax # eax = 3
- andl %esi, %eax # eax = 0 (TYPE_INT)
- cmpl $TYPE_BOOL, %eax # 1 >= 0
- setge %al # al should be 1
- movzbl %al, %ebx # ebx should be 1
- pushl %ebx
- call printnl_int # prints 0! =(
- addl $4, %esp
- movl $0, %eax
- leave
- ret
Add Comment
Please, Sign In to add comment