HobbyOSs / opennask

nask clone assembly, it can boot tiny OS with Linux
https://github.com/HobbyOSs/opennask/wiki/%E5%8B%95%E4%BD%9C%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF
GNU General Public License v3.0
20 stars 3 forks source link

x86の命令セットをある程度自動で作成する #39

Closed hangingman closed 1 year ago

hangingman commented 3 years ago
Limitations

This project is for demonstration purposes and only supports a super limited subset of x86 assembly. 
Many instructions are currently not available and many assembly language features are missing or broken.

Many instructions are currently not available とは書かれているが https://github.com/mattbierner/Template-Assembly/blob/master/include/tasm/isa/x86.h をgrepすると223個はサポートされていそうに見える。手直ししたら使えそうな気はする。


$ cat x86.h | grep auto | sed -e 's/(.*$//g' -e 's/constexpr auto //g' | sed -e 's/^[[:blank:]]*//' | uniq | wc -l
223

bnfcで構文解析後のデータをある程度自動でTemplate-Assemblyに渡せば、コードを書く量を減らせそうな気がしている。 (そもそもosaskをビルドするのにフル実装のアセンブリ実装は不要な気もするけど)


2023/02/14

x86-64のJSON https://github.com/astocko/json-x86-64

をobj化し https://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967 https://github.com/graphitemaster/incbin

この形式でconstexpr化, struct化できる https://github.com/jorgen/json_struct/blob/4f6d60c1c90aa55110c46342487d64615790ce8a/tests/json-struct-nested.cpp#L27-L44