echo " .syntax unified" echo " .thumb" perl -0777 -pe 's/\r?\n/\n/g;s/;thumb_func/.thumb_func/g;s/;/\/\//g;s/export/\.global/g;s/(([a-zA-Z0-9_]+) proc\n[\W\w]+?)endp/\1\.size \2, \.-\2/g;s/([a-zA-Z0-9_]+) proc\n/\t\.type \1, %function\n\1:\n/g;s/(\n)(\d+)(\n)/\1\2:\3/g;s/%b(\d+)/\1b/g;s/%f(\d+)/\1f/g;s/(frame[\W\w]+?\n)/\/\/\1/g;s/area \|([^\|]+)\|[^\n]*\n/\1\n/g;s/align 2/.align 1/g;s/align 4/.align 2/g;s/\n([a-zA-Z0-9_]+)(\n\s)dcd/\n\1:\2.word/g;s/\n([a-zA-Z0-9_]+)(\n\s)(.global [a-zA-Z0-9_]+\n\s)dcd/\n\t.type \1, \%object\n\1:\n\t.global \1\2.word/g;s/dcd/.word/g;s/\/\/ end ([a-zA-Z0-9_]+)/.size \1, .-\1/g;s/\n([a-zA-Z0-9_]+)(\n\s)dcw/\n\1:\2.hword/g;s/dcw/.hword/g;s/\n([a-zA-Z0-9_]+)(\n\s)dcb/\n\1:\2.byte/g;s/dcb/.byte/g;s/(X\d+) RN (\d+)/\t\1 .req r\2/g;s/ltorg/.ltorg/g;s/end(\n)/.end\1/g;s/(adcs|adc|sbcs|sbc) ([r|X]\d+|lr),([^,]+?)(\n| +?\/\/)/\1 \2,\2,\3\4/g;s/ +?\/\/label definition/: \/\//g'