17 releases

0.1.17 Apr 21, 2024
0.1.16 Apr 20, 2024

#42 in Emulators

MIT license

59KB
686 lines

Osiris/Set:Standard

This crate provides an instruction set for a virtual machine built with pieces from crates osiris-data and osiris-process.

An exemple implementation in my forge.

Warning

Before v1.0.0, the API may change a lot :

  • The set is incomplete. A lot is planed, but more is to be defined,
  • Operations will be added,
  • Arguments scheme may change,
  • Operations could be moved or removed.

Operations

  • 0x0000 noop

Flow control

  • 0x0101 jump:address
  • 0x0102 call:address
  • 0x0103 return
  • 0x0104 goto direct:32
  • 0x0105 gosub direct:32
  • 0x0108 loop:counter_init
  • 0x0109 next direct:32
  • 0x010A goto-if:CMP direct:32
  • 0x010B gosub-if:CMP direct:32
  • 0x010C goto-check:checked direct:32
  • 0x010D gosub-check:checked direct:32
  • 0x010E skip-if:CMP
  • 0x010F skip-check:checked
  • 0x01FF halt

Registers control

  • 0x0201 set-top:target top:32
  • 0x0202 set-bottom:target bottom:32
  • 0x0203 clear-range
  • 0x0204 move-to-float:float unsigned:16
  • 0x0205 move-from-float:unsigned float:16
  • 0x0210 push:unsigned
  • 0x0211 pop:unsigned
  • 0x0220 get-compare:target

Memory control

  • 0x0301 store-words:target [start:end]
  • 0x0302 load-words:target [start:end]
  • 0x0303 get-memory-size:target
  • 0x0304 store-floats:target [start:end]
  • 0x0305 load-floats:target [start:end]

Logic operations

  • 0x0400 is:CMP target:16:compare:16
  • 0x0401 not:target 0:origin:16
  • 0x0402 or:target [start:end]
  • 0x0403 and:target [start:end]
  • 0x0404 xor:target [start:end]
  • 0x0405 nor:target [start:end]
  • 0x0406 nand:target [start:end]
  • 0x0407 nxor:target [start:end]

Unsigned-integral arithmetic

  • 0x1001 sum-unsigned:target [start:end]
  • 0x1002 product-unsigned:target [start:end]
  • 0x1003 difference-unsigned:target [start:end]
  • 0x1004 quotient-unsigned:target [start:end]
  • 0x100F compare-unsigned r1:16:r2:16

License

Dependencies

~75KB