tsoding / porth

It's like Forth but in Python
628 stars 50 forks source link

2 byte load and store intrinsics working in simulator and compiltime #80

Open cakemaster9001 opened 2 years ago

cakemaster9001 commented 2 years ago

I created two new intrinsics for working with 2byte variables. The two new instructions are .16 and ,16 and follow the same convention as the 64 and 8-bit versions.

Both are tested in simulation and compilation mode and has expected behavior. They are tested with the following program:

include "std.porth"

//prints 0
mem 0 .16
mem ,16 print

//prints 255
mem 255 .16
mem ,16 print

//prints 256
mem 256 .16
mem ,16 print

//prints 65535
mem 65535 .16
mem ,16 print

//prints 0
mem 65536 .16
mem ,16 print