aria diechest
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    [](https://)###### tags: `RCWT` # Specs of rcwt-code [RRCWT-仮想マシンの仕様書](/Ks6TmPsgTiKm_5oE9FpyDA) word code(32bit命令)であり上位ビットから順に8bitずつ `code op0 op1 op2` となっている。codeはopcode, opはoperandを表す。 基本的に3番地コードを採用しており `op0 = op1 code op2` という関係である。 **マクロ系は将来的に廃止する可能性が高い。** ## TODO - 命令融合 - float - 戻り値 - pseudo: 疑似命令(要検討) ### システム系 NOP 00(0x表記) なにもしない BP 02 ブレークポイント **レジスタ・スタック・ヒープ領域をファイルにダンプ出力する** ### スタック系 STORE 04 スタックの引数op0番目にop1レジスタの値を代入 LOAD 05 op0番目のレジスタにスタックの引数op1番目を代入 PUSH 06 レジスタop0の値をスタックにプッシュする POP 07 レジスタop0にスタックの値をポップする ### レジスタ系 #### 算術 ADDR 10 op1レジスタの値とop2レジスタの値を加算してop0レジスタに代入 SUBR 11 op1レジスタの値とop2レジスタの値を減算してop0レジスタに代入 MULR 12 op1レジスタの値とop2レジスタの値を乗算してop0レジスタに代入 DIVR 13 op1レジスタの値とop2レジスタの値を徐算して商をop0レジスタに代入 REMR 14 op1レジスタの値とop2レジスタの値を徐算して余りをop0レジスタに代入 #### 比較 GT 15 op1レジスタがop2レジスタと>の関係であればop0レジスタにフラグを立てる GE 16 op1レジスタがop2レジスタと≧の関係であればop0レジスタにフラグを立てる **LTやLEはなく代わりにGTやGEを使う** EQ 17 op1レジスタがop2レジスタと=の関係であればop0レジスタにフラグを立てる #### 論理 AND 18 op1レジスタとop2レジスタが共に0でなければop0レジスタにフラグを立てる OR 19 op1レジスタかop2レジスタの少なくともどちらかが0でなければop0レジスタにフラグを立てる NOT 1a op1レジスタの値が0であればop0レジスタにフラグを立て、そうでなければフラグを0に設定する(op1と対称関係になるよう設定する) XOR 1b op1レジスタとop2レジスタの値が異なればop0レジスタにフラグを立てる、そうでなければフラグを立てない #### ビットシフト SHL 1c op2レジスタの値の分だけop1レジスタの桁を左シフトする SHR 1d op2レジスタの値の分だけop1レジスタの桁を右シフトする ### 即値系 ADDI 20 op2値をop1レジスタの値に加算してop0レジスタに格納 ~~**MOVはなく代わりにADDIを使う**~~ **`MOV dst src`系のまとめ** - srcがレジスタ `ADDR dst r0 src` - srcが即値 `ADDI dst r0 src`または`MOV dst src` - srcがスタック `LOAD dst src 0` - srcがヒープ `GET src 0 dst` SUBI 21 op2値をop1レジスタの値に減算してop0レジスタに格納 MULI 22 op2値をop1レジスタの値に乗算してop0レジスタに格納 DIVI 23 op2値をop1レジスタの値に徐算して商をop0レジスタに格納 REMI 24 op2値をop1レジスタの値に徐算して余りをop0レジスタに格納 ### 分岐系 GOTO 40 今の命令からop0先の命令へ移行する EXIT 41 終了命令 CALL 42 op0個のローカル変数を持つop2から始まる関数を呼び出す **op2の計算 n番目から始まる関数の場合 4(n-1)←この10進数を16進数に置き換える** 命令n番目から始まる RET 43 関数処理を終了する IFGT 44 op1レジスタがop2レジスタと>の関係であればop0先へ飛ぶ IFGE 45 op1レジスタがop2レジスタと≧の関係であればop0先へ飛ぶ **IFLTやIFLEはなく代わりにIFGTやIFGEを使う** IFEQ 46 op1レジスタがop2レジスタと=の関係であればop0先の命令へ飛ぶ op1=op2 ### ヒープ系 NEW 50 新たにop2バイトのメモリを確保し、op0レジスタに参照を格納する SET 51 op0レジスタの持つ参照よりop1バイト先のメモリにレジスタop2の値を代入する GET 52 レジスタop0にop1レジスタの持つ参照よりop2バイト先のメモリの値を代入する COPY 53 レジスタop1の持つ参照からop2バイト分をコピーし、op0レジスタに参照を格納する ### マクロ系 IMM fa op0レジスタにop1とop2をあわせて16bit即値とみなした値を代入する IOUT fe op0レジスタの値をプリントする SOUT ff レジスタop0の参照する文字列をプリントする

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully