asmgen.awk

来自「awk scripts awk scripts awk scripts awk 」· AWK 代码 · 共 38 行

AWK
38
字号
# delete the opcode and comment fields of the output
# from the ASMGEN disassembler

NF < 1 || /^;/   {
    print
    next
}
$1 ~ /^;/ {
    i = 2; 
    printf ("\t%s\t", $1)
    while (i <= NF) {
        printf ("%s ", $i)
        i++
    }
    printf ("\n")
    next
}
{
    if ($0 ~ /^[ \t]/)
        i = 1
    else {
        printf ("%s", $1)
        i = 2
    }
    if (i <= NF) {
        printf ("\t%s\t", $i)
        i++
    }
    while (i <= NF) {
        if ($i ~ /;/)
            break
        printf ("%s ", $i)
        i++
    }
    printf ("\n")
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?