LoginSignup
0
0

More than 3 years have passed since last update.

wslでubuntu その4

Last updated at Posted at 2019-12-22

概要

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

練習問題

九九を表示せよ。

サンプルコード

.code32
.text
.global main

main:
    mov     $1, %esi
    mov     $1, %edi
loop:
    mov     %esi, %eax
    push    %esi
    mov     %edi, %ebx
    push    %edi
    mul     %bl
    mov     %eax, %esi
    mov     $fmt, %edi
    mov     $0, %eax
    push    %esi
    call    printf
    pop     %esi
    pop     %edi
    pop     %esi
    add     $1, %esi
    cmp     $10, %esi
    jnz     loop
    push    %esi
    push    %edi
    mov     $cr, %edi
    push    %esi
    call    puts
    pop     %esi
    pop     %edi
    pop     %esi
    mov     $1, %esi
    add     $1, %edi
    cmp     $10, %edi
    jnz     loop
    ret

.data
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