LoginSignup
0
0

More than 3 years have passed since last update.

wslでubuntu その5

Last updated at Posted at 2019-12-22

概要

wslでubuntuやってみた。
練習問題やってみた。

練習問題

真理値表を表示せよ。

サンプルコード

.code32
.text
.global main

main:
    mov     $sin, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $cr, %edi
    push    %esi
    call    puts
    pop     %esi

    mov     $0, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $0, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $0, %eax
    mov     $0, %ebx
    xor     %ebx, %eax
    mov     %eax, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $cr, %edi
    push    %esi
    call    puts
    pop     %esi

    mov     $1, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $0, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $1, %eax
    mov     $0, %ebx
    xor     %ebx, %eax
    mov     %eax, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $cr, %edi
    push    %esi
    call    puts
    pop     %esi

    mov     $0, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $1, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $0, %eax
    mov     $1, %ebx
    xor     %ebx, %eax
    mov     %eax, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $cr, %edi
    push    %esi
    call    puts
    pop     %esi

    mov     $1, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $1, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $1, %eax
    mov     $1, %ebx
    xor     %ebx, %eax
    mov     %eax, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    mov     $cr, %edi
    push    %esi
    call    puts
    pop     %esi

    ret

.data
sin:
    .asciz  "A B X"
fmt:
    .asciz  "%d "
cr:
    .byte   13
    .byte   0   







以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0