This commit is contained in:
Michael McLoughlin
2018-11-21 13:02:18 -06:00
parent cb259ce43b
commit 59e6af7d36
10 changed files with 553 additions and 2 deletions

19
internal/opcodescsv/io.go Normal file
View File

@@ -0,0 +1,19 @@
package opcodescsv
import (
"os"
"golang.org/x/arch/x86/x86csv"
)
// ReadFile reads the given x86 CSV file.
func ReadFile(filename string) ([]*x86csv.Inst, error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}
defer f.Close()
r := x86csv.NewReader(f)
return r.ReadAll()
}