📄 c2asm.awk
字号:
#! /usr/bin/awk -f## C simulation source to Assembly source converter## Caution: This script crudely removes parentheses, braces# and semicolons from the original source. If any of these# characters are contained in comments or character literals# then they will also be affected. Check the output carefully.## Also, it is your responsibility to ensure that subroutines# have explicit 'return's as appropriate. The script cannot# assume that every subroutine needs one. For code space# reasons I sometimes replace 'call / return' pairs with# a 'goto'. Another possibility is that the subroutine# finishes with a 'retlw'.## This script assumes C++ style comments./[ ]*void[ ]*/ { gsub( "[ ]*void[ ]*", "" ) }/\(/ { sub( "\(", "" ) }/\)[ ]*;/ { sub( "\)[ ]*;", "" ) }/\)/ { sub( "\)", ":" ) }/;/ { sub( ";", "" ) }/\{/ { sub( "\{", "" ) }/\}/ { sub( "\}", "" ) }/\/\// { sub( "\/\/", ";" ) } { print }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -