@@ -764,6 +764,15 @@ int exec_store_same(VmState* st, const char* name, int val) {
764764 return 0 ;
765765}
766766
767+ int exec_builder_to_slice (VmState* st) {
768+ Stack& stack = st->get_stack ();
769+ VM_LOG (st) << " execute BTOS" ;
770+ stack.check_underflow (1 );
771+ Ref<Cell> cell = stack.pop_builder ().write ().finalize_novm ();
772+ stack.push_cellslice (Ref<CellSlice>{true , NoVm (), cell});
773+ return 0 ;
774+ }
775+
767776int exec_store_const_slice (VmState* st, CellSlice& cs, unsigned args, int pfx_bits) {
768777 unsigned refs = (args >> 3 ) & 3 ;
769778 unsigned data_bits = (args & 7 ) * 8 + 2 ;
@@ -866,6 +875,7 @@ void register_cell_serialize_ops(OpcodeTable& cp0) {
866875 .insert (OpcodeInstr::mksimple (0xcf40 , 16 , " STZEROES" , std::bind (exec_store_same, _1, " STZEROES" , 0 )))
867876 .insert (OpcodeInstr::mksimple (0xcf41 , 16 , " STONES" , std::bind (exec_store_same, _1, " STONES" , 1 )))
868877 .insert (OpcodeInstr::mksimple (0xcf42 , 16 , " STSAME" , std::bind (exec_store_same, _1, " STSAME" , -1 )))
878+ .insert (OpcodeInstr::mksimple (0xcf50 , 16 , " BTOS" , exec_builder_to_slice)->require_version (12 ))
869879 .insert (OpcodeInstr::mkext (0xcf80 >> 7 , 9 , 5 , dump_store_const_slice, exec_store_const_slice,
870880 compute_len_store_const_slice));
871881}
0 commit comments