Created
April 24, 2018 05:38
-
-
Save atpons/699433b0121c8d081fbf6691752517d1 to your computer and use it in GitHub Desktop.
This file contains 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
########################################## | |
# kemuideとレポート用紙を行き来するスニペット | |
# レポート用紙から貼り付けるとkemu-ideに貼り付けられるし | |
# kemu-ide から貼り付けるとレポート用紙にペーストできるやつ(命令非対応ですが) | |
# TODO: 命令に対応する | |
########################################## | |
STDERR.puts "[*] Waiting your snippet" | |
input = $stdin.read.split("\n") | |
if input[0].split("\t").count > 3 | |
input.each do |t| | |
t.split("\t").each_with_index do |x, i| | |
puts x if i >= 4 | |
end | |
end | |
else | |
puts "ADDR\tDATA\tOPECODE" | |
code = 0 | |
input.each do |t| | |
puts "#{sprintf("%02d",code+=1)}\tXX\t#{t}" | |
puts sprintf("%02d\n",code+=1) if t.match(/\(/) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment