LoginSignup
0
0

More than 5 years have passed since last update.

俺言語 その10

Last updated at Posted at 2018-03-02

概要

俺言語をやってみた。
avrにアセンブラで実装してみた。
乱数やってみた。

拡張

乱数は、$で、0から15をとる。
アルゴリズムは、seed * 5 + 1

ransu:
    cpi     ADR, '$'
    brne    get12
    ldi     r17, 5
    clr     r21
    add     r21, r2
    dec     r17
    cpi     r17, 0
    brne    PC - 3
    inc     r21
    mov     r2, r21
    andi    r21, 0x0f
    mov     VAL, r21
    ret

写真

image

環境

avr studio 4
attiny85 1mhz
tera term
usb-serial

サンプルコード

乱数を11個

10 a=0
20 ?=$
30 a=a+1
40 #=a<11*20

以上。

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