これも同じく、8bitコンピュータ時代のクロスアセンブラが出力していたダンプリストを、BASICのPOKE文に展開して出力するという、20〜30年前の仕様のテキスト変換を行うために作ったものです。
CotEditorでオープン中のダンプリストのテキストの変換対象行を選択しておいた状態で実行すると、変換したリストを新規書類に出力します。
AppleScript名:HexDump to BASIC.scpt |
— – Created by: Takaaki Naganoya – Created on: 2023/01/09 — – Copyright © 2023 Piyomaru Software, All Rights Reserved — tell application "CotEditor" tell front document set aaSel to paragraphs of contents of selection end tell end tell set sNum to 100 set allText to "" repeat with i in aaSel set tmpL to "" set bList to words of i set aStr to retOnLineBasicPoke(bList) of me set allText to allText & ((sNum as string) & ": ") & aStr & return set sNum to sNum + 1 end repeat tell application "CotEditor" set newDoc to make new document tell newDoc set contents of it to allText end tell end tell on retOnLineBasicPoke(aList) set addrStr to first item of aList set aList to rest of aList set aaList to items 1 thru 8 of aList set aStr to "POKE #0, &" & addrStr & ", " repeat with i in aaList set j to contents of i set aStr to aStr & "&" & j & ", " end repeat return text 1 thru -3 of aStr end retOnLineBasicPoke |
More from my site
(Visited 52 times, 1 visits today)