実行命令数の取得/実行完了後のメモリ出力#23
Open
ryoryon66 wants to merge 4 commits into
Open
Conversation
実行命令数とデバッグ用mifファイル出力の説明をREADMEに追記
Author
|
また配布されているバブルソートのプログラムをシミュレーションすると実行命令数は また実行完了後に生成されたmifファイルがソートされていることは目視で確かめました。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ソートコンテストのためにプログラムを書く際に実行命令数と実行完了後のメモリの内容が簡単に取得できたら便利だなと思い、SIMPLE/Bに準拠する形で機能拡張を行いました。jarファイルに関しては前回のPRと同様、README記載の方法で作成したわけではないので問題があれば変更をお願いします(こちらの環境で動作することは確認しました)。
実行命令数について
シミュレーション終了後に実行命令数を
number of executed instractions: 8のように出力するようにしました。ソートプログラムの命令数が減らせたかをパソコンで確認できると便利だと思います。実行完了後のメモリ内容の出力について
-dと-mが同時に指定されている際については、プログラムの実行が完了したのちに実行後のメモリ内容をdebug_output.mifというファイルに出力するようにしました。ソートが成功したかのデバッグに有用であると考えます。テスト
について実行命令数は
であり仕様を満たしています。
diff output.mif debug_output.mifの出力はであり50番地に57が書き込まれていることが分かります。
またAll_Instractionsを使用してテストしたところ、実行完了後のメモリは想定と一致していました(INでは57を与えた)。実行命令数は88と出力され、答えは知りませんがおおよそあっているのではないかと思います。