omarandlorraine / strop

Stochastically generates machine code
MIT License
95 stars 1 forks source link

Support the STM8 #19

Closed omarandlorraine closed 2 years ago

omarandlorraine commented 2 years ago

This pull request hosts discussion on the (eventual) STM8 support.

omarandlorraine commented 2 years ago

The necessary knowledge to implement the SWAP instruction is here.

omarandlorraine commented 2 years ago

If we're going to say that a supported instruction set is one that's tested, then is it worth having some kind of coverage report?

omarandlorraine commented 2 years ago

We cannot have strop panicking if it can't find a register by a particular name. Need a Result<Datum, Something>, all unit tested and everything

For example, $ strop --arch stm8 --function mult2 --in b --out b panics when it should print out a user friendly error message

omarandlorraine commented 2 years ago

Some programs generated by strop for the command line strop --arch stm8 --function mult2 --in m2 --out a, i.e., read a value for memory address 2, and leave double that value in the accumulator.

sla $ 2
clr a
add a, $ 2

,

sla $ 2
clr a
xor a, $ 2

,

clr a
xor a, $ 2
add a, $ 2

It looks as though strop doesn't know of any load instruction.