Created
April 22, 2018 17:42
-
-
Save atpons/73c36932f06184deb16191caa4f5abc8 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}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment