#概要
paizaでアセンブラ、やってみた。
練習問題やってみた。
#練習問題
xorの真理値表を作成せよ。
#サンプルコード
.code32
.text
.global main
main:
mov $sin, %edi
mov $0, %eax
call printf
mov $cr, %edi
call puts
mov $0, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $0, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $0, %eax
mov $0, %ebx
xor %ebx, %eax
mov %eax, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $cr, %edi
call puts
mov $1, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $0, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $1, %eax
mov $0, %ebx
xor %ebx, %eax
mov %eax, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $cr, %edi
call puts
mov $0, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $1, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $0, %eax
mov $1, %ebx
xor %ebx, %eax
mov %eax, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $cr, %edi
call puts
mov $1, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $1, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $1, %eax
mov $1, %ebx
xor %ebx, %eax
mov %eax, %esi
mov $fmt, %edi
mov $0, %eax
call printf
mov $cr, %edi
call puts
ret
.data
sin:
.asciz "A B X"
fmt:
.asciz "%d "
cr:
.byte 13
.byte 0
#成果物
以上。