LoginSignup
1
0

More than 5 years have passed since last update.

ズンドコキヨシ with MASMマクロ

Last updated at Posted at 2016-03-18

MASM のマクロでズンドコしてみました。任意のアセンブリプログラムに組み込めばアセンブル時にズンドコします。コードは一切生成せず、ビルド時の出力を賑やかすだけのものです。

zundoko.mac
        ifndef _ZUNDOKO_MAC
_ZUNDOKO_MAC equ 1

zundoko macro
        local i, d, history, randomBit
        ifndef GlobalRandomValue
            GlobalRandomValue = 0
            irpc i,<124578>
                d SUBSTR @time, i, 1
                GlobalRandomValue = 10 * GlobalRandomValue + d
            endm
        endif
        history = 0
        while history - 30
            GlobalRandomValue = (5 * GlobalRandomValue + 123) and 0ffffh
            randomBit = (GlobalRandomValue / 80h) and 1
            if randomBit
                echo ZUN
            else
                echo DOKO
            endif
            history = (2 * history + randomBit) and 1fh
        endm
        echo KI.YO.SHI!
        endm

        endif;_ZUNDOKO_MAC
zundoko.asm
        include zundoko.mac

        zundoko

        end

zundoko.png

MASM で日本語を echo する方法がわかりません。どなたかご存知の方、ご協力ください。

1
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
1
0