The code you mine comes out as microprograms. Use one while you're still inside and it downloads into the library shard in your deck. Outside it's dead weight.

mprogs
Lists what's in your library and what each piece costs in RAM.

compile <name> <program...>
Hold a blank quickhack shard and write a program onto it. A program is a list:

  a target, like legs or cyberoptics
  then a function, like desync or reboot
  then any modifiers, like repeat or silent

You can chain more targets and functions after that, ten pieces at most. Every function needs a target in front of it.

  compile trip legs desync
  compile lights_out cyberoptics malfunction duration_plus

Shorter programs cost less RAM, and your deck only has so much. Test on something that isn't your friend.
