> ## Documentation Index
> Fetch the complete documentation index at: https://companyname-a7d5b98e-nft-comparison.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Instructions

> Interactive reference for TVM instructions

export const TvmInstructionTable = () => {
  const {useCallback, useEffect, useMemo, useRef, useState} = React;
  const PERSIST_KEY = "tvm-instruction-table::filters";
  const SPEC_REPO = "https://github.com/ton-org/tvm-spec-docs-builder";
  const SPEC_COMMIT = "refs/heads/master";
  const SPEC_URL = `${SPEC_REPO.replace("github.com", "raw.githubusercontent.com")}/${SPEC_COMMIT}/cp0.json`;
  const CATEGORY_MAP = {
    stack_basic: "Stack basics",
    stack_complex: "Stack (complex)",
    arithm_basic: "Arithmetic (basic)",
    arithm_div: "Arithmetic (division)",
    arithm_logical: "Arithmetic (logical)",
    arithm_quiet: "Arithmetic (quiet)",
    cell_build: "Cell builders",
    cell_parse: "Cell parsers",
    codepage: "Codepage management",
    compare_int: "Comparisons (integers)",
    compare_other: "Comparisons (other)",
    const_data: "Constants (data)",
    const_int: "Constants (integers)",
    cont_basic: "Continuations (basic)",
    cont_conditional: "Continuations (conditional)",
    cont_create: "Continuations (creation)",
    cont_dict: "Continuations (dictionary)",
    cont_loops: "Continuations (loops)",
    cont_registers: "Continuations (registers)",
    cont_stack: "Continuations (stack)",
    dict_delete: "Dictionaries (delete)",
    dict_get: "Dictionaries (lookup)",
    dict_mayberef: "Dictionaries (maybe ref)",
    dict_min: "Dictionaries (min/max)",
    dict_next: "Dictionaries (iteration)",
    dict_prefix: "Dictionaries (prefix)",
    dict_serial: "Dictionaries (serialization)",
    dict_set: "Dictionaries (store)",
    dict_set_builder: "Dictionaries (builder)",
    dict_special: "Dictionaries (special)",
    dict_sub: "Dictionaries (sub-dictionaries)",
    app_actions: "Actions",
    app_addr: "Addresses",
    app_config: "Blockchain configuration",
    app_crypto: "Cryptography",
    app_currency: "Currency",
    app_gas: "Gas & fees",
    app_global: "Global variables",
    app_misc: "Misc",
    app_rnd: "Randomness",
    app_gaslimits: "Gas limits",
    app_storage: "Contract storage",
    exceptions: "Exceptions & control",
    debug: "Debugging",
    tuple: "Tuples"
  };
  const CATEGORY_GROUPS = [{
    key: "stack",
    label: "Stack",
    patterns: [/^stack_/]
  }, {
    key: "continuations",
    label: "Continuations & Control Flow",
    patterns: [/^cont_/, /^codepage$/]
  }, {
    key: "arithmetic",
    label: "Arithmetic & Logic",
    patterns: [/^arithm_/, /^compare_/]
  }, {
    key: "cells",
    label: "Cells & Tuples",
    patterns: [/^cell_/, /^tuple$/]
  }, {
    key: "dictionaries",
    label: "Dictionaries",
    patterns: [/^dict_/]
  }, {
    key: "constants",
    label: "Constants",
    patterns: [/^const_/]
  }, {
    key: "crypto",
    label: "Crypto",
    patterns: [/^app_crypto/]
  }, {
    key: "applications",
    label: "Blockchain",
    patterns: [/^app_(?!crypto)/]
  }, {
    key: "exceptions",
    label: "Exceptions",
    patterns: [/^exceptions$/]
  }, {
    key: "debug",
    label: "Debugging",
    patterns: [/^debug$/]
  }];
  const CATEGORY_GROUP_KEYS = new Set(CATEGORY_GROUPS.map(group => group.key));
  function resolveCategoryGroup(categoryKey) {
    const normalized = (categoryKey || "").toLowerCase();
    for (const group of CATEGORY_GROUPS) {
      if (Array.isArray(group.patterns) && group.patterns.length > 0 && group.patterns.some(pattern => pattern.test(normalized))) {
        return group;
      }
    }
    return CATEGORY_GROUPS[CATEGORY_GROUPS.length - 1];
  }
  function humanizeCategoryKey(key) {
    if (!key) return "Uncategorized";
    if (CATEGORY_MAP[key]) return CATEGORY_MAP[key];
    return key.split(/[_\s]+/).filter(Boolean).map(part => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
  }
  function formatGasDisplay(gas) {
    if (Array.isArray(gas)) {
      return gas.length > 0 ? gas.join(" / ") : "N/A";
    }
    if (typeof gas === "number") {
      return gas.toLocaleString();
    }
    if (typeof gas === "string") {
      const value = gas.trim();
      if (!value) return "N/A";
      return value.replace(/\//g, " / ").replace(/\s+/g, " ");
    }
    return "N/A";
  }
  function formatOperandSummary(operand) {
    if (!operand) return "";
    const name = typeof operand.name === "string" && operand.name ? operand.name : "?";
    const type = typeof operand.type === "string" ? operand.type : "";
    const size = typeof operand.size === "number" ? operand.size : typeof operand.bits === "number" ? operand.bits : undefined;
    const hasRange = operand.min_value !== undefined && operand.min_value !== null && operand.max_value !== undefined && operand.max_value !== null;
    const range = hasRange ? ` [${operand.min_value}; ${operand.max_value}]` : "";
    const sizePart = size !== undefined ? `(${size})` : "";
    return `${name}${type ? `:${type}` : ""}${sizePart}${range}`;
  }
  function formatInlineMarkdown(text) {
    if (typeof text !== "string") return "";
    const trimmed = text.trim();
    if (!trimmed) return "";
    const escaped = trimmed.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
    const withCode = escaped.replace(/`([^`]+)`/g, (_match, code) => {
      return `<code>${code}</code>`;
    });
    const withLinks = withCode.replace(/\[([^\]]+)\]\((https?:[^)\s]+)\)/g, (_match, label, url) => `<a href="${url}" target="_blank" rel="noreferrer">${label}</a>`);
    return withLinks.replace(/\n/g, "<br />");
  }
  function compareOpcodes(a, b) {
    const sanitize = value => (value || "").replace(/[^0-9a-f]/gi, "");
    const ax = Number.parseInt(sanitize(a), 16);
    const bx = Number.parseInt(sanitize(b), 16);
    if (!Number.isNaN(ax) && !Number.isNaN(bx) && ax !== bx) {
      return ax - bx;
    }
    return (a || "").localeCompare(b || "");
  }
  function createSearchTokens(query) {
    if (typeof query !== "string") return [];
    return query.toLowerCase().split(/\s+/).map(t => t.trim()).filter(t => t.length >= 2);
  }
  function escapeRegExp(value) {
    return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  }
  function highlightMatches(text, tokens) {
    if (typeof text !== "string") return text;
    const safeTokens = Array.isArray(tokens) ? tokens.filter(token => token && token.length > 0) : [];
    if (safeTokens.length === 0) return text;
    const pattern = safeTokens.map(escapeRegExp).join("|");
    const regex = new RegExp(`(${pattern})`, "gi");
    const parts = text.split(regex);
    return parts.map((part, idx) => idx % 2 === 1 ? <span key={`highlight-${idx}`} className="tvm-highlight">
          {part}
        </span> : part);
  }
  function highlightHtmlContent(html, tokens) {
    if (typeof html !== "string") return html || "";
    const safeTokens = Array.isArray(tokens) ? tokens.filter(token => token && token.length > 0) : [];
    if (safeTokens.length === 0) return html;
    const pattern = safeTokens.map(escapeRegExp).join("|");
    if (!pattern) return html;
    const regex = new RegExp(`(${pattern})`, "gi");
    return html.split(/(<[^>]+>)/g).map(segment => {
      if (segment.startsWith("<")) return segment;
      return segment.replace(regex, '<span class="tvm-highlight">$1</span>');
    }).join("");
  }
  function getItemSearchFields(item) {
    const aliasMnemonics = Array.isArray(item.aliases) ? item.aliases.map(alias => typeof alias.mnemonic === "string" ? alias.mnemonic : "").filter(Boolean) : [];
    return {
      mnemonic: String(item.mnemonic || "").toLowerCase(),
      opcode: String(item.opcode || "").toLowerCase(),
      fift: String(item.fift || "").toLowerCase(),
      aliases: aliasMnemonics.map(s => s.toLowerCase())
    };
  }
  function computeFieldMatchScore(field, token) {
    if (!token) return null;
    if (!field) return null;
    if (field === token) return 0;
    if (field.startsWith(token)) return 3;
    if (field.includes(token)) return 7;
    return null;
  }
  function computeBestAliasMatchScore(aliases, token) {
    if (!Array.isArray(aliases) || aliases.length === 0) return null;
    let best = null;
    for (const a of aliases) {
      const s = computeFieldMatchScore(a, token);
      if (s === 0) return 1;
      if (s !== null) best = best === null ? s + 1 : Math.min(best, s + 1);
    }
    return best;
  }
  function itemRelevanceScore(item, tokens) {
    if (!Array.isArray(tokens) || tokens.length === 0) return 1000;
    const {mnemonic, opcode, fift, aliases} = getItemSearchFields(item);
    let total = 0;
    for (const token of tokens) {
      const scores = [computeFieldMatchScore(mnemonic, token), computeBestAliasMatchScore(aliases, token), computeFieldMatchScore(opcode, token) !== null ? computeFieldMatchScore(opcode, token) + 2 : null, computeFieldMatchScore(fift, token) !== null ? computeFieldMatchScore(fift, token) + 5 : null].filter(s => s !== null);
      if (scores.length === 0) return Infinity;
      total += Math.min(...scores);
    }
    return total;
  }
  function buildAnchorId(instruction) {
    const opcodeText = String(instruction.opcode || "").trim().toLowerCase();
    const titleText = `${instruction.mnemonic}`.trim().toLowerCase();
    const raw = `${opcodeText} ${titleText}`.trim();
    const slug = raw.replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
    return encodeURIComponent(slug);
  }
  function copyAnchorUrl(anchorId) {
    try {
      const {location, navigator} = window;
      const base = location ? `${location.origin}${location.pathname}` : "";
      const url = `${base}#${anchorId}`;
      if (navigator && navigator.clipboard && navigator.clipboard.writeText) {
        return navigator.clipboard.writeText(url);
      }
      const ta = document.createElement("textarea");
      ta.value = url;
      ta.setAttribute("readonly", "");
      ta.style.position = "absolute";
      ta.style.left = "-9999px";
      document.body.appendChild(ta);
      ta.select();
      document.execCommand("copy");
      document.body.removeChild(ta);
      return Promise.resolve();
    } catch (err) {
      return Promise.reject(err);
    }
  }
  function copyPlainText(value) {
    try {
      const {navigator, document} = window;
      if (navigator?.clipboard?.writeText) {
        return navigator.clipboard.writeText(value);
      }
      const ta = document.createElement("textarea");
      ta.value = value;
      ta.setAttribute("readonly", "");
      ta.style.position = "absolute";
      ta.style.left = "-9999px";
      document.body.appendChild(ta);
      ta.select();
      document.execCommand("copy");
      document.body.removeChild(ta);
      return Promise.resolve();
    } catch (err) {
      return Promise.reject(err);
    }
  }
  function formatAliasOperands(operands) {
    return Object.entries(operands).map(([name, value]) => `${name}=${value}`).join(", ");
  }
  function cleanAliasDescription(html) {
    if (typeof html !== "string") return "";
    let output = html.trim();
    if (!output) return "";
    output = output.replace(/^<p>/i, "").replace(/<\/p>$/i, "");
    output = output.replace(/\.+$/g, "");
    return output.trim();
  }
  function extractImplementationRefs(implementation) {
    if (!Array.isArray(implementation)) return [];
    return implementation.map(item => {
      if (!item || typeof item !== "object") return null;
      const file = typeof item.file === "string" ? item.file : "";
      const functionName = typeof item.function_name === "string" ? item.function_name : "";
      const line = typeof item.line === "number" ? item.line : undefined;
      const path = typeof item.path === "string" ? item.path : "";
      if (!file && !functionName && !path) return null;
      return {
        file,
        functionName,
        line,
        path
      };
    }).filter(Boolean);
  }
  function buildGitHubLineUrl(rawUrl, line) {
    if (typeof rawUrl !== "string" || !rawUrl) return "";
    let url = rawUrl;
    const RAW_PREFIX = "https://raw.githubusercontent.com/";
    if (rawUrl.startsWith(RAW_PREFIX)) {
      const parts = rawUrl.slice(RAW_PREFIX.length).split("/");
      if (parts.length >= 4) {
        const owner = parts[0];
        const repo = parts[1];
        const commit = parts[2];
        const filePath = parts.slice(3).join("/");
        url = `https://github.com/${owner}/${repo}/blob/${commit}/${filePath}`;
      } else {
        url = rawUrl.replace(RAW_PREFIX, "https://github.com/");
      }
    }
    if (typeof line === "number" && Number.isFinite(line) && line > 0) {
      url = url.split("#")[0] + `#L${line}`;
    }
    return url;
  }
  function renderControlFlowSummary(controlFlow) {
    if (!controlFlow || typeof controlFlow !== "object") {
      return <p className="tvm-missing-placeholder">
          Control flow details are not available.
        </p>;
    }
    const branches = Array.isArray(controlFlow.branches) ? controlFlow.branches.filter(Boolean) : [];
    const nobranch = Boolean(controlFlow.nobranch);
    const isContinuationObject = value => Boolean(value && typeof value === "object" && typeof value.type === "string");
    const formatPrimitiveValue = value => {
      if (value === null || value === undefined) return "";
      if (Array.isArray(value)) {
        return value.map(item => formatPrimitiveValue(item)).filter(Boolean).join(", ");
      }
      if (typeof value === "object") {
        return "";
      }
      if (typeof value === "boolean") {
        return value ? "true" : "false";
      }
      return String(value);
    };
    const describeContinuation = node => {
      if (!isContinuationObject(node)) {
        return {
          typeLabel: "unknown",
          valueLabel: "?",
          detailLabel: "",
          text: "unknown ?"
        };
      }
      const type = String(node.type || "").toLowerCase();
      let typeLabel = "unknown";
      let valueLabel = "";
      switch (type) {
        case "variable":
          typeLabel = "var";
          valueLabel = typeof node.var_name === "string" ? node.var_name : "?";
          break;
        case "register":
          typeLabel = "register";
          if (typeof node.index === "number") {
            valueLabel = `c${node.index}`;
          } else if (typeof node.var_name === "string") {
            valueLabel = `c{${node.var_name}}`;
          } else {
            valueLabel = "c?";
          }
          break;
        case "cc":
          typeLabel = "cc";
          valueLabel = "";
          break;
        case "special":
          typeLabel = "special";
          valueLabel = typeof node.name === "string" && node.name ? node.name : "?";
          break;
        default:
          typeLabel = node.type ? String(node.type) : "unknown";
          valueLabel = "";
          break;
      }
      const detailParts = [];
      if (type === "special") {
        const args = node.args && typeof node.args === "object" ? node.args : {};
        Object.entries(args).forEach(([argKey, argValue]) => {
          if (!isContinuationObject(argValue)) {
            const formatted = formatPrimitiveValue(argValue);
            if (formatted) {
              detailParts.push(`${argKey}=${formatted}`);
            }
          }
        });
      }
      const knownKeys = new Set(["type", "var_name", "index", "name", "args", "save"]);
      Object.entries(node).forEach(([key, value]) => {
        if (knownKeys.has(key)) return;
        const formatted = formatPrimitiveValue(value);
        if (formatted) {
          detailParts.push(`${key}=${formatted}`);
        }
      });
      const detailLabel = detailParts.length > 0 ? `(${detailParts.join(", ")})` : "";
      const text = [typeLabel, valueLabel, detailLabel].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
      return {
        typeLabel,
        valueLabel,
        detailLabel,
        text
      };
    };
    const gatherChildContinuations = node => {
      if (!isContinuationObject(node)) return [];
      const type = String(node.type || "").toLowerCase();
      const children = [];
      const saveEntries = node.save && typeof node.save === "object" ? Object.entries(node.save).filter(([, value]) => isContinuationObject(value)) : [];
      saveEntries.sort(([aKey], [bKey]) => aKey.localeCompare(bKey)).forEach(([slot, value]) => {
        children.push({
          label: String(slot),
          node: value
        });
      });
      if (type === "special") {
        const args = node.args && typeof node.args === "object" ? node.args : {};
        Object.entries(args).forEach(([argKey, argValue]) => {
          if (isContinuationObject(argValue)) {
            children.push({
              label: argKey,
              node: argValue
            });
          }
        });
      }
      return children.map(child => {
        const raw = child.label ? String(child.label) : "";
        const cleaned = raw.replace(/^(arg|save)\s+/i, "").trim();
        return {
          label: cleaned,
          node: child.node
        };
      });
    };
    const buildContinuationTree = (node, path = "root") => {
      const summary = describeContinuation(node);
      const children = gatherChildContinuations(node).map((child, idx) => ({
        label: child.label,
        tree: buildContinuationTree(child.node, `${path}.${idx}`)
      }));
      return {
        id: path,
        summary,
        children
      };
    };
    const splitEdgeLabel = label => {
      if (!label) {
        return {
          primary: "",
          secondary: ""
        };
      }
      const text = label.trim();
      if (!text) {
        return {
          primary: "",
          secondary: ""
        };
      }
      const tokens = text.split(/\s+/);
      if (tokens.length <= 1) {
        return {
          primary: text,
          secondary: ""
        };
      }
      return {
        primary: tokens[0],
        secondary: tokens.slice(1).join(" ")
      };
    };
    const computeSpan = tree => {
      if (!tree.children || tree.children.length === 0) {
        tree.span = 1;
        return 1;
      }
      let total = 0;
      tree.children.forEach(child => {
        total += computeSpan(child.tree);
      });
      tree.span = Math.max(total, 1);
      return tree.span;
    };
    const H_SPACING = 200;
    const V_SPACING = 110;
    const NODE_HEIGHT = 42;
    const NODE_MIN_WIDTH = 140;
    const PADDING_X = 60;
    const PADDING_Y = 60;
    let canvasMeasureCtx = null;
    const measureNodeWidth = summary => {
      if (typeof document !== "undefined") {
        if (!canvasMeasureCtx) {
          const canvas = document.createElement("canvas");
          canvasMeasureCtx = canvas.getContext("2d");
        }
        if (canvasMeasureCtx) {
          canvasMeasureCtx.font = "600 13px 'JetBrains Mono', 'Menlo', 'Monaco', monospace";
          const typeText = (summary.typeLabel || "").toUpperCase();
          const parts = [typeText];
          if (summary.valueLabel) parts.push(summary.valueLabel);
          if (summary.detailLabel) parts.push(summary.detailLabel);
          const text = parts.join(" ").trim();
          const metrics = canvasMeasureCtx.measureText(text || "node");
          return Math.max(metrics.width + 48, NODE_MIN_WIDTH);
        }
      }
      const fallbackLength = (summary.typeLabel || "").length + (summary.valueLabel || "").length + (summary.detailLabel || "").length;
      return Math.max(fallbackLength * 7 + 48, NODE_MIN_WIDTH);
    };
    const assignPositions = (tree, nodes, nodeMap, edges, depth = 0, offsetSpan = 0) => {
      const span = Math.max(tree.span || 1, 1);
      const spanWidth = span * H_SPACING;
      const x = PADDING_X + offsetSpan + spanWidth / 2;
      const y = PADDING_Y + depth * V_SPACING;
      const width = measureNodeWidth(tree.summary);
      const nodeEntry = {
        id: tree.id,
        summary: tree.summary,
        x,
        y,
        width,
        height: NODE_HEIGHT
      };
      nodes.push(nodeEntry);
      nodeMap.set(tree.id, nodeEntry);
      let childOffset = offsetSpan;
      tree.children.forEach(child => {
        assignPositions(child.tree, nodes, nodeMap, edges, depth + 1, childOffset);
        edges.push({
          from: tree.id,
          to: child.tree.id,
          label: child.label
        });
        childOffset += Math.max(child.tree.span || 1, 1) * H_SPACING;
      });
    };
    return <div>
        {branches.length > 0 || !nobranch ? <div><b>Falls through: </b>{nobranch ? "Yes" : "No"}</div> : null}
        {branches.length > 0 ? <div className="tvm-control-flow-branches">
            {branches.map((branch, index) => {
      const rootSummary = describeContinuation(branch);
      const branchType = (rootSummary.typeLabel || "").toUpperCase();
      const branchTitleText = `Branch -> ${branchType}${rootSummary.valueLabel ? ` ${rootSummary.valueLabel}` : ""}`;
      const tree = buildContinuationTree(branch, `branch-${index}`);
      computeSpan(tree);
      const nodes = [];
      const nodeMap = new Map();
      const edges = [];
      assignPositions(tree, nodes, nodeMap, edges);
      let minX = Infinity;
      let maxX = -Infinity;
      let minY = Infinity;
      let maxY = -Infinity;
      nodes.forEach(node => {
        minX = Math.min(minX, node.x - node.width / 2);
        maxX = Math.max(maxX, node.x + node.width / 2);
        minY = Math.min(minY, node.y - node.height / 2);
        maxY = Math.max(maxY, node.y + node.height / 2);
      });
      const shiftX = Number.isFinite(minX) ? PADDING_X - minX : 0;
      const shiftY = Number.isFinite(minY) ? PADDING_Y - minY : 0;
      if (shiftX || shiftY) {
        nodes.forEach(node => {
          node.x += shiftX;
          node.y += shiftY;
        });
      }
      const canvasWidth = Math.max(maxX - minX + PADDING_X * 2, 260);
      const canvasHeight = Math.max(maxY - minY + PADDING_Y * 2, NODE_HEIGHT + PADDING_Y * 2);
      const edgeLayouts = edges.map((edge, edgeIdx) => {
        const from = nodeMap.get(edge.from);
        const to = nodeMap.get(edge.to);
        if (!from || !to) return null;
        const fromX = from.x;
        const fromY = from.y + from.height / 2;
        const toX = to.x;
        const toY = to.y - to.height / 2;
        const midY = fromY + (toY - fromY) / 2;
        const path = `M ${fromX} ${fromY} C ${fromX} ${midY}, ${toX} ${midY}, ${toX} ${toY}`;
        const labelX = (fromX + toX) / 2;
        const labelY = midY;
        const segments = splitEdgeLabel(edge.label);
        const hasSecondary = Boolean(segments.secondary);
        return {
          id: `${edge.from}->${edge.to}-${edgeIdx}`,
          path,
          labelX,
          labelY,
          segments,
          hasSecondary
        };
      }).filter(Boolean);
      return <div key={`branch-${index}`} className="tvm-control-flow-branch">
                  <div className="tvm-control-flow-branch-header">
                    <span className="tvm-control-flow-branch-title">
                      {highlightMatches(branchTitleText, searchTokens)}
                    </span>
                  </div>
                  <div className="tvm-flow-graph-wrapper">
                    <div className="tvm-flow-canvas" style={{
        width: `${canvasWidth}px`,
        height: `${canvasHeight}px`
      }}>
                      <svg className="tvm-flow-canvas-svg" width={canvasWidth} height={canvasHeight} viewBox={`0 0 ${canvasWidth} ${canvasHeight}`} preserveAspectRatio="xMinYMin meet">
                        <defs>
                          <marker id="tvm-flow-arrowhead" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto" markerUnits="strokeWidth">
                            <path d="M1 1 L7 4 L1 7 Z" fill="currentColor" />
                          </marker>
                        </defs>
                        {edgeLayouts.map(edge => <path key={`edge-path-${edge.id}`} d={edge.path} className="tvm-flow-graph-line" markerEnd="url(#tvm-flow-arrowhead)" />)}
                      </svg>
                      {edgeLayouts.map(edge => edge.segments.primary ? <div key={`edge-label-${edge.id}`} className={`tvm-flow-edge-label${edge.hasSecondary ? ' has-secondary' : ''}`} style={{
        left: `${edge.labelX}px`,
        top: `${edge.labelY}px`
      }}>
                        <span className="tvm-flow-edge-label-primary">
                          {highlightMatches(edge.segments.primary.toUpperCase(), searchTokens)}
                        </span>
                        {edge.segments.secondary && <span className="tvm-flow-edge-label-secondary">
                            {highlightMatches(edge.segments.secondary.toUpperCase(), searchTokens)}
                          </span>}
                      </div> : null)}
                      {nodes.map(node => <div key={node.id} className="tvm-flow-node" style={{
        left: `${node.x}px`,
        top: `${node.y}px`
      }}>
                          <span className="tvm-control-flow-node-pill" style={{
        minWidth: `${node.width}px`
      }}>
                            <span className="tvm-control-flow-node-type">
                              {highlightMatches((node.summary.typeLabel || "").toUpperCase(), searchTokens)}
                            </span>
                            {node.summary.valueLabel && <span className="tvm-control-flow-node-value">
                                {highlightMatches(node.summary.valueLabel, searchTokens)}
                              </span>}
                            {node.summary.detailLabel && <span className="tvm-control-flow-node-extra">
                                {highlightMatches(node.summary.detailLabel, searchTokens)}
                              </span>}
                          </span>
                        </div>)}
                    </div>
                  </div>
                </div>;
    })}
          </div> : <p className="tvm-detail-muted">
            {nobranch ? "Instruction does not modify the current continuation." : "Control flow branches are not documented in the specification."}
          </p>}
      </div>;
  }
  function renderStackEntry(entry, key, mode) {
    if (!entry) return null;
    if (entry.type === "conditional") {
      if (mode === "compact" || mode === "detail-inline") {
        return <span key={key} className="tvm-stack-pill tvm-stack-pill--conditional">
            Conditional: {highlightMatches(String(entry.name || "?"), searchTokens)}
          </span>;
      }
      return <div key={key} className="tvm-stack-conditional">
          <span className="tvm-stack-conditional-name">
            Conditional: {highlightMatches(String(entry.name || "?"), searchTokens)}
          </span>
          {Array.isArray(entry.match) && entry.match.length > 0 ? entry.match.map((matchArm, idx) => <div key={`${key}-match-${idx}`} className="tvm-stack-conditional-branch">
                <span className="tvm-stack-conditional-label">
                  = {highlightMatches(String(matchArm.value ?? ""), searchTokens)}
                </span>
                <div className="tvm-stack-conditional-values">
                  {Array.isArray(matchArm.stack) && matchArm.stack.length > 0 ? matchArm.stack.slice().reverse().map((nested, nestedIdx) => renderStackEntry(nested, `${key}-match-${idx}-item-${nestedIdx}`, "detail-inline")) : <span className="tvm-stack-pill tvm-stack-pill--empty">
                      Empty
                    </span>}
                </div>
              </div>) : <span className="tvm-stack-pill tvm-stack-pill--empty">
              Empty branches
            </span>}
          {Array.isArray(entry.else) && <div className="tvm-stack-conditional-branch">
              <span className="tvm-stack-conditional-label">else</span>
              <div className="tvm-stack-conditional-values">
                {entry.else.length > 0 ? entry.else.slice().reverse().map((nested, nestedIdx) => renderStackEntry(nested, `${key}-else-${nestedIdx}`, "detail-inline")) : <span className="tvm-stack-pill tvm-stack-pill--empty">
                    Empty
                  </span>}
              </div>
            </div>}
        </div>;
    }
    if (entry.type === "array") {
      const label = `${entry.name || "items"}[${entry.length_var ?? ""}]`;
      return <span key={key} className="tvm-stack-pill tvm-stack-pill--array">
          {highlightMatches(label, searchTokens)}
        </span>;
    }
    if (entry.type === "const") {
      const value = entry.value === null ? "null" : entry.value === undefined ? "?" : entry.value;
      return <span key={key} className="tvm-stack-pill tvm-stack-pill--const">
          {highlightMatches(String(value), searchTokens)}: {highlightMatches(String(entry.value_type || "Const"), searchTokens)}
        </span>;
    }
    const valueTypes = Array.isArray(entry.value_types) && entry.value_types.length > 0 ? entry.value_types.join("/") : entry.value_type || "Any";
    const label = entry.name ? `${entry.name}: ${valueTypes}` : valueTypes;
    return <span key={key} className="tvm-stack-pill tvm-stack-pill--simple">
        {highlightMatches(label, searchTokens)}
      </span>;
  }
  function renderStackColumn(title, items, mode = "detail") {
    const safeItems = Array.isArray(items) ? items : [];
    const reversed = safeItems.slice().reverse();
    const limit = mode === "compact" ? 4 : reversed.length;
    const shown = reversed.slice(0, limit);
    const truncated = mode === "compact" && reversed.length > shown.length;
    return <div className={`tvm-stack-column ${mode === "compact" ? "tvm-stack-column--compact" : ""}`}>
        <div className="tvm-stack-column-title">{title}</div>
        <div className="tvm-stack-top">TOP</div>
        <div className="tvm-stack-list">
          {shown.length === 0 && <span className="tvm-stack-empty">Empty</span>}
          {shown.map((entry, idx) => renderStackEntry(entry, `${title}-${idx}`, mode))}
          {truncated && <span className="tvm-stack-pill tvm-stack-pill--more">
              +{reversed.length - shown.length} more
            </span>}
        </div>
      </div>;
  }
  function renderStackColumns(instruction, mode = "detail") {
    const inputs = instruction?.valueFlow?.inputs ?? [];
    const outputs = instruction?.valueFlow?.outputs ?? [];
    return <div className={`tvm-stack-columns ${mode === "compact" ? "tvm-stack-columns--compact" : ""}`}>
        {renderStackColumn("Inputs", inputs, mode)}
        {renderStackColumn("Outputs", outputs, mode)}
      </div>;
  }
  function renderInstructionDetail(instruction, options = {}) {
    const {isAnchorTarget = false, onOpenRawJson = () => {}} = options;
    const hasAliases = Array.isArray(instruction.aliases) && instruction.aliases.length > 0;
    const readsRegisters = Array.isArray(instruction.registers?.inputs) ? instruction.registers.inputs : [];
    const writesRegisters = Array.isArray(instruction.registers?.outputs) ? instruction.registers.outputs : [];
    const hasRegisterInfo = readsRegisters.length > 0 || writesRegisters.length > 0;
    const hasStackData = !instruction.missing.inputs || !instruction.missing.outputs;
    const hasFiftExamples = Array.isArray(instruction.fiftExamples) && instruction.fiftExamples.length > 0;
    const descriptionHtml = highlightHtmlContent(instruction.descriptionHtml || instruction.description || "", searchTokens);
    const implementationRefs = Array.isArray(instruction.implementationRefs) ? instruction.implementationRefs.filter(Boolean) : [];
    const hasImplementation = implementationRefs.length > 0;
    const renderRegisterList = (list, keyPrefix) => {
      const tokens = Array.isArray(list) ? list.map((register, idx) => {
        if (!register) return null;
        if (register.type === "special" && register.name) {
          return <span key={`${keyPrefix}-special-${idx}`} className="tvm-register-token tvm-register-token--special">
                    {register.name}
                  </span>;
        }
        const sub = register.type === "variable" ? register.var_name || "i" : typeof register.index === "number" ? register.index : register.var_name || "?";
        return <span key={`${keyPrefix}-const-${idx}`} className="tvm-register-token">
                  c<sub>{sub}</sub>
                </span>;
      }).filter(Boolean) : [];
      return tokens.flatMap((token, idx) => idx === 0 ? [token] : [<span key={`${keyPrefix}-sep-${idx}`} className="tvm-register-sep">
                ,{" "}
              </span>, token]);
    };
    const badgeNodes = [<span key="gas" className="tvm-detail-badge">
        <span className="tvm-detail-badge-label">Gas</span>{" "}
        <span className="tvm-detail-badge-value">
          {highlightMatches(String(instruction.gasDisplay || "N/A"), searchTokens)}
        </span>
      </span>, <span key="version" className="tvm-detail-badge">
        <span className="tvm-detail-badge-label">TVM</span>{" "}
        <span className="tvm-detail-badge-value">
          {highlightMatches(instruction.since > 0 ? `v${instruction.since}` : "v0", searchTokens)}
        </span>
      </span>];
    if (hasRegisterInfo) {
      if (readsRegisters.length > 0) {
        badgeNodes.push(<span key="registers-read" className="tvm-detail-badge tvm-detail-badge--register">
            <span className="tvm-detail-badge-label">Read registers</span>{" "}
            <span className="tvm-detail-badge-value">
              {renderRegisterList(readsRegisters, "read")}
            </span>
          </span>);
      }
      if (writesRegisters.length > 0) {
        badgeNodes.push(<span key="registers-write" className="tvm-detail-badge tvm-detail-badge--register">
            <span className="tvm-detail-badge-label">Write registers</span>{" "}
            <span className="tvm-detail-badge-value">
              {renderRegisterList(writesRegisters, "write")}
            </span>
          </span>);
      }
    }
    const panelClassName = `tvm-detail-panel${isAnchorTarget ? " is-anchor-target" : ""}`;
    return <div className={panelClassName}>
        <div className="tvm-detail-header">
          <div className="tvm-detail-heading">
            <div className="tvm-detail-header-main">
              <h4 className="tvm-detail-title">{instruction.mnemonic}</h4>
            </div>
          </div>
          <div className="tvm-detail-actions">
            <button type="button" className="tvm-button tvm-button--ghost" onClick={() => onOpenRawJson(instruction)}>
              Raw JSON
            </button>
          </div>
        </div>

        <div className="tvm-detail-columns">
          <div className="tvm-detail-main">
            {descriptionHtml ? <div className="tvm-description" dangerouslySetInnerHTML={{
      __html: descriptionHtml
    }} /> : <p className="tvm-missing-placeholder">Description not available.</p>}

            <div className="tvm-detail-badges">{badgeNodes}</div>

            <div className="tvm-detail-block">
              <span className="tvm-detail-subtitle">Fift command</span>
              {instruction.fift ? <code className="tvm-detail-code tvm-detail-code--inline">
                  {highlightMatches(String(instruction.fift), searchTokens)}
                </code> : <span className="tvm-detail-muted">Not documented.</span>}
            </div>

            <div className="tvm-detail-block">
              <span className="tvm-detail-subtitle">Control flow</span>
              {renderControlFlowSummary(instruction.controlFlow)}
            </div>

            {hasImplementation && <div className="tvm-detail-block">
                <span className="tvm-detail-subtitle">Implementation</span>
                <div className="tvm-impl-badges">
                  {implementationRefs.map((ref, idx) => {
      const filename = ref.file || "source";
      const linePart = typeof ref.line === "number" && ref.line > 0 ? `:${ref.line}` : "";
      const href = buildGitHubLineUrl(ref.path, ref.line);
      return <a key={`${instruction.mnemonic}-impl-${idx}`} className="tvm-detail-badge tvm-detail-badge--link" href={href} target="_blank" rel="noreferrer">
                        {filename}
                        {linePart}
                      </a>;
    })}
                </div>
              </div>}

            {hasFiftExamples && <section className="tvm-detail-section tvm-detail-section--wide">
                <h4 className="tvm-detail-title">Fift examples</h4>
                <div className="tvm-example-list">
                  {instruction.fiftExamples.map((example, idx) => {
      const description = typeof example.description === "string" ? example.description : "";
      const fiftCode = typeof example.fift === "string" ? example.fift : "";
      return <div key={`${instruction.mnemonic}-example-${idx}`} className="tvm-example-item">
                        {description && <p className="tvm-example-description" dangerouslySetInnerHTML={{
        __html: formatInlineMarkdown(description)
      }} />}
                        {fiftCode && <code className="tvm-detail-code tvm-example-code">{fiftCode}</code>}
                      </div>;
    })}
                </div>
              </section>}

            {hasAliases && <section className="tvm-detail-section tvm-detail-section--wide">
                <h4 className="tvm-detail-title">Aliases</h4>
                <div className="tvm-alias-list">
                  {instruction.aliases.map(alias => {
      const aliasDescriptionHtml = cleanAliasDescription(alias.description || "");
      const hasAliasMeta = Boolean(alias.doc_fift) || alias.operands && Object.keys(alias.operands).length > 0;
      return <div key={alias.mnemonic} className="tvm-alias-item">
                        <div className="tvm-alias-headline">
                          <code>{alias.mnemonic}</code>
                          <span className="tvm-alias-meta">
                            alias of <code>{alias.alias_of}</code>
                          </span>
                        </div>
                        {aliasDescriptionHtml && <div className="tvm-alias-description" dangerouslySetInnerHTML={{
        __html: aliasDescriptionHtml
      }} />}
                        {hasAliasMeta && <div className="tvm-alias-meta-row">
                            {alias.doc_fift && <span className="tvm-alias-pill">
                                Fift <code>{alias.doc_fift}</code>
                              </span>}
                            {alias.operands && Object.keys(alias.operands).length > 0 && <span className="tvm-alias-pill">
                                Operands {formatAliasOperands(alias.operands)}
                              </span>}
                          </div>}
                      </div>;
    })}
                </div>
              </section>}
          </div>

          <aside className="tvm-detail-side">
            <div className="tvm-side-block">
              <span className="tvm-side-title">Opcode</span>
              {instruction.tlb ? <code className="tvm-detail-code">
                  {highlightMatches(String(instruction.tlb), searchTokens)}
                </code> : <p className="tvm-missing-placeholder">TL-B layout not available.</p>}
            </div>

            <div className="tvm-side-block">
              <span className="tvm-side-title">Category</span>
              <div className="tvm-side-category-value">
                {highlightMatches(instruction.rawCategoryLabel, searchTokens)}
              </div>
            </div>

            <div className="tvm-side-block">
              <span className="tvm-side-title">Operands</span>
              {Array.isArray(instruction.operands) && instruction.operands.length > 0 ? <div className="tvm-operands-list">
                  {instruction.operands.map((operand, idx) => {
      if (!operand || typeof operand !== "object") return null;
      const summary = highlightMatches(formatOperandSummary(operand), searchTokens);
      const hasRange = operand.min_value !== undefined || operand.max_value !== undefined;
      return <div key={`operand-${idx}`} className="tvm-operands-item">
                        <div className="tvm-operands-line">{summary}</div>
                        {hasRange && <div className="tvm-operands-detail">
                            Range {highlightMatches(String(operand.min_value ?? "?"), searchTokens)} – {highlightMatches(String(operand.max_value ?? "?"), searchTokens)}
                          </div>}
                      </div>;
    })}
                </div> : <p className="tvm-detail-muted">No operands.</p>}
            </div>

            <div className="tvm-side-block">
              <span className="tvm-side-title">Stack</span>
              {hasStackData ? renderStackColumns(instruction, "detail") : <p className="tvm-missing-placeholder">Stack effects not available.</p>}
            </div>
          </aside>
        </div>

        
      </div>;
  }
  const [spec, setSpec] = useState(null);
  const [error, setError] = useState(null);
  const [loading, setLoading] = useState(true);
  const [search, setSearch] = useState("");
  const [category, setCategory] = useState("All");
  const [subcategory, setSubcategory] = useState("All");
  const [sortMode, setSortMode] = useState("opcode");
  const [expanded, setExpanded] = useState({});
  const [copied, setCopied] = useState({});
  const [activeAnchorId, setActiveAnchorId] = useState(null);
  const [rawModalInstruction, setRawModalInstruction] = useState(null);
  const [rawModalCopied, setRawModalCopied] = useState(false);
  const searchInputRef = useRef(null);
  const rawModalCopyTimeoutRef = useRef(null);
  const tableStyles = useMemo(() => `
.tvm-instruction-app {
  --tvm-border: var(--mint-border-color, rgb(var(--gray-400) / 0.24));
  --tvm-border-strong: rgb(var(--gray-400) / 0.32);
  --tvm-surface: var(--mint-surface-elevated, rgb(var(--background-light)));
  --tvm-surface-secondary: rgb(var(--gray-50) / 0.65);
  --tvm-text-primary: var(--mint-text-primary, rgb(var(--gray-800)));
  --tvm-text-secondary: var(--mint-text-secondary, rgb(var(--gray-600) / 0.85));
  --tvm-text-muted: var(--mint-text-tertiary, rgb(var(--gray-400) / 0.68));
  --tvm-accent: rgb(var(--primary));
  --tvm-accent-soft: rgb(var(--primary) / 0.16);
  --tvm-accent-strong: rgb(var(--primary-light));
  --tvm-accent-subtle: rgb(var(--primary-dark));
  --tvm-callout-bg: var(--callout-bg-color, rgb(var(--primary) / 0.12));
  --tvm-callout-border: var(--callout-border-color, rgb(var(--primary) / 0.2));
  --tvm-callout-text: var(--callout-text-color, rgb(var(--primary)));
  --tvm-stack-simple-bg: var(--tvm-accent-soft);
  --tvm-stack-simple-text: var(--tvm-accent-subtle);
  --tvm-stack-const-bg: rgb(var(--primary) / 0.2);
  --tvm-stack-const-text: var(--tvm-accent-subtle);
  --tvm-stack-array-bg: rgb(var(--primary) / 0.2);
  --tvm-stack-array-text: var(--tvm-text-primary);
  --tvm-stack-conditional-bg: rgb(var(--primary-dark) / 0.22);
  --tvm-stack-conditional-text: var(--tvm-accent-subtle);
  --tvm-stack-conditional-border: rgb(var(--primary-dark) / 0.32);
  --tvm-stack-label: var(--mint-text-tertiary, rgb(var(--gray-600) / 0.65));
  --tvm-pill-muted-bg: rgb(var(--gray-400) / 0.12);
  --tvm-row-padding-y: 0.85rem;
  --tvm-row-padding-x: 1rem;
  --tvm-chip-padding-y: 0.2rem;
  --tvm-chip-padding-x: 0.6rem;
  --tvm-control-height: 2.75rem;
  color: var(--tvm-text-primary);
  background: var(--tvm-surface);
  border: 1px solid var(--tvm-border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 24px 60px -40px rgb(var(--gray-900) / 0.9);
}

:where(.dark) .tvm-instruction-app {
  --tvm-border: rgb(var(--gray-800) / 0.65);
  --tvm-border-strong: rgb(var(--gray-600) / 0.85);
  --tvm-surface: rgb(var(--gray-950));
  --tvm-surface-secondary: rgb(var(--gray-900) / 0.85);
  --tvm-text-primary: rgb(var(--gray-100));
  --tvm-text-secondary: rgb(var(--gray-300));
  --tvm-text-muted: rgb(var(--gray-400) / 0.9);
  --tvm-accent: rgb(var(--primary-light));
  --tvm-accent-soft: rgb(var(--primary) / 0.22);
  --tvm-accent-strong: rgb(var(--primary));
  --tvm-accent-subtle: rgb(var(--primary-light));
  --tvm-callout-bg: rgb(var(--primary) / 0.24);
  --tvm-callout-border: rgb(var(--primary-light) / 0.35);
  --tvm-callout-text: rgb(var(--primary-light));
  --tvm-stack-simple-bg: rgb(var(--primary) / 0.25);
  --tvm-stack-simple-text: rgb(var(--primary-light));
  --tvm-stack-const-bg: rgb(var(--primary-dark) / 0.4);
  --tvm-stack-const-text: rgb(var(--primary-light));
  --tvm-stack-array-bg: rgb(var(--primary) / 0.25);
  --tvm-stack-array-text: rgb(var(--gray-50));
  --tvm-stack-conditional-bg: rgb(var(--primary-dark) / 0.38);
  --tvm-stack-conditional-text: rgb(var(--primary-light));
  --tvm-stack-conditional-border: rgb(var(--primary) / 0.5);
  --tvm-stack-label: rgb(var(--gray-400) / 0.85);
  --tvm-pill-muted-bg: rgb(var(--gray-800) / 0.85);
  box-shadow: 0 24px 80px -60px rgb(0 0 0 / 0.65);
  color-scheme: dark;
}

.tvm-instruction-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tvm-toolbar-search {
  display: flex;
}

.tvm-toolbar-search .tvm-field--search {
  flex: 1 1 auto;
}

.tvm-search-row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.tvm-search-row .tvm-search-input {
  flex: 1 1 auto;
}

.tvm-search-row .tvm-toolbar-utilities {
  position: static;
  width: auto;
  align-self: stretch;
  align-items: stretch;
}

.tvm-search-row .tvm-toolbar-utilities .tvm-button {
  height: 100%;
}

.tvm-toolbar-utilities {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  align-self: end;
  width: max-content;
}

.tvm-toolbar-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, max-content));
  gap: 0.75rem;
  align-items: end;
  justify-content: flex-start;
}

.tvm-toolbar-filters .tvm-field {
  min-width: 0;
  width: min(280px, 100%);
}

.tvm-field--sort {
  width: min(240px, 100%);
}

.tvm-field--category {
  width: min(280px, 100%);
}

.tvm-field--subcategory {
  width: min(300px, 100%);
}



.tvm-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 190px;
  flex: 1;
}

.tvm-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tvm-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tvm-field input,
.tvm-field select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--tvm-border);
  padding: 0.55rem 0.75rem;
  background: var(--tvm-surface-secondary);
  color: var(--tvm-text-primary);
  font-size: 0.95rem;
  min-height: var(--tvm-control-height);
}

.tvm-field--search {
  min-width: min(260px, 100%);
}

.tvm-search-input {
  position: relative;
  display: flex;
  align-items: center;
}

.tvm-field--search input {
  padding-left: 2.2rem;
}

.tvm-search-icon {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--tvm-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tvm-search-icon svg {
  width: 100%;
  height: 100%;
}

.tvm-clear-search {
  position: absolute;
  right: 0.5rem;
  border: none;
  background: none;
  color: var(--tvm-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
}

.tvm-clear-search svg {
  width: 14px;
  height: 14px;
}

.tvm-clear-search:hover {
  color: var(--tvm-accent-strong);
}

.tvm-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--tvm-border);
  background: var(--tvm-surface-secondary);
  color: var(--tvm-text-primary);
  font-size: 0.82rem;
  padding: 0 0.95rem;
  min-height: var(--tvm-control-height);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.tvm-button svg {
  width: 16px;
  height: 16px;
}

.tvm-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tvm-button:not(:disabled):hover {
  border-color: var(--tvm-border-strong);
  background: rgb(var(--gray-200) / 0.12);
}

:where(.dark) .tvm-instruction-app .tvm-button:not(:disabled):hover {
  background: rgb(var(--gray-800) / 0.55);
  border-color: var(--tvm-border-strong);
}

.tvm-button--ghost {
  background: transparent;
  color: var(--tvm-text-secondary);
}

.tvm-button--ghost:not(:disabled):hover {
  color: var(--tvm-text-primary);
  background: rgb(var(--gray-200) / 0.1);
}

:where(.dark) .tvm-instruction-app .tvm-button--ghost:not(:disabled):hover {
  background: rgb(var(--gray-800) / 0.4);
  color: var(--tvm-text-primary);
}

.tvm-instruction-meta {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--tvm-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tvm-meta-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.tvm-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tvm-meta-link {
  display: inline-flex;
  align-items: center;
  color: var(--tvm-accent-subtle);
  font-weight: 500;
  text-decoration: none;
  gap: 0.3rem;
}

.tvm-meta-link:hover {
  text-decoration: underline;
}

.tvm-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tvm-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: var(--tvm-chip-padding-y) var(--tvm-chip-padding-x);
  font-size: 0.72rem;
  color: var(--tvm-text-secondary);
  background: var(--tvm-pill-muted-bg);
  border: 1px solid transparent;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out, background 0.2s ease-in-out;
}

.tvm-meta-chip:hover {
  border-color: var(--tvm-border-strong);
  color: var(--tvm-text-primary);
}

.tvm-meta-chip:focus-visible {
  outline: 2px solid var(--tvm-accent-strong);
  outline-offset: 2px;
}

.tvm-meta-chip-label {
  white-space: nowrap;
}

.tvm-meta-chip-close {
  font-size: 0.85em;
  line-height: 1;
}

.tvm-highlight {
  display: inline;
  background: rgb(var(--primary) / 0.22);
  color: inherit;
  border-radius: 4px;
  padding: 0 0.08em;
  line-height: inherit;
  box-decoration-break: clone;
}

.tvm-spec-grid-container {
  border: 1px solid var(--tvm-border);
  border-radius: 12px;
  background: var(--tvm-surface-secondary);
  box-shadow: inset 0 1px 0 rgb(var(--gray-400) / 0.08);
}

.tvm-spec-grid-scroll {
  overflow-x: auto;
}

.tvm-spec-grid-scroll::-webkit-scrollbar {
  height: 6px;
}

.tvm-spec-grid-scroll::-webkit-scrollbar-thumb {
  background: var(--tvm-border-strong);
  border-radius: 999px;
}

.tvm-spec-header,
.tvm-spec-row {
  --tvm-grid-template: 60px 110px 260px minmax(320px, 2fr);
  display: grid;
  grid-template-columns: var(--tvm-grid-template);
  min-width: 860px;
}

.tvm-spec-header {
  background: rgb(var(--gray-400) / 0.12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--tvm-text-secondary);
}

:where(.dark) .tvm-instruction-app .tvm-spec-header {
  background: rgb(var(--gray-800) / 0.65);
  color: var(--tvm-text-muted);
}

.tvm-spec-header > div {
  padding: calc(var(--tvm-row-padding-y) - 0.1rem) var(--tvm-row-padding-x);
  font-weight: 600;
}

.tvm-spec-row {
  border-top: 1px solid var(--tvm-border);
  transition: background 0.2s ease-in-out;
  cursor: pointer;
  align-items: center;
}

.tvm-spec-row:hover {
  background: rgb(var(--primary) / 0.08);
}

.tvm-spec-row.is-expanded {
  background: rgb(var(--primary) / 0.12);
}

:where(.dark) .tvm-instruction-app .tvm-spec-row:hover {
  background: rgb(var(--primary) / 0.18);
}

:where(.dark) .tvm-instruction-app .tvm-spec-row.is-expanded {
  background: rgb(var(--primary) / 0.26);
}

.tvm-spec-row.is-anchor-target {
  background: rgb(var(--primary) / 0.16);
  box-shadow: inset 0 0 0 1px var(--tvm-accent-strong);
}

.tvm-spec-row--detail.is-anchor-target {
  background: rgb(var(--primary) / 0.1);
}

.tvm-spec-row--detail {
  cursor: default;
  background: var(--tvm-surface-secondary);
  align-items: stretch;
}

.tvm-spec-cell {
  padding: var(--tvm-row-padding-y) var(--tvm-row-padding-x);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  color: var(--tvm-text-primary);
}

.tvm-spec-cell--full {
  grid-column: 1 / -1;
}

.tvm-spec-cell--opcode {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  justify-content: center;
  align-items: center;
}

.tvm-spec-cell--anchor {
  justify-content: center;
  align-items: center;
}

.tvm-spec-cell--name {
  gap: 0.4rem;
}

.tvm-name-line {
  position: relative;
}

.tvm-copy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--tvm-border);
  background: var(--tvm-surface-secondary);
  color: var(--tvm-text-secondary);
  cursor: pointer;
}

.tvm-copy-link:hover {
  border-color: var(--tvm-border-strong);
}

.tvm-copy-link svg {
  width: 14px;
  height: 14px;
}

.tvm-copy-link.is-copied {
  border-color: var(--tvm-accent-strong);
  background: var(--tvm-accent-soft);
  color: var(--tvm-accent-strong);
}

.tvm-name-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tvm-row-indicator {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--tvm-text-muted);
  transition: transform 0.2s ease-in-out, color 0.2s ease-in-out, background 0.2s ease-in-out;
  pointer-events: none;
}

.tvm-row-indicator svg {
  width: 14px;
  height: 14px;
}

.tvm-spec-row:hover .tvm-row-indicator {
  background: var(--tvm-pill-muted-bg);
  color: var(--tvm-text-secondary);
}

.tvm-spec-row.is-anchor-target .tvm-row-indicator {
  color: var(--tvm-accent-strong);
}

.tvm-row-indicator.is-expanded {
  transform: rotate(180deg);
  color: var(--tvm-accent-strong);
}

.tvm-mnemonic {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tvm-text-primary);
  white-space: pre;
}

.tvm-spec-cell--gas {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  justify-content: center;
  color: var(--tvm-text-secondary);
}

.tvm-spec-cell--description p {
  margin: 0;
}

.tvm-description p {
  margin: 0;
}

.tvm-description {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--tvm-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tvm-description-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tvm-category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--tvm-accent-soft);
  color: var(--tvm-accent-subtle);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.tvm-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--tvm-accent-soft);
  color: var(--tvm-accent-subtle);
}

.tvm-inline-badge--muted {
  background: var(--tvm-pill-muted-bg);
  color: var(--tvm-text-secondary);
}

.tvm-fift {
  font-size: 0.78rem;
  color: var(--tvm-text-secondary);
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
}

.tvm-operands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tvm-operand-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--tvm-border);
  background: var(--tvm-pill-muted-bg);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  color: var(--tvm-text-secondary);
}

.tvm-stack-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.tvm-stack-column {
  background: var(--tvm-surface-secondary);
  border: 1px solid rgb(var(--gray-400) / 0.35);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  min-width: 0;
}

.tvm-stack-column--compact {
  padding: 0.5rem 0.55rem;
}

.tvm-stack-column-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tvm-text-secondary);
  margin-bottom: 0.35rem;
}

.tvm-stack-top {
  font-size: 0.7rem;
  color: var(--tvm-text-muted);
  margin-bottom: 0.35rem;
}

.tvm-stack-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tvm-stack-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  width: fit-content;
}

.tvm-instruction-app.is-density-compact .tvm-stack-pill {
  font-size: 0.7rem;
  padding: 0.14rem 0.35rem;
}

.tvm-stack-pill--simple {
  background: var(--tvm-stack-simple-bg);
  color: var(--tvm-stack-simple-text);
}

.tvm-stack-pill--const {
  background: var(--tvm-stack-const-bg);
  color: var(--tvm-stack-const-text);
}

.tvm-stack-pill--array {
  background: var(--tvm-stack-array-bg);
  color: var(--tvm-stack-array-text);
}

.tvm-stack-pill--conditional {
  background: var(--tvm-stack-conditional-bg);
  color: var(--tvm-stack-conditional-text);
}

.tvm-stack-pill--empty {
  background: var(--tvm-pill-muted-bg);
  color: var(--tvm-text-secondary);
}

.tvm-stack-pill--more {
  background: rgb(var(--gray-400) / 0.18);
  color: var(--tvm-text-secondary);
}

:where(.dark) .tvm-instruction-app .tvm-stack-pill--more {
  background: rgb(var(--gray-700) / 0.5);
  color: var(--tvm-text-secondary);
}

.tvm-stack-footnote {
  display: inline-block;
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.75rem;
  background: rgb(var(--gray-200) / 0.12);
  border: 1px solid var(--tvm-border);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  color: var(--tvm-text-secondary);
  max-width: 100%;
  overflow-wrap: anywhere;
}

:where(.dark) .tvm-instruction-app .tvm-stack-footnote {
  background: rgb(var(--gray-900) / 0.6);
  border-color: var(--tvm-border);
  color: var(--tvm-text-secondary);
}

.tvm-stack-conditional {
  border-left: 2px solid var(--tvm-stack-conditional-border);
  padding-left: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tvm-stack-conditional-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tvm-stack-conditional-text);
}

.tvm-stack-conditional-branch {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tvm-stack-conditional-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tvm-stack-label);
}

.tvm-stack-conditional-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tvm-stack-array {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tvm-stack-array-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding-left: 0.4rem;
}

.tvm-stack-empty {
  font-size: 0.78rem;
  color: var(--tvm-text-secondary);
}

.tvm-detail-panel {
  background: var(--tvm-surface);
  border: 1px solid var(--tvm-border);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.25rem;
  box-shadow: 0 18px 40px -30px rgb(var(--gray-900) / 0.7);
}

.tvm-detail-panel.is-anchor-target {
  border-color: var(--tvm-accent-strong);
  box-shadow: 0 0 0 2px var(--tvm-accent-soft), 0 18px 40px -30px rgb(var(--gray-900) / 0.7);
}

.tvm-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tvm-detail-header-main {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tvm-detail-heading {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-start;
  flex: 1 1 auto;
}

.tvm-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.tvm-detail-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tvm-text-secondary);
}

.tvm-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tvm-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--tvm-border);
  border-radius: 999px;
  background: var(--tvm-surface-secondary);
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  color: var(--tvm-text-primary);
}

.tvm-detail-badge-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tvm-text-secondary);
}

.tvm-detail-badge-value {
  font-weight: 600;
  display: inline-flex;
  gap: 0.2rem;
  color: var(--tvm-text-primary);
}

.tvm-detail-badge--register {
  background: rgb(var(--primary) / 0.08);
  border-color: rgb(var(--primary) / 0.2);
}

.tvm-register-token {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.82rem;
  color: var(--tvm-text-primary);
}

.tvm-register-token sub {
  font-size: 0.7em;
}

.tvm-register-token--special {
  font-weight: 600;
  text-transform: uppercase;
}

.tvm-register-sep {
  color: var(--tvm-text-secondary);
}

.tvm-detail-columns {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.tvm-detail-main {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tvm-detail-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--tvm-surface-secondary);
  border: 1px solid var(--tvm-border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.tvm-detail-main .tvm-description {
  display: block;
  color: var(--tvm-text-primary);
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
  overflow: visible;
}

.tvm-detail-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tvm-text-secondary);
}

.tvm-detail-fift {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tvm-detail-code {
  display: block;
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  background: rgb(var(--gray-200) / 0.08);
  border: 1px solid var(--tvm-border);
  border-radius: 8px;
  padding: 0.6rem 0.65rem;
  color: var(--tvm-text-primary);
  overflow-x: auto;
  max-width: 100%;
}

.tvm-detail-code--inline {
  display: block;
  padding: 0.5rem 0.6rem;
  word-break: break-word;
}

.tvm-detail-muted {
  margin: 0;
  font-size: 0.78rem;
  color: var(--tvm-text-secondary);
}

.tvm-detail-side {
  flex: 0 1 300px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tvm-side-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--tvm-surface-secondary);
  border: 1px solid rgb(var(--gray-400) / 0.3);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.tvm-side-category-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tvm-text-primary);
}

.tvm-side-category-raw {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--tvm-text-secondary);
  margin-left: 0.3rem;
}

.tvm-side-title {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tvm-text-secondary);
}

.tvm-detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--tvm-surface-secondary);
  border: 1px solid rgb(var(--gray-400) / 0.3);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.9rem;
}

.tvm-detail-section--wide {
  margin-bottom: 0.9rem;
}

.tvm-operands-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tvm-operands-item {
  background: var(--tvm-surface);
  border: 1px solid rgb(var(--gray-400) / 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tvm-operands-line {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--tvm-text-primary);
}

.tvm-operands-detail {
  font-size: 0.78rem;
  color: var(--tvm-text-secondary);
}

.tvm-impl-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tvm-detail-badge--link {
  text-decoration: none;
  color: var(--tvm-text-primary);
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.tvm-detail-badge--link:hover {
  border-color: var(--tvm-accent);
  color: var(--tvm-accent);
}

.tvm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.tvm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(var(--gray-900) / 0.45);
  backdrop-filter: blur(1px);
}

.tvm-modal-dialog {
  position: relative;
  background: var(--tvm-surface);
  border: 1px solid var(--tvm-border);
  border-radius: 14px;
  box-shadow: 0 32px 90px -40px rgb(var(--gray-900) / 0.9);
  width: min(720px, 100%);
  max-height: calc(100% - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem 1.3rem;
  color: var(--tvm-text-primary);
}

.tvm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.tvm-modal-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tvm-modal-header-text h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--tvm-text-primary);
}

.tvm-modal-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tvm-text-secondary);
}

.tvm-modal-subtitle code {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.82rem;
  padding: 0.1rem 0.3rem;
  border-radius: 0.4rem;
  background: var(--tvm-pill-muted-bg);
  color: var(--tvm-text-primary);
}

.tvm-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.tvm-modal-code {
  flex: 1 1 auto;
  margin: 0;
  border: 1px solid var(--tvm-border-strong);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  background: rgb(var(--gray-200) / 0.16);
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre;
  color: var(--tvm-text-primary);
  tab-size: 2;
}

:where(.dark) .tvm-instruction-app .tvm-modal-code {
  background: rgb(var(--gray-900) / 0.7);
}

@media (max-width: 1040px) {
  .tvm-instruction-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tvm-toolbar-utilities {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .tvm-spec-grid-scroll {
    overflow-x: visible;
  }

  .tvm-spec-header {
    display: none;
  }

  .tvm-spec-row,
  .tvm-spec-row--detail {
    --tvm-grid-template: 48px minmax(0, 1fr);
    grid-template-columns: var(--tvm-grid-template);
    min-width: 0;
    align-items: start;
  }

  .tvm-spec-row .tvm-spec-cell--anchor {
    grid-row: span 2;
  }

  .tvm-spec-row .tvm-spec-cell--opcode {
    grid-row: 1;
    grid-column: 2 / -1;
    justify-content: flex-start;
    align-items: baseline;
  }

  .tvm-spec-row .tvm-spec-cell--name {
    grid-column: 2 / -1;
  }

  .tvm-spec-row .tvm-spec-cell--description {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .tvm-detail-header {
    align-items: stretch;
  }

  .tvm-detail-columns {
    flex-direction: column;
  }

  .tvm-detail-section {
    margin-bottom: 0.8rem;
  }
}

@media (max-width: 720px) {
  .tvm-detail-panel {
    padding: 0.95rem 1rem 1.1rem;
  }

  .tvm-side-block,
  .tvm-detail-section {
    padding: 0.85rem 0.9rem;
  }

  .tvm-detail-actions {
    width: 100%;
    justify-content: stretch;
  }

  .tvm-detail-actions .tvm-button {
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .tvm-modal {
    padding: 0.75rem;
  }

  .tvm-modal-dialog {
    width: 100%;
    max-height: calc(100% - 1.5rem);
    padding: 1rem;
  }

  .tvm-modal-actions {
    width: 100%;
    justify-content: stretch;
  }

  .tvm-modal-actions .tvm-button {
    flex: 1 1 auto;
  }
}

.tvm-control-flow {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--tvm-border);
  background: var(--tvm-surface-secondary);
}

.tvm-control-flow-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--tvm-text-secondary);
}

.tvm-control-flow-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tvm-control-flow-value {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--tvm-text-primary);
}

.tvm-control-flow-branches {
  list-style: none;
  margin: 0;
  margin-top: 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tvm-control-flow-branch {
  background: var(--tvm-surface);
  border: 1px solid rgb(var(--gray-400) / 0.35);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tvm-control-flow-branch-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.tvm-control-flow-branch-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--tvm-text-primary);
}

.tvm-control-flow-branch-condition {
  font-size: 0.76rem;
  color: var(--tvm-text-secondary);
}


.tvm-flow-graph-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
  padding: 0.35rem 0;
}

.tvm-flow-canvas {
  position: relative;
  display: inline-block;
  min-height: 120px;
  min-width: 100%;
}

.tvm-flow-canvas-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tvm-flow-graph-line {
  fill: none;
  stroke: rgb(var(--primary) / 0.45);
  stroke-width: 1.6;
}


.tvm-flow-node {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.tvm-flow-edge-label {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--primary) / 0.2);
  background: var(--tvm-surface);
}

.tvm-flow-edge-label.has-secondary {
  background: linear-gradient(
    90deg,
    rgb(var(--primary) / 0.08) 0%,
    rgb(var(--primary) / 0.08) 50%,
    rgb(var(--primary) / 0.04) 50%,
    rgb(var(--primary) / 0.04) 100%
  );
}

.tvm-flow-edge-label-primary {
  color: rgb(var(--primary));
}

.tvm-flow-edge-label-secondary {
  color: rgb(var(--primary) / 0.55);
}

.tvm-control-flow-node-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgb(var(--primary) / 0.25);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  background: rgb(var(--primary) / 0.05);
  white-space: nowrap;
}

.tvm-control-flow-node-type {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.66rem;
  font-weight: 600;
  color: rgb(var(--primary) / 0.9);
}

.tvm-control-flow-node-value {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.66rem;
  color: var(--tvm-text-primary);
}

.tvm-control-flow-node-extra {
  font-size: 0.72rem;
  color: var(--tvm-text-secondary);
}

.tvm-missing-placeholder {
  margin: 0;
  font-size: 0.78rem;
  color: var(--tvm-callout-text);
  background: rgb(var(--primary) / 0.04);
  border: 1px solid rgb(var(--primary) / 0.12);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
}

.tvm-example-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tvm-example-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--tvm-surface);
  border: 1px solid rgb(var(--gray-400) / 0.28);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.tvm-example-description {
  margin: 0;
  font-size: 0.82rem;
  color: var(--tvm-text-primary);
}

.tvm-example-description a {
  color: var(--tvm-accent);
  text-decoration: none;
}

.tvm-example-description a:hover {
  text-decoration: underline;
}

.tvm-example-code {
  white-space: pre-wrap;
}



.tvm-alias-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tvm-alias-item {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--tvm-surface-secondary);
  border: 1px solid var(--tvm-border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.tvm-alias-headline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.tvm-alias-headline code {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--tvm-text-primary);
}

.tvm-alias-meta {
  font-size: 0.75rem;
  color: var(--tvm-text-secondary);
}

.tvm-alias-description {
  margin: 0;
  font-size: 0.82rem;
  color: var(--tvm-text-secondary);
}

.tvm-alias-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tvm-alias-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  background: var(--tvm-pill-muted-bg);
  color: var(--tvm-text-secondary);
  font-size: 0.72rem;
}

.tvm-alias-pill code {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
}

.tvm-loading-row,
.tvm-empty-row,
.tvm-error-row {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.92rem;
  color: var(--tvm-text-secondary);
}

.tvm-error-row {
  color: var(--tvm-accent-strong);
}

@media (max-width: 1024px) {
  .tvm-instruction-app {
    padding: 1.1rem;
  }

  .tvm-spec-header,
  .tvm-spec-row {
    --tvm-grid-template: 48px 95px 220px minmax(280px, 2fr);
    min-width: 720px;
  }
}

@media (max-width: 768px) {
  .tvm-field {
    width: 100%;
    min-width: 0;
  }

  .tvm-toolbar-filters {
    grid-template-columns: 1fr;
  }

  .tvm-toolbar-utilities {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .tvm-toolbar-divider {
    display: none;
  }

  .tvm-meta-items {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .tvm-stack-columns {
    flex-direction: column;
  }
}
`, []);
  const searchTokens = useMemo(() => createSearchTokens(search), [search]);
  useEffect(() => {
    let cancelled = false;
    async function load() {
      try {
        setLoading(true);
        setError(null);
        const response = await fetch(SPEC_URL);
        if (!response.ok) {
          throw new Error(`Failed to load spec (${response.status})`);
        }
        const payload = await response.json();
        if (!cancelled) {
          setSpec(payload);
          setLoading(false);
          return;
        }
      } catch (cause) {
        if (!cancelled) {
          setError(cause instanceof Error ? cause.message : "Unknown error");
        }
      } finally {
        if (!cancelled) {
          setLoading(false);
        }
      }
    }
    load();
    return () => {
      cancelled = true;
    };
  }, []);
  useEffect(() => {
    setExpanded({});
  }, [spec]);
  useEffect(() => {
    if (typeof window === "undefined") return;
    try {
      const raw = window.localStorage.getItem(PERSIST_KEY);
      if (!raw) return;
      const prefs = JSON.parse(raw);
      if (prefs && typeof prefs === "object") {
        if (typeof prefs.search === "string") setSearch(prefs.search);
        if (typeof prefs.category === "string" && (prefs.category === "All" || CATEGORY_GROUP_KEYS.has(prefs.category))) {
          setCategory(prefs.category);
        }
        if (typeof prefs.subcategory === "string") {
          setSubcategory(prefs.subcategory);
        }
        if (typeof prefs.sortMode === "string" && ["opcode", "name", "category", "since"].includes(prefs.sortMode)) {
          setSortMode(prefs.sortMode);
        }
      }
    } catch (err) {}
  }, []);
  useEffect(() => {
    if (typeof window === "undefined") return;
    try {
      const payload = JSON.stringify({
        search,
        category,
        subcategory,
        sortMode
      });
      window.localStorage.setItem(PERSIST_KEY, payload);
    } catch (err) {}
  }, [search, category, subcategory, sortMode]);
  useEffect(() => {
    if (typeof window === "undefined") return;
    const handler = event => {
      if (event.defaultPrevented || event.key !== "/") return;
      if (event.altKey || event.ctrlKey || event.metaKey) return;
      const active = document.activeElement;
      if (active) {
        const tagName = active.tagName ? active.tagName.toLowerCase() : "";
        if (tagName === "input" || tagName === "textarea" || active.isContentEditable) {
          return;
        }
      }
      event.preventDefault();
      if (searchInputRef.current && typeof searchInputRef.current.focus === "function") {
        searchInputRef.current.focus();
      }
    };
    window.addEventListener("keydown", handler);
    return () => window.removeEventListener("keydown", handler);
  }, []);
  useEffect(() => {
    if (typeof window === "undefined") return;
    const syncHash = () => {
      const hash = window.location.hash ? window.location.hash.slice(1) : "";
      if (!hash) {
        setActiveAnchorId(null);
        return;
      }
      try {
        setActiveAnchorId(decodeURIComponent(hash));
      } catch (_err) {
        setActiveAnchorId(hash);
      }
    };
    syncHash();
    window.addEventListener("hashchange", syncHash);
    return () => window.removeEventListener("hashchange", syncHash);
  }, []);
  const instructions = useMemo(() => {
    if (!spec) {
      return [];
    }
    const aliasByMnemonic = new Map();
    const aliases = Array.isArray(spec.aliases) ? spec.aliases : [];
    aliases.forEach(alias => {
      if (!alias || !alias.alias_of) return;
      const list = aliasByMnemonic.get(alias.alias_of) || [];
      list.push(alias);
      aliasByMnemonic.set(alias.alias_of, list);
    });
    return (Array.isArray(spec.instructions) ? spec.instructions : []).map((raw, idx) => {
      const doc = raw.doc || ({});
      const bytecode = raw.bytecode || ({});
      const valueFlow = raw.value_flow || ({});
      const inputs = Array.isArray(valueFlow.inputs?.stack) ? valueFlow.inputs.stack : [];
      const outputs = Array.isArray(valueFlow.outputs?.stack) ? valueFlow.outputs.stack : [];
      const registersIn = Array.isArray(valueFlow.inputs?.registers) ? valueFlow.inputs.registers : [];
      const registersOut = Array.isArray(valueFlow.outputs?.registers) ? valueFlow.outputs.registers : [];
      const categoryKeyRaw = doc.category || "uncategorized";
      const categoryGroup = resolveCategoryGroup(categoryKeyRaw);
      const categoryGroupKey = categoryGroup.key;
      const categoryGroupLabel = categoryGroup.label;
      const rawCategoryLabel = humanizeCategoryKey(categoryKeyRaw);
      const descriptionMissing = !doc.description;
      const stackDocMissing = !doc.stack;
      const gasMissing = !doc.gas;
      const tlbMissing = !bytecode.tlb;
      const inputsMissing = !Array.isArray(valueFlow.inputs?.stack);
      const outputsMissing = !Array.isArray(valueFlow.outputs?.stack);
      const implementationRefs = extractImplementationRefs(raw.implementation);
      const implementationMissing = implementationRefs.length === 0;
      const controlFlowMissing = !raw.control_flow || !Array.isArray(raw.control_flow.branches);
      const opcode = bytecode.prefix || "";
      const anchorId = buildAnchorId({
        opcode,
        mnemonic: raw.mnemonic
      });
      return {
        uid: `${raw.mnemonic}__${opcode || 'nop'}__${idx}`,
        mnemonic: raw.mnemonic,
        since: typeof raw.since_version === "number" ? raw.since_version : 0,
        anchorId,
        categoryKey: categoryGroupKey,
        categoryLabel: categoryGroupLabel,
        rawCategoryKey: categoryKeyRaw,
        rawCategoryLabel,
        description: doc.description || "",
        descriptionHtml: typeof doc.description_html === "string" ? doc.description_html : "",
        fift: doc.fift || "",
        fiftExamples: Array.isArray(doc.fift_examples) ? doc.fift_examples.map(example => example && typeof example === "object" ? {
          description: typeof example.description === "string" ? example.description : "",
          fift: typeof example.fift === "string" ? example.fift : ""
        } : null).filter(example => example && (example.description || example.fift)) : [],
        gas: doc.gas || "",
        gasDisplay: formatGasDisplay(doc.gas),
        stackDoc: doc.stack || "",
        opcode,
        tlb: bytecode.tlb || "",
        operands: Array.isArray(bytecode.operands) ? bytecode.operands : [],
        valueFlow: {
          inputs,
          outputs
        },
        registers: {
          inputs: registersIn,
          outputs: registersOut
        },
        controlFlow: raw.control_flow || null,
        implementationRefs,
        rawSpec: raw,
        aliases: aliasByMnemonic.get(raw.mnemonic) || [],
        missing: {
          description: descriptionMissing,
          gas: gasMissing,
          tlb: tlbMissing,
          stackDoc: stackDocMissing,
          inputs: inputsMissing,
          outputs: outputsMissing,
          implementation: implementationMissing,
          controlFlow: controlFlowMissing
        }
      };
    });
  }, [spec]);
  const anchorInstruction = useMemo(() => {
    if (!activeAnchorId) return null;
    return instructions.find(item => item.anchorId === activeAnchorId) || null;
  }, [instructions, activeAnchorId]);
  useEffect(() => {
    if (!anchorInstruction) return;
    setExpanded(prev => {
      if (prev[anchorInstruction.uid]) return prev;
      return {
        ...prev,
        [anchorInstruction.uid]: true
      };
    });
  }, [anchorInstruction]);
  useEffect(() => {
    if (!anchorInstruction) return;
    if (typeof document === "undefined" || typeof window === "undefined") return;
    if (!anchorInstruction.anchorId) return;
    const frame = typeof window.requestAnimationFrame === "function" ? window.requestAnimationFrame.bind(window) : cb => setTimeout(cb, 0);
    frame(() => {
      const element = document.getElementById(anchorInstruction.anchorId);
      if (element && typeof element.scrollIntoView === "function") {
        element.scrollIntoView({
          behavior: "smooth",
          block: "start"
        });
      }
    });
  }, [anchorInstruction]);
  const subcategoryMap = useMemo(() => {
    const groups = new Map();
    instructions.forEach(item => {
      if (!item || !item.categoryKey) return;
      const groupKey = item.categoryKey;
      const rawKey = item.rawCategoryKey || "uncategorized";
      const label = item.rawCategoryLabel || humanizeCategoryKey(rawKey);
      if (!groups.has(groupKey)) {
        groups.set(groupKey, new Map());
      }
      const entries = groups.get(groupKey);
      if (!entries.has(rawKey)) {
        entries.set(rawKey, {
          value: rawKey,
          label,
          count: 0
        });
      }
      const record = entries.get(rawKey);
      record.count += 1;
      if (!record.label && label) {
        record.label = label;
      }
    });
    const normalized = new Map();
    groups.forEach((entries, key) => {
      const list = Array.from(entries.values()).sort((a, b) => a.label.localeCompare(b.label));
      normalized.set(key, list);
    });
    return normalized;
  }, [instructions]);
  const categoryOptions = useMemo(() => {
    const present = new Set(subcategoryMap.keys());
    const ordered = CATEGORY_GROUPS.filter(group => present.has(group.key)).map(group => ({
      value: group.key,
      label: group.label
    }));
    return [{
      value: "All",
      label: "All categories"
    }, ...ordered];
  }, [subcategoryMap]);
  const currentSubcategoryOptions = useMemo(() => {
    if (category === "All") return [];
    return subcategoryMap.get(category) || [];
  }, [subcategoryMap, category]);
  const showSubcategorySelect = category !== "All" && currentSubcategoryOptions.length > 1;
  useEffect(() => {
    if (category === "All") return;
    const hasSelection = categoryOptions.some(option => option.value === category);
    if (!hasSelection) {
      setCategory("All");
    }
  }, [categoryOptions, category]);
  useEffect(() => {
    if (category === "All") {
      if (subcategory !== "All") {
        setSubcategory("All");
      }
      return;
    }
    const options = currentSubcategoryOptions;
    if (!options || options.length <= 1) {
      if (subcategory !== "All") {
        setSubcategory("All");
      }
      return;
    }
    const hasSubcategory = options.some(option => option.value === subcategory);
    if (!hasSubcategory) {
      setSubcategory("All");
    }
  }, [category, subcategory, currentSubcategoryOptions]);
  const filtered = useMemo(() => {
    const forcedUid = anchorInstruction?.uid ?? null;
    return instructions.filter(item => {
      if (forcedUid && item.uid === forcedUid) return true;
      if (category !== "All" && item.categoryKey !== category) return false;
      if (category !== "All" && subcategory !== "All" && item.rawCategoryKey !== subcategory) {
        return false;
      }
      return itemRelevanceScore(item, searchTokens) !== Infinity;
    });
  }, [instructions, category, subcategory, searchTokens, anchorInstruction]);
  const sorted = useMemo(() => {
    const copy = filtered.slice();
    const hasQuery = searchTokens.length > 0;
    if (hasQuery) {
      const tokens = searchTokens;
      copy.sort((a, b) => {
        const sa = itemRelevanceScore(a, tokens);
        const sb = itemRelevanceScore(b, tokens);
        if (sa !== sb) return sa - sb;
        return a.mnemonic.localeCompare(b.mnemonic) || compareOpcodes(a.opcode, b.opcode);
      });
    } else if (sortMode !== "opcode") {
      copy.sort((a, b) => {
        switch (sortMode) {
          case "name":
            return a.mnemonic.localeCompare(b.mnemonic);
          case "category":
            return a.categoryLabel.localeCompare(b.categoryLabel) || a.opcode.localeCompare(b.opcode);
          case "since":
            return (b.since == 9999 ? -1 : b.since) - (a.since == 9999 ? -1 : a.since);
          default:
            return compareOpcodes(a.opcode, b.opcode) || a.mnemonic.localeCompare(b.mnemonic);
        }
      });
    }
    const forcedUid = anchorInstruction?.uid ?? null;
    if (forcedUid) {
      let forcedItem = null;
      const forcedIndex = copy.findIndex(item => item.uid === forcedUid);
      if (forcedIndex >= 0) {
        [forcedItem] = copy.splice(forcedIndex, 1);
      } else if (anchorInstruction) {
        forcedItem = anchorInstruction;
      }
      if (forcedItem) {
        copy.unshift(forcedItem);
      }
    }
    return copy;
  }, [filtered, sortMode, searchTokens, anchorInstruction]);
  const hasActiveFilters = useMemo(() => searchTokens.length > 0 || category !== "All" || subcategory !== "All" || sortMode !== "opcode", [searchTokens, category, subcategory, sortMode]);
  const handleResetFilters = useCallback(() => {
    setSearch("");
    setCategory("All");
    setSubcategory("All");
    setSortMode("opcode");
  }, []);
  const activeFilters = useMemo(() => {
    const chips = [];
    const searchDisplay = search.trim();
    if (searchTokens.length > 0 && searchDisplay) {
      chips.push({
        key: "search",
        label: `Query: "${searchDisplay}"`,
        ariaLabel: `Remove search filter ${searchDisplay}`,
        onRemove: () => setSearch("")
      });
    }
    if (category !== "All") {
      const match = categoryOptions.find(option => option.value === category);
      const label = match ? match.label : humanizeCategoryKey(category);
      chips.push({
        key: "category",
        label: `Category: ${label}`,
        ariaLabel: `Remove category filter ${label}`,
        onRemove: () => setCategory("All")
      });
    }
    if (category !== "All" && subcategory !== "All") {
      const match = currentSubcategoryOptions.find(option => option.value === subcategory);
      const label = match ? match.label : humanizeCategoryKey(subcategory);
      chips.push({
        key: "subcategory",
        label: `Subcategory: ${label}`,
        ariaLabel: `Remove subcategory filter ${label}`,
        onRemove: () => setSubcategory("All")
      });
    }
    if (sortMode !== "opcode") {
      const sortLabels = {
        since: "Newest"
      };
      const label = sortLabels[sortMode] || "Opcode";
      chips.push({
        key: "sort",
        label: `Sort: ${label}`,
        ariaLabel: `Remove sort override ${label}`,
        onRemove: () => setSortMode("opcode")
      });
    }
    return chips;
  }, [searchTokens, search, category, subcategory, categoryOptions, currentSubcategoryOptions, sortMode, setSearch, setCategory, setSubcategory, setSortMode]);
  const toggleRow = useCallback(uid => {
    setExpanded(prev => ({
      ...prev,
      [uid]: !prev[uid]
    }));
  }, []);
  const openRawJsonModal = useCallback(instruction => {
    if (!instruction) return;
    const payload = {
      mnemonic: instruction.mnemonic,
      opcode: instruction.opcode,
      anchorId: instruction.anchorId,
      raw: instruction.rawSpec || instruction
    };
    setRawModalInstruction(payload);
    setRawModalCopied(false);
    if (rawModalCopyTimeoutRef.current) {
      clearTimeout(rawModalCopyTimeoutRef.current);
      rawModalCopyTimeoutRef.current = null;
    }
  }, []);
  const closeRawJsonModal = useCallback(() => {
    setRawModalInstruction(null);
    setRawModalCopied(false);
    if (rawModalCopyTimeoutRef.current) {
      clearTimeout(rawModalCopyTimeoutRef.current);
      rawModalCopyTimeoutRef.current = null;
    }
  }, []);
  const handleCopyRawJson = useCallback(jsonText => {
    copyPlainText(jsonText).then(() => {
      setRawModalCopied(true);
      if (rawModalCopyTimeoutRef.current) {
        clearTimeout(rawModalCopyTimeoutRef.current);
      }
      rawModalCopyTimeoutRef.current = setTimeout(() => {
        setRawModalCopied(false);
        rawModalCopyTimeoutRef.current = null;
      }, 1500);
    }).catch(() => {});
  }, []);
  useEffect(() => {
    if (!rawModalInstruction) return;
    if (typeof window === "undefined") return;
    const handleKeyDown = event => {
      if (event.defaultPrevented) return;
      if (event.key === "Escape") {
        event.preventDefault();
        closeRawJsonModal();
      }
    };
    window.addEventListener("keydown", handleKeyDown);
    return () => window.removeEventListener("keydown", handleKeyDown);
  }, [rawModalInstruction, closeRawJsonModal]);
  const rawModalJson = useMemo(() => {
    if (!rawModalInstruction) return "";
    try {
      return JSON.stringify(rawModalInstruction.raw ?? null, null, 2);
    } catch (err) {
      return "// Failed to serialize instruction";
    }
  }, [rawModalInstruction]);
  useEffect(() => {
    return () => {
      if (rawModalCopyTimeoutRef.current) {
        clearTimeout(rawModalCopyTimeoutRef.current);
        rawModalCopyTimeoutRef.current = null;
      }
    };
  }, []);
  return <div className="tvm-instruction-app">
      <style>{tableStyles}</style>

      <div className="tvm-instruction-toolbar">
        <div className="tvm-toolbar-search">
          <div className="tvm-field tvm-field--search">
            <label htmlFor="tvm-search">Search</label>
            <div className="tvm-search-row">
              <div className="tvm-search-input">
                <span className="tvm-search-icon" aria-hidden="true">
                  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <circle cx="11" cy="11" r="6" stroke="currentColor" strokeWidth="2" />
                    <path d="M20 20l-3.5-3.5" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
                  </svg>
                </span>
                <input id="tvm-search" type="search" placeholder="Find by mnemonic, opcode, description…" value={search} onChange={event => setSearch(event.currentTarget.value)} ref={searchInputRef} />
                {search && <button type="button" className="tvm-clear-search" onClick={() => setSearch("")} aria-label="Clear search">
                    <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                      <path d="M15 9l-6 6" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
                      <path d="M9 9l6 6" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
                    </svg>
                  </button>}
              </div>
              <div className="tvm-toolbar-utilities">
                <button type="button" className="tvm-button tvm-button--ghost" onClick={handleResetFilters} disabled={!hasActiveFilters}>
                  Reset filters
                </button>
              </div>
            </div>
          </div>
        </div>

        <div className="tvm-toolbar-filters">
          <div className="tvm-field tvm-field--sort">
            <label htmlFor="tvm-sort">Sort</label>
            <select id="tvm-sort" value={sortMode} onChange={event => setSortMode(event.currentTarget.value)}>
              <option value="opcode">Opcode</option>
              <option value="since">Newest</option>
            </select>
          </div>

          <div className="tvm-field tvm-field--category">
            <label htmlFor="tvm-category">Category</label>
            <select id="tvm-category" value={category} onChange={event => setCategory(event.currentTarget.value)}>
              {categoryOptions.map(option => <option key={option.value} value={option.value}>
                  {option.label}
                </option>)}
            </select>
          </div>

          {showSubcategorySelect && <div className="tvm-field tvm-field--subcategory">
              <label htmlFor="tvm-subcategory">Subcategory</label>
              <select id="tvm-subcategory" value={subcategory} onChange={event => setSubcategory(event.currentTarget.value)}>
                <option value="All">All subcategories</option>
                {currentSubcategoryOptions.map(option => <option key={option.value} value={option.value}>
                    {option.label}
                  </option>)}
              </select>
            </div>}
        </div>
      </div>

      <div className="tvm-instruction-meta">
        <div className="tvm-meta-items">
          {loading && <span className="tvm-meta-item">Loading specification…</span>}
          {error && !loading && <span className="tvm-meta-item">Failed to load specification.</span>}
          {!loading && !error && <span className="tvm-meta-item">
              Showing {sorted.length} of {instructions.length} instructions
            </span>}
        </div>
        {activeFilters.length > 0 && <div className="tvm-meta-chips" aria-live="polite">
            {activeFilters.map(({key, label, ariaLabel, onRemove}) => <button key={key} type="button" className="tvm-meta-chip" onClick={onRemove} aria-label={ariaLabel || `Remove filter ${label}`} title={label}>
                <span className="tvm-meta-chip-label">{label}</span>
                <span className="tvm-meta-chip-close" aria-hidden="true">
                  ×
                </span>
              </button>)}
          </div>}
      </div>

      <div className="tvm-spec-grid-container">
        <div className="tvm-spec-grid-scroll">
          <div className="tvm-spec-header" role="row">
            <div>Link</div>
            <div>Opcode</div>
            <div>Instruction</div>
            <div>Description</div>
          </div>

          {error && <div className="tvm-error-row">{error}</div>}

          {!error && <>
              {loading && <div className="tvm-loading-row">Loading specification…</div>}
              {!loading && sorted.length === 0 && <div className="tvm-empty-row">
                  No instructions match the filters.
                </div>}
              {!loading && sorted.flatMap(instruction => {
    const isExpanded = Boolean(expanded[instruction.uid]);
    const aliasCount = Array.isArray(instruction.aliases) ? instruction.aliases.length : 0;
    const detailId = `tvm-detail-${instruction.uid}`;
    const anchorId = instruction.anchorId || buildAnchorId(instruction);
    const isAnchorTarget = anchorInstruction && anchorInstruction.uid === instruction.uid;
    const rowClassName = ["tvm-spec-row", isExpanded ? "is-expanded" : "", isAnchorTarget ? "is-anchor-target" : ""].filter(Boolean).join(" ");
    const descriptionHtml = highlightHtmlContent(instruction.descriptionHtml || instruction.description || "", searchTokens);
    const nodes = [<div key={instruction.uid} id={anchorId} className={rowClassName} role="button" tabIndex={0} aria-expanded={isExpanded} aria-controls={detailId} onClick={() => toggleRow(instruction.uid)} onKeyDown={event => {
      if (event.key === "Enter" || event.key === " ") {
        event.preventDefault();
        toggleRow(instruction.uid);
      }
    }}>
                      <div className="tvm-spec-cell tvm-spec-cell--anchor">
                        <button type="button" className={`tvm-copy-link ${copied[instruction.uid] ? "is-copied" : ""}`} aria-label={copied[instruction.uid] ? "Copied" : "Copy link to instruction"} onClick={e => {
      e.stopPropagation();
      copyAnchorUrl(anchorId).then(() => {
        setCopied(prev => ({
          ...prev,
          [instruction.uid]: true
        }));
        setTimeout(() => {
          setCopied(prev => {
            const {[instruction.uid]: _omit, ...rest} = prev;
            return rest;
          });
        }, 1500);
      }).catch(() => {});
    }} title={copied[instruction.uid] ? "Copied" : "Copy link"}>
                          {copied[instruction.uid] ? <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
                              <path d="M20 6L9 17l-5-5" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
                            </svg> : <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
                              <path d="M10.59 13.41a1.996 1.996 0 0 0 2.82 0l3.59-3.59a2 2 0 0 0-2.83-2.83l-1.17 1.17" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
                              <path d="M13.41 10.59a1.996 1.996 0 0 0-2.82 0L7 14.18a2 2 0 1 0 2.83 2.83l1.17-1.17" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
                            </svg>}
                        </button>
                      </div>
                      <div className="tvm-spec-cell tvm-spec-cell--opcode">
                        <code>
                          {highlightMatches(instruction.opcode || "—", searchTokens)}
                        </code>
                      </div>
                      <div className="tvm-spec-cell tvm-spec-cell--name">
                        <div className="tvm-name-line">
                          <span className="tvm-mnemonic">
                            {highlightMatches(instruction.mnemonic, searchTokens)}
                          </span>
                          {instruction.since > 0 && <span className="tvm-inline-badge">
                              {instruction.since != 9999 ? `since v${instruction.since}` : 'unimplemented yet'}
                            </span>}
                          {aliasCount > 0 && <span className="tvm-inline-badge tvm-inline-badge--muted">
                              {aliasCount} alias{aliasCount > 1 ? "es" : ""}
                            </span>}
                          <span className={`tvm-row-indicator ${isExpanded ? "is-expanded" : ""}`} aria-hidden="true">
                            <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                              <path d="M6 9l6 6 6-6" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
                            </svg>
                          </span>
                        </div>
                        {instruction.operands.length > 0 && <div className="tvm-operands">
                            {instruction.operands.map((operand, idx) => <span key={idx} className="tvm-operand-chip">
                                {highlightMatches(formatOperandSummary(operand), searchTokens)}
                              </span>)}
                          </div>}
                      </div>
                      <div className="tvm-spec-cell tvm-spec-cell--description">
                        {instruction.description || instruction.descriptionHtml ? <div className="tvm-description" dangerouslySetInnerHTML={{
      __html: descriptionHtml
    }} /> : null}
                        <div className="tvm-description-meta">
                          <span className="tvm-category-pill">
                            {instruction.categoryLabel}
                          </span>
                        </div>
                      </div>
                    </div>];
    if (isExpanded) {
      nodes.push(<div key={`${instruction.uid}-detail`} className={`tvm-spec-row tvm-spec-row--detail ${isAnchorTarget ? "is-anchor-target" : ""}`}>
                        <div className="tvm-spec-cell tvm-spec-cell--full" id={detailId}>
                          {renderInstructionDetail(instruction, {
        isAnchorTarget,
        onOpenRawJson: openRawJsonModal
      })}
                        </div>
                      </div>);
    }
    return nodes;
  })}
            </>}
      </div>
    </div>

      {rawModalInstruction && <div className="tvm-modal" role="dialog" aria-modal="true" aria-labelledby="tvm-raw-json-title">
          <div className="tvm-modal-backdrop" onClick={closeRawJsonModal} />
          <div className="tvm-modal-dialog" role="document" onClick={event => event.stopPropagation()}>
            <div className="tvm-modal-header">
              <div className="tvm-modal-header-text">
                <h3 id="tvm-raw-json-title">Raw instruction JSON</h3>
                <p className="tvm-modal-subtitle">
                  {rawModalInstruction.opcode ? <>
                      <code>{rawModalInstruction.opcode}</code>
                      {" "}
                    </> : null}
                  {rawModalInstruction.mnemonic}
                </p>
              </div>
              <div className="tvm-modal-actions">
                <button type="button" className="tvm-button tvm-button--ghost" onClick={() => handleCopyRawJson(rawModalJson)}>
                  {rawModalCopied ? "Copied" : "Copy JSON"}
                </button>
                <button type="button" className="tvm-button" onClick={closeRawJsonModal}>
                  Close
                </button>
              </div>
            </div>
            <pre className="tvm-modal-code">{rawModalJson}</pre>
          </div>
        </div>}
    </div>;
};

<TvmInstructionTable />

<div hidden>
  #### `00` NOP

  Fift: NOP
  Description: Does nothing.
  Category: stack\_basic Stack Basic

  #### `0` XCHG\_0I

  Fift: s\[i] XCHG0
  Description: Interchanges `s0` with `s[i]`, `1 <= i <= 15`.
  Category: stack\_basic Stack Basic
  Alias: SWAP Same as `s1 XCHG0`.

  #### `1` XCHG\_1I

  Fift: s1 s\[i] XCHG
  Description: Interchanges `s1` with `s[i]`, `2 <= i <= 15`.
  Category: stack\_basic Stack Basic

  #### `2` PUSH

  Fift: s\[i] PUSH
  Description: Pushes a copy of the old `s[i]` into the stack.
  Category: stack\_basic Stack Basic
  Alias: DUP Same as `s0 PUSH`.
  Alias: OVER Same as `s1 PUSH`.

  #### `3` POP

  Fift: s\[i] POP
  Description: Pops the old `s0` value into the old `s[i]`.
  Category: stack\_basic Stack Basic
  Alias: DROP Same as `s0 POP`, discards the top-of-stack value.
  Alias: NIP Same as `s1 POP`.

  #### `4` XCHG3

  Fift: s\[i] s\[j] s\[k] XCHG3
  Description: Equivalent to `s2 s[i] XCHG` `s1 s[j] XCHG` `s[k] XCHG0`.
  Category: stack\_complex Stack Complex

  #### `7` PUSHINT\_4

  Fift: \[x] PUSHINT
  \[x] INT
  Description: Pushes integer `x` into the stack. `-5 <= x <= 10`.
  Here `i` equals four lower-order bits of `x` (`i=x mod 16`).
  Category: const\_int Const Int
  Alias: ZERO
  Alias: ONE
  Alias: TWO
  Alias: TEN
  Alias: TRUE

  #### `9` PUSHCONT\_SHORT

  Fift: \[builder] PUSHCONT
  \[builder] CONT
  Description: Pushes a continuation made from `builder`.
  *Details:* Pushes an `x`-byte continuation for `0 <= x <= 15`.
  Category: const\_data Const Data

  #### `10` XCHG\_IJ

  Fift: s\[i] s\[j] XCHG
  Description: Interchanges `s[i]` with `s[j]`, `1 <= i < j <= 15`.
  Category: stack\_basic Stack Basic

  #### `11` XCHG\_0I\_LONG

  Fift: s0 \[ii] s() XCHG
  Description: Interchanges `s0` with `s[ii]`, `0 <= ii <= 255`.
  Category: stack\_basic Stack Basic

  #### `50` XCHG2

  Fift: s\[i] s\[j] XCHG2
  Description: Equivalent to `s1 s[i] XCHG` `s[j] XCHG0`.
  Category: stack\_complex Stack Complex

  #### `51` XCPU

  Fift: s\[i] s\[j] XCPU
  Description: Equivalent to `s[i] XCHG0` `s[j] PUSH`.
  Category: stack\_complex Stack Complex

  #### `52` PUXC

  Fift: s\[i] s\[j-1] PUXC
  Description: Equivalent to `s[i] PUSH` `SWAP` `s[j] XCHG0`.
  Category: stack\_complex Stack Complex

  #### `53` PUSH2

  Fift: s\[i] s\[j] PUSH2
  Description: Equivalent to `s[i] PUSH` `s[j+1] PUSH`.
  Category: stack\_complex Stack Complex

  #### `55` BLKSWAP

  Fift: \[i+1] \[j+1] BLKSWAP
  Description: Permutes two blocks `s[j+i+1] ... s[j+1]` and `s[j] ... s0`.
  `0 <= i,j <= 15`
  Equivalent to `[i+1] [j+1] REVERSE` `[j+1] 0 REVERSE` `[i+j+2] 0 REVERSE`.
  Category: stack\_complex Stack Complex
  Alias: ROT2 Rotates the three topmost pairs of stack entries.
  Alias: ROLL Rotates the top `i+1` stack entries.
  Equivalent to `1 [i+1] BLKSWAP`.
  Alias: ROLLREV Rotates the top `i+1` stack entries in the other direction.
  Equivalent to `[i+1] 1 BLKSWAP`.

  #### `56` PUSH\_LONG

  Fift: \[ii] s() PUSH
  Description: Pushes a copy of the old `s[ii]` into the stack.
  `0 <= ii <= 255`
  Category: stack\_complex Stack Complex

  #### `57` POP\_LONG

  Fift: \[ii] s() POP
  Description: Pops the old `s0` value into the old `s[ii]`.
  `0 <= ii <= 255`
  Category: stack\_complex Stack Complex

  #### `58` ROT

  Fift: ROT
  Description: Equivalent to `1 2 BLKSWAP` or to `s2 s1 XCHG2`.
  Category: stack\_complex Stack Complex

  #### `59` ROTREV

  Fift: ROTREV
  -ROT
  Description: Equivalent to `2 1 BLKSWAP` or to `s2 s2 XCHG2`.
  Category: stack\_complex Stack Complex

  #### `5A` SWAP2

  Fift: SWAP2
  2SWAP
  Description: Equivalent to `2 2 BLKSWAP` or to `s3 s2 XCHG2`.
  Category: stack\_complex Stack Complex

  #### `5B` DROP2

  Fift: DROP2
  2DROP
  Description: Equivalent to `DROP` `DROP`.
  Category: stack\_complex Stack Complex

  #### `5C` DUP2

  Fift: DUP2
  2DUP
  Description: Equivalent to `s1 s0 PUSH2`.
  Category: stack\_complex Stack Complex

  #### `5D` OVER2

  Fift: OVER2
  2OVER
  Description: Equivalent to `s3 s2 PUSH2`.
  Category: stack\_complex Stack Complex

  #### `5E` REVERSE

  Fift: \[i+2] \[j] REVERSE
  Description: Reverses the order of `s[j+i+1] ... s[j]`.
  Category: stack\_complex Stack Complex

  #### `5F` BLKPUSH

  Fift: \[i] \[j] BLKPUSH
  Description: Equivalent to `PUSH s(j)` performed `i` times.
  `1 <= i <= 15`, `0 <= j <= 15`.
  Category: stack\_complex Stack Complex

  #### `60` PICK

  Fift: PICK
  PUSHX
  Description: Pops integer `i` from the stack, then performs `s[i] PUSH`.
  Category: stack\_complex Stack Complex

  #### `61` ROLLX

  Fift: ROLLX
  Description: Pops integer `i` from the stack, then performs `1 [i] BLKSWAP`.
  Category: stack\_complex Stack Complex

  #### `62` -ROLLX

  Fift: -ROLLX
  ROLLREVX
  Description: Pops integer `i` from the stack, then performs `[i] 1 BLKSWAP`.
  Category: stack\_complex Stack Complex

  #### `63` BLKSWX

  Fift: BLKSWX
  Description: Pops integers `i`,`j` from the stack, then performs `[i] [j] BLKSWAP`.
  Category: stack\_complex Stack Complex

  #### `64` REVX

  Fift: REVX
  Description: Pops integers `i`,`j` from the stack, then performs `[i] [j] REVERSE`.
  Category: stack\_complex Stack Complex

  #### `65` DROPX

  Fift: DROPX
  Description: Pops integer `i` from the stack, then performs `[i] BLKDROP`.
  Category: stack\_complex Stack Complex

  #### `66` TUCK

  Fift: TUCK
  Description: Equivalent to `SWAP` `OVER` or to `s1 s1 XCPU`.
  Category: stack\_complex Stack Complex

  #### `67` XCHGX

  Fift: XCHGX
  Description: Pops integer `i` from the stack, then performs `s[i] XCHG`.
  Category: stack\_complex Stack Complex

  #### `68` DEPTH

  Fift: DEPTH
  Description: Pushes the current depth of the stack.
  Category: stack\_complex Stack Complex

  #### `69` CHKDEPTH

  Fift: CHKDEPTH
  Description: Pops integer `i` from the stack, then checks whether there are at least `i` elements, generating a stack underflow exception otherwise.
  Category: stack\_complex Stack Complex

  #### `6A` ONLYTOPX

  Fift: ONLYTOPX
  Description: Pops integer `i` from the stack, then removes all but the top `i` elements.
  Category: stack\_complex Stack Complex

  #### `6B` ONLYX

  Fift: ONLYX
  Description: Pops integer `i` from the stack, then leaves only the bottom `i` elements. Approximately equivalent to `DEPTH` `SWAP` `SUB` `DROPX`.
  Category: stack\_complex Stack Complex

  #### `6C` BLKDROP2

  Fift: \[i] \[j] BLKDROP2
  Description: Drops `i` stack elements under the top `j` elements.
  `1 <= i <= 15`, `0 <= j <= 15`
  Equivalent to `[i+j] 0 REVERSE` `[i] BLKDROP` `[j] 0 REVERSE`.
  Category: stack\_complex Stack Complex

  #### `6D` NULL

  Fift: NULL
  PUSHNULL
  Description: Pushes the only value of type *Null*.
  Category: tuple Tuple
  Alias: NEWDICT Returns a new empty dictionary.
  It is an alternative mnemonics for `PUSHNULL`.

  #### `6E` ISNULL

  Fift: ISNULL
  Description: Checks whether `x` is a *Null*, and returns `-1` or `0` accordingly.
  Category: tuple Tuple
  Alias: DICTEMPTY Checks whether dictionary `D` is empty, and returns `-1` or `0` accordingly.
  It is an alternative mnemonics for `ISNULL`.

  #### `80` PUSHINT\_8

  Fift: \[xx] PUSHINT
  \[xx] INT
  Description: Pushes integer `xx`. `-128 <= xx <= 127`.
  Category: const\_int Const Int

  #### `81` PUSHINT\_16

  Fift: \[xxxx] PUSHINT
  \[xxxx] INT
  Description: Pushes integer `xxxx`. `-2^15 <= xx < 2^15`.
  Category: const\_int Const Int

  #### `82` PUSHINT\_LONG

  Fift: \[xxx] PUSHINT
  \[xxx] INT
  Description: Pushes integer `xxx`.
  *Details:* 5-bit `0 <= l <= 30` determines the length `n=8l+19` of signed big-endian integer `xxx`.
  The total length of this instruction is `l+4` bytes or `n+13=8l+32` bits.
  Category: const\_int Const Int

  #### `83` PUSHPOW2

  Fift: \[xx+1] PUSHPOW2
  Description: (Quietly) pushes `2^(xx+1)` for `0 <= xx <= 255`.
  `2^256` is a `NaN`.
  Category: const\_int Const Int

  #### `84` PUSHPOW2DEC

  Fift: \[xx+1] PUSHPOW2DEC
  Description: Pushes `2^(xx+1)-1` for `0 <= xx <= 255`.
  Category: const\_int Const Int

  #### `85` PUSHNEGPOW2

  Fift: \[xx+1] PUSHNEGPOW2
  Description: Pushes `-2^(xx+1)` for `0 <= xx <= 255`.
  Category: const\_int Const Int

  #### `88` PUSHREF

  Fift: \[ref] PUSHREF
  Description: Pushes the reference `ref` into the stack.
  *Details:* Pushes the first reference of `cc.code` into the stack as a *Cell* (and removes this reference from the current continuation).
  Category: const\_data Const Data

  #### `89` PUSHREFSLICE

  Fift: \[ref] PUSHREFSLICE
  Description: Similar to `PUSHREF`, but converts the cell into a *Slice*.
  Category: const\_data Const Data

  #### `8A` PUSHREFCONT

  Fift: \[ref] PUSHREFCONT
  Description: Similar to `PUSHREFSLICE`, but makes a simple ordinary *Continuation* out of the cell.
  Category: const\_data Const Data

  #### `8B` PUSHSLICE

  Fift: \[slice] PUSHSLICE
  \[slice] SLICE
  Description: Pushes the slice `slice` into the stack.
  *Details:* Pushes the (prefix) subslice of `cc.code` consisting of its first `8x+4` bits and no references (i.e., essentially a bitstring), where `0 <= x <= 15`.
  A completion tag is assumed, meaning that all trailing zeroes and the last binary one (if present) are removed from this bitstring.
  If the original bitstring consists only of zeroes, an empty slice will be pushed.
  Category: const\_data Const Data

  #### `8C` PUSHSLICE\_REFS

  Fift: \[slice] PUSHSLICE
  \[slice] SLICE
  Description: Pushes the slice `slice` into the stack.
  *Details:* Pushes the (prefix) subslice of `cc.code` consisting of its first `1 <= r+1 <= 4` references and up to first `8xx+1` bits of data, with `0 <= xx <= 31`.
  A completion tag is also assumed.
  Category: const\_data Const Data

  #### `8D` PUSHSLICE\_LONG

  Fift: \[slice] PUSHSLICE
  \[slice] SLICE
  Description: Pushes the slice `slice` into the stack.
  *Details:* Pushes the subslice of `cc.code` consisting of `0 <= r <= 4` references and up to `8xx+6` bits of data, with `0 <= xx <= 127`.
  A completion tag is assumed.
  Category: const\_data Const Data

  #### `A0` ADD

  Fift: ADD
  Description:
  Category: arithm\_basic Arithm Basic

  #### `A1` SUB

  Fift: SUB
  Description:
  Category: arithm\_basic Arithm Basic

  #### `A2` SUBR

  Fift: SUBR
  Description: Equivalent to `SWAP` `SUB`.
  Category: arithm\_basic Arithm Basic

  #### `A3` NEGATE

  Fift: NEGATE
  Description: Equivalent to `-1 MULCONST` or to `ZERO SUBR`.
  Notice that it triggers an integer overflow exception if `x=-2^256`.
  Category: arithm\_basic Arithm Basic

  #### `A4` INC

  Fift: INC
  Description: Equivalent to `1 ADDCONST`.
  Category: arithm\_basic Arithm Basic

  #### `A5` DEC

  Fift: DEC
  Description: Equivalent to `-1 ADDCONST`.
  Category: arithm\_basic Arithm Basic

  #### `A6` ADDCONST

  Fift: \[cc] ADDCONST
  \[cc] ADDINT
  \[-cc] SUBCONST
  \[-cc] SUBINT
  Description: `-128 <= cc <= 127`.
  Category: arithm\_basic Arithm Basic

  #### `A7` MULCONST

  Fift: \[cc] MULCONST
  \[cc] MULINT
  Description: `-128 <= cc <= 127`.
  Category: arithm\_basic Arithm Basic

  #### `A8` MUL

  Fift: MUL
  Description:
  Category: arithm\_basic Arithm Basic

  #### `AA` LSHIFT

  Fift: \[cc+1] LSHIFT#
  Description: `0 <= cc <= 255`
  Category: arithm\_logical Arithm Logical

  #### `AB` RSHIFT

  Fift: \[cc+1] RSHIFT#
  Description: `0 <= cc <= 255`
  Category: arithm\_logical Arithm Logical

  #### `AC` LSHIFT\_VAR

  Fift: LSHIFT
  Description: `0 <= y <= 1023`
  Category: arithm\_logical Arithm Logical

  #### `AD` RSHIFT\_VAR

  Fift: RSHIFT
  Description: `0 <= y <= 1023`
  Category: arithm\_logical Arithm Logical

  #### `AE` POW2

  Fift: POW2
  Description: `0 <= y <= 1023`
  Equivalent to `ONE` `SWAP` `LSHIFT`.
  Category: arithm\_logical Arithm Logical

  #### `B0` AND

  Fift: AND
  Description: Bitwise and of two signed integers `x` and `y`, sign-extended to infinity.
  Category: arithm\_logical Arithm Logical

  #### `B1` OR

  Fift: OR
  Description: Bitwise or of two integers.
  Category: arithm\_logical Arithm Logical

  #### `B2` XOR

  Fift: XOR
  Description: Bitwise xor of two integers.
  Category: arithm\_logical Arithm Logical

  #### `B3` NOT

  Fift: NOT
  Description: Bitwise not of an integer.
  Category: arithm\_logical Arithm Logical

  #### `B4` FITS

  Fift: \[cc+1] FITS
  Description: Checks whether `x` is a `cc+1`-bit signed integer for `0 <= cc <= 255` (i.e., whether `-2^cc <= x < 2^cc`).
  If not, either triggers an integer overflow exception, or replaces `x` with a `NaN` (quiet version).
  Category: arithm\_logical Arithm Logical
  Alias: CHKBOOL Checks whether `x` is a ''boolean value'' (i.e., either 0 or -1).

  #### `B5` UFITS

  Fift: \[cc+1] UFITS
  Description: Checks whether `x` is a `cc+1`-bit unsigned integer for `0 <= cc <= 255` (i.e., whether `0 <= x < 2^(cc+1)`).
  Category: arithm\_logical Arithm Logical
  Alias: CHKBIT Checks whether `x` is a binary digit (i.e., zero or one).

  #### `B8` SGN

  Fift: SGN
  Description: Computes the sign of an integer `x`:
  `-1` if `x<0`, `0` if `x=0`, `1` if `x>0`.
  Category: compare\_int Compare Int

  #### `B9` LESS

  Fift: LESS
  Description: Returns `-1` if `x<y`, `0` otherwise.
  Category: compare\_int Compare Int

  #### `BA` EQUAL

  Fift: EQUAL
  Description: Returns `-1` if `x=y`, `0` otherwise.
  Category: compare\_int Compare Int

  #### `BB` LEQ

  Fift: LEQ
  Description:
  Category: compare\_int Compare Int

  #### `BC` GREATER

  Fift: GREATER
  Description:
  Category: compare\_int Compare Int

  #### `BD` NEQ

  Fift: NEQ
  Description: Equivalent to `EQUAL` `NOT`.
  Category: compare\_int Compare Int

  #### `BE` GEQ

  Fift: GEQ
  Description: Equivalent to `LESS` `NOT`.
  Category: compare\_int Compare Int

  #### `BF` CMP

  Fift: CMP
  Description: Computes the sign of `x-y`:
  `-1` if `x<y`, `0` if `x=y`, `1` if `x>y`.
  No integer overflow can occur here unless `x` or `y` is a `NaN`.
  Category: compare\_int Compare Int

  #### `C0` EQINT

  Fift: \[yy] EQINT
  Description: Returns `-1` if `x=yy`, `0` otherwise.
  `-2^7 <= yy < 2^7`.
  Category: compare\_int Compare Int
  Alias: ISZERO Checks whether an integer is zero. Corresponds to Forth's `0=`.

  #### `C1` LESSINT

  Fift: \[yy] LESSINT
  \[yy-1] LEQINT
  Description: Returns `-1` if `x<yy`, `0` otherwise.
  `-2^7 <= yy < 2^7`.
  Category: compare\_int Compare Int
  Alias: ISNEG Checks whether an integer is negative. Corresponds to Forth's `0<`.
  Alias: ISNPOS Checks whether an integer is non-positive.

  #### `C2` GTINT

  Fift: \[yy] GTINT
  \[yy+1] GEQINT
  Description: Returns `-1` if `x>yy`, `0` otherwise.
  `-2^7 <= yy < 2^7`.
  Category: compare\_int Compare Int
  Alias: ISPOS Checks whether an integer is positive. Corresponds to Forth's `0>`.
  Alias: ISNNEG Checks whether an integer is non-negative.

  #### `C3` NEQINT

  Fift: \[yy] NEQINT
  Description: Returns `-1` if `x!=yy`, `0` otherwise.
  `-2^7 <= yy < 2^7`.
  Category: compare\_int Compare Int

  #### `C4` ISNAN

  Fift: ISNAN
  Description: Checks whether `x` is a `NaN`.
  Category: compare\_int Compare Int

  #### `C5` CHKNAN

  Fift: CHKNAN
  Description: Throws an arithmetic overflow exception if `x` is a `NaN`.
  Category: compare\_int Compare Int

  #### `C8` NEWC

  Fift: NEWC
  Description: Creates a new empty *Builder*.
  Category: cell\_build Cell Build

  #### `C9` ENDC

  Fift: ENDC
  Description: Converts a *Builder* into an ordinary *Cell*.
  Category: cell\_build Cell Build

  #### `CA` STI

  Fift: \[cc+1] STI
  Description: Stores a signed `cc+1`-bit integer `x` into *Builder* `b` for `0 <= cc <= 255`, throws a range check exception if `x` does not fit into `cc+1` bits.
  Category: cell\_build Cell Build

  #### `CB` STU

  Fift: \[cc+1] STU
  Description: Stores an unsigned `cc+1`-bit integer `x` into *Builder* `b`. In all other respects it is similar to `STI`.
  Category: cell\_build Cell Build

  #### `CC` STREF

  Fift: STREF
  Description: Stores a reference to *Cell* `c` into *Builder* `b`.
  Category: cell\_build Cell Build

  #### `CD` STBREFR

  Fift: STBREFR
  ENDCST
  Description: Equivalent to `ENDC` `SWAP` `STREF`.
  Category: cell\_build Cell Build

  #### `CE` STSLICE

  Fift: STSLICE
  Description: Stores *Slice* `s` into *Builder* `b`.
  Category: cell\_build Cell Build
  Alias: STDICTS Stores a *Slice*-represented dictionary `s` into *Builder* `b`.
  It is actually a synonym for `STSLICE`.

  #### `D0` CTOS

  Fift: CTOS
  Description: Converts a *Cell* into a *Slice*. Notice that `c` must be either an ordinary cell, or an exotic cell which is automatically *loaded* to yield an ordinary cell `c'`, converted into a *Slice* afterwards.
  Category: cell\_parse Cell Parse

  #### `D1` ENDS

  Fift: ENDS
  Description: Removes a *Slice* `s` from the stack, and throws an exception if it is not empty.
  Category: cell\_parse Cell Parse

  #### `D2` LDI

  Fift: \[cc+1] LDI
  Description: Loads (i.e., parses) a signed `cc+1`-bit integer `x` from *Slice* `s`, and returns the remainder of `s` as `s'`.
  Category: cell\_parse Cell Parse

  #### `D3` LDU

  Fift: \[cc+1] LDU
  Description: Loads an unsigned `cc+1`-bit integer `x` from *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D4` LDREF

  Fift: LDREF
  Description: Loads a cell reference `c` from `s`.
  Category: cell\_parse Cell Parse

  #### `D5` LDREFRTOS

  Fift: LDREFRTOS
  Description: Equivalent to `LDREF` `SWAP` `CTOS`.
  Category: cell\_parse Cell Parse

  #### `D6` LDSLICE

  Fift: \[cc+1] LDSLICE
  Description: Cuts the next `cc+1` bits of `s` into a separate *Slice* `s''`.
  Category: cell\_parse Cell Parse

  #### `D8` EXECUTE

  Fift: EXECUTE
  CALLX
  Description: *Calls*, or *executes*, continuation `c`.
  Category: cont\_basic Cont Basic

  #### `D9` JMPX

  Fift: JMPX
  Description: *Jumps*, or transfers control, to continuation `c`.
  The remainder of the previous current continuation `cc` is discarded.
  Category: cont\_basic Cont Basic

  #### `DA` CALLXARGS

  Fift: \[p] \[r] CALLXARGS
  Description: *Calls* continuation `c` with `p` parameters and expecting `r` return values
  `0 <= p <= 15`, `0 <= r <= 15`
  Category: cont\_basic Cont Basic

  #### `DC` IFRET

  Fift: IFRET
  IFNOT:
  Description: Performs a `RET`, but only if integer `f` is non-zero. If `f` is a `NaN`, throws an integer overflow exception.
  Category: cont\_conditional Cont Conditional

  #### `DD` IFNOTRET

  Fift: IFNOTRET
  IF:
  Description: Performs a `RET`, but only if integer `f` is zero.
  Category: cont\_conditional Cont Conditional

  #### `DE` IF

  Fift: IF
  Description: Performs `EXECUTE` for `c` (i.e., *executes* `c`), but only if integer `f` is non-zero. Otherwise simply discards both values.
  Category: cont\_conditional Cont Conditional

  #### `DF` IFNOT

  Fift: IFNOT
  Description: Executes continuation `c`, but only if integer `f` is zero. Otherwise simply discards both values.
  Category: cont\_conditional Cont Conditional

  #### `E0` IFJMP

  Fift: IFJMP
  Description: Jumps to `c` (similarly to `JMPX`), but only if `f` is non-zero.
  Category: cont\_conditional Cont Conditional

  #### `E1` IFNOTJMP

  Fift: IFNOTJMP
  Description: Jumps to `c` (similarly to `JMPX`), but only if `f` is zero.
  Category: cont\_conditional Cont Conditional

  #### `E2` IFELSE

  Fift: IFELSE
  Description: If integer `f` is non-zero, executes `c`, otherwise executes `c'`. Equivalent to `CONDSELCHK` `EXECUTE`.
  Category: cont\_conditional Cont Conditional

  #### `E4` REPEAT

  Fift: REPEAT
  Description: Executes continuation `c` `n` times, if integer `n` is non-negative. If `n>=2^31` or `n<-2^31`, generates a range check exception.
  Notice that a `RET` inside the code of `c` works as a `continue`, not as a `break`. One should use either alternative (experimental) loops or alternative `RETALT` (along with a `SETEXITALT` before the loop) to `break` out of a loop.
  Category: cont\_loops Cont Loops

  #### `E5` REPEATEND

  Fift: REPEATEND
  REPEAT:
  Description: Similar to `REPEAT`, but it is applied to the current continuation `cc`.
  Category: cont\_loops Cont Loops

  #### `E6` UNTIL

  Fift: UNTIL
  Description: Executes continuation `c`, then pops an integer `x` from the resulting stack. If `x` is zero, performs another iteration of this loop. The actual implementation of this primitive involves an extraordinary continuation `ec_until` with its arguments set to the body of the loop (continuation `c`) and the original current continuation `cc`. This extraordinary continuation is then saved into the savelist of `c` as `c.c0` and the modified `c` is then executed. The other loop primitives are implemented similarly with the aid of suitable extraordinary continuations.
  Category: cont\_loops Cont Loops

  #### `E7` UNTILEND

  Fift: UNTILEND
  UNTIL:
  Description: Similar to `UNTIL`, but executes the current continuation `cc` in a loop. When the loop exit condition is satisfied, performs a `RET`.
  Category: cont\_loops Cont Loops

  #### `E8` WHILE

  Fift: WHILE
  Description: Executes `c'` and pops an integer `x` from the resulting stack. If `x` is zero, exists the loop and transfers control to the original `cc`. If `x` is non-zero, executes `c`, and then begins a new iteration.
  Category: cont\_loops Cont Loops

  #### `E9` WHILEEND

  Fift: WHILEEND
  Description: Similar to `WHILE`, but uses the current continuation `cc` as the loop body.
  Category: cont\_loops Cont Loops

  #### `EA` AGAIN

  Fift: AGAIN
  Description: Similar to `REPEAT`, but executes `c` infinitely many times. A `RET` only begins a new iteration of the infinite loop, which can be exited only by an exception, or a `RETALT` (or an explicit `JMPX`).
  Category: cont\_loops Cont Loops

  #### `EB` AGAINEND

  Fift: AGAINEND
  AGAIN:
  Description: Similar to `AGAIN`, but performed with respect to the current continuation `cc`.
  Category: cont\_loops Cont Loops

  #### `EC` SETCONTARGS\_N

  Fift: \[r] \[n] SETCONTARGS
  Description: Pushes `0 <= r <= 15` values `x_1...x_r` into the stack of (a copy of) the continuation `c`, starting with `x_1`. When `n` is 15 (-1 in Fift notation), does nothing with `c.nargs`. For `0 <= n <= 14`, sets `c.nargs` to the final size of the stack of `c'` plus `n`. In other words, transforms `c` into a *closure* or a *partially applied function*, with `0 <= n <= 14` arguments missing.
  Category: cont\_stack Cont Stack
  Alias: SETNUMARGS Sets `c.nargs` to `n` plus the current depth of `c`'s stack, where `0 <= n <= 14`. If `c.nargs` is already set to a non-negative value, does nothing.
  Alias: SETCONTARGS Pushes `0 <= r <= 15` values `x_1...x_r` into the stack of (a copy of) the continuation `c`, starting with `x_1`. If the final depth of `c`'s stack turns out to be greater than `c.nargs`, a stack overflow exception is generated.

  #### `EE` BLESSARGS

  Fift: \[r] \[n] BLESSARGS
  Description: `0 <= r <= 15`, `-1 <= n <= 14`
  Equivalent to `BLESS` `[r] [n] SETCONTARGS`.
  The value of `n` is represented inside the instruction by the 4-bit integer `n mod 16`.
  Category: cont\_create Cont Create
  Alias: BLESSNUMARGS Also transforms a *Slice* `s` into a *Continuation* `c`, but sets `c.nargs` to `0 <= n <= 14`.

  #### `F0` CALLDICT

  Fift: \[nn] CALL
  \[nn] CALLDICT
  Description: Calls the continuation in `c3`, pushing integer `0 <= nn <= 255` into its stack as an argument.
  Approximately equivalent to `[nn] PUSHINT` `c3 PUSHCTR` `EXECUTE`.
  Category: cont\_dict Cont Dict

  #### `F3` TRYARGS

  Fift: \[p] \[r] TRYARGS
  Description: Similar to `TRY`, but with `[p] [r] CALLXARGS` internally used instead of `EXECUTE`.
  In this way, all but the top `0 <= p <= 15` stack elements will be saved into current continuation's stack, and then restored upon return from either `c` or `c'`, with the top `0 <= r <= 15` values of the resulting stack of `c` or `c'` copied as return values.
  Category: exceptions Exceptions

  #### `FE` DEBUG

  Fift: \&#123i\*16+j\&#125 DEBUG
  Description:
  Category: debug Debug
  Alias: DUMPSTK Dumps the stack (at most the top 255 values) and shows the total stack depth. Does nothing on production versions of TVM.
  Alias: STRDUMP Dumps slice with length divisible by 8 from top of stack as a string. Does nothing on production versions of TVM.
  Alias: DUMP Dumps slice with length divisible by 8 from top of stack as a string. Does nothing on production versions of TVM.

  #### `FF` SETCP

  Fift: \[nn] SETCP
  Description: Selects TVM codepage `0 <= nn < 240`. If the codepage is not supported, throws an invalid opcode exception.
  Category: codepage Codepage
  Alias: SETCP0 Selects TVM (test) codepage zero as described in this document.

  #### `540` XCHG3\_ALT

  Fift: s\[i] s\[j] s\[k] XCHG3\_l
  Description: Long form of `XCHG3`.
  Category: stack\_complex Stack Complex

  #### `541` XC2PU

  Fift: s\[i] s\[j] s\[k] XC2PU
  Description: Equivalent to `s[i] s[j] XCHG2` `s[k] PUSH`.
  Category: stack\_complex Stack Complex

  #### `542` XCPUXC

  Fift: s\[i] s\[j] s\[k-1] XCPUXC
  Description: Equivalent to `s1 s[i] XCHG` `s[j] s[k-1] PUXC`.
  Category: stack\_complex Stack Complex

  #### `543` XCPU2

  Fift: s\[i] s\[j] s\[k] XCPU2
  Description: Equivalent to `s[i] XCHG0` `s[j] s[k] PUSH2`.
  Category: stack\_complex Stack Complex

  #### `544` PUXC2

  Fift: s\[i] s\[j-1] s\[k-1] PUXC2
  Description: Equivalent to `s[i] PUSH` `s2 XCHG0` `s[j] s[k] XCHG2`.
  Category: stack\_complex Stack Complex

  #### `545` PUXCPU

  Fift: s\[i] s\[j-1] s\[k-1] PUXCPU
  Description: Equivalent to `s[i] s[j-1] PUXC` `s[k] PUSH`.
  Category: stack\_complex Stack Complex

  #### `546` PU2XC

  Fift: s\[i] s\[j-1] s\[k-2] PU2XC
  Description: Equivalent to `s[i] PUSH` `SWAP` `s[j] s[k-1] PUXC`.
  Category: stack\_complex Stack Complex

  #### `547` PUSH3

  Fift: s\[i] s\[j] s\[k] PUSH3
  Description: Equivalent to `s[i] PUSH` `s[j+1] s[k+1] PUSH2`.
  Category: stack\_complex Stack Complex

  #### `5F0` BLKDROP

  Fift: \[i] BLKDROP
  Description: Equivalent to `DROP` performed `i` times.
  Category: stack\_complex Stack Complex

  #### `6F0` TUPLE

  Fift: \[n] TUPLE
  Description: Creates a new *Tuple* `t=(x_1, ... ,x_n)` containing `n` values `x_1`,..., `x_n`.
  `0 <= n <= 15`
  Category: tuple Tuple
  Alias: NIL Pushes the only *Tuple* `t=()` of length zero.
  Alias: SINGLE Creates a singleton `t:=(x)`, i.e., a *Tuple* of length one.
  Alias: PAIR Creates pair `t:=(x,y)`.
  Alias: TRIPLE Creates triple `t:=(x,y,z)`.

  #### `6F1` INDEX

  Fift: \[k] INDEX
  Description: Returns the `k`-th element of a *Tuple* `t`.
  `0 <= k <= 15`.
  Category: tuple Tuple
  Alias: FIRST Returns the first element of a *Tuple*.
  Alias: SECOND Returns the second element of a *Tuple*.
  Alias: THIRD Returns the third element of a *Tuple*.

  #### `6F2` UNTUPLE

  Fift: \[n] UNTUPLE
  Description: Unpacks a *Tuple* `t=(x_1,...,x_n)` of length equal to `0 <= n <= 15`.
  If `t` is not a *Tuple*, or if `|t| != n`, a type check exception is thrown.
  Category: tuple Tuple
  Alias: UNSINGLE Unpacks a singleton `t=(x)`.
  Alias: UNPAIR Unpacks a pair `t=(x,y)`.
  Alias: UNTRIPLE Unpacks a triple `t=(x,y,z)`.

  #### `6F3` UNPACKFIRST

  Fift: \[k] UNPACKFIRST
  Description: Unpacks first `0 <= k <= 15` elements of a *Tuple* `t`.
  If `|t|<k`, throws a type check exception.
  Category: tuple Tuple
  Alias: CHKTUPLE Checks whether `t` is a *Tuple*. If not, throws a type check exception.

  #### `6F4` EXPLODE

  Fift: \[n] EXPLODE
  Description: Unpacks a *Tuple* `t=(x_1,...,x_m)` and returns its length `m`, but only if `m <= n <= 15`. Otherwise throws a type check exception.
  Category: tuple Tuple

  #### `6F5` SETINDEX

  Fift: \[k] SETINDEX
  Description: Computes *Tuple* `t'` that differs from `t` only at position `t'_&#123k+1&#125`, which is set to `x`.
  `0 <= k <= 15`
  If `k >= |t|`, throws a range check exception.
  Category: tuple Tuple
  Alias: SETFIRST Sets the first component of *Tuple* `t` to `x` and returns the resulting *Tuple* `t'`.
  Alias: SETSECOND Sets the second component of *Tuple* `t` to `x` and returns the resulting *Tuple* `t'`.
  Alias: SETTHIRD Sets the third component of *Tuple* `t` to `x` and returns the resulting *Tuple* `t'`.

  #### `6F6` INDEXQ

  Fift: \[k] INDEXQ
  Description: Returns the `k`-th element of a *Tuple* `t`, where `0 <= k <= 15`. In other words, returns `x_&#123k+1&#125` if `t=(x_1,...,x_n)`. If `k>=n`, or if `t` is *Null*, returns a *Null* instead of `x`.
  Category: tuple Tuple
  Alias: FIRSTQ Returns the first element of a *Tuple*.
  Alias: SECONDQ Returns the second element of a *Tuple*.
  Alias: THIRDQ Returns the third element of a *Tuple*.

  #### `6F7` SETINDEXQ

  Fift: \[k] SETINDEXQ
  Description: Sets the `k`-th component of *Tuple* `t` to `x`, where `0 <= k < 16`, and returns the resulting *Tuple* `t'`.
  If `|t| <= k`, first extends the original *Tuple* to length `n'=k+1` by setting all new components to *Null*. If the original value of `t` is *Null*, treats it as an empty *Tuple*. If `t` is not *Null* or *Tuple*, throws an exception. If `x` is *Null* and either `|t| <= k` or `t` is *Null*, then always returns `t'=t` (and does not consume tuple creation gas).
  Category: tuple Tuple
  Alias: SETFIRSTQ Sets the first component of *Tuple* `t` to `x` and returns the resulting *Tuple* `t'`.
  Alias: SETSECONDQ Sets the second component of *Tuple* `t` to `x` and returns the resulting *Tuple* `t'`.
  Alias: SETTHIRDQ Sets the third component of *Tuple* `t` to `x` and returns the resulting *Tuple* `t'`.

  #### `6FB` INDEX2

  Fift: \[i] \[j] INDEX2
  Description: Recovers `x=(t_&#123i+1&#125)_&#123j+1&#125` for `0 <= i,j <= 3`.
  Equivalent to `[i] INDEX` `[j] INDEX`.
  Category: tuple Tuple
  Alias: CADR Recovers `x=(t_2)_1`.
  Alias: CDDR Recovers `x=(t_2)_2`.

  #### `DB0` CALLXARGS\_VAR

  Fift: \[p] -1 CALLXARGS
  Description: *Calls* continuation `c` with `0 <= p <= 15` parameters, expecting an arbitrary number of return values.
  Category: cont\_basic Cont Basic

  #### `DB1` JMPXARGS

  Fift: \[p] JMPXARGS
  Description: *Jumps* to continuation `c`, passing only the top `0 <= p <= 15` values from the current stack to it (the remainder of the current stack is discarded).
  Category: cont\_basic Cont Basic

  #### `DB2` RETARGS

  Fift: \[r] RETARGS
  Description: *Returns* to `c0`, with `0 <= r <= 15` return values taken from the current stack.
  Category: cont\_basic Cont Basic

  #### `DB4` RUNVM

  Fift: flags RUNVM
  Description: Runs child VM with code `code` and stack `x_1...x_n`. Returns the resulting stack `x'_1...x'_m` and exitcode. Other arguments and return values are enabled by flags.
  Category: cont\_basic Cont Basic

  #### `ED0` RETURNARGS

  Fift: \[p] RETURNARGS
  Description: Leaves only the top `0 <= p <= 15` values in the current stack (somewhat similarly to `ONLYTOPX`), with all the unused bottom values not discarded, but saved into continuation `c0` in the same way as `SETCONTARGS` does.
  Category: cont\_stack Cont Stack

  #### `ED4` PUSHCTR

  Fift: c\[i] PUSHCTR
  c\[i] PUSH
  Description: Pushes the current value of control register `c(i)`. If the control register is not supported in the current codepage, or if it does not have a value, an exception is triggered.
  Category: cont\_registers Cont Registers
  Alias: PUSHROOT Pushes the ''global data root'' cell reference, thus enabling access to persistent smart-contract data.

  #### `ED5` POPCTR

  Fift: c\[i] POPCTR
  c\[i] POP
  Description: Pops a value `x` from the stack and stores it into control register `c(i)`, if supported in the current codepage. Notice that if a control register accepts only values of a specific type, a type-checking exception may occur.
  Category: cont\_registers Cont Registers
  Alias: POPROOT Sets the ''global data root'' cell reference, thus allowing modification of persistent smart-contract data.

  #### `ED6` SETCONTCTR

  Fift: c\[i] SETCONT
  c\[i] SETCONTCTR
  Description: Stores `x` into the savelist of continuation `c` as `c(i)`, and returns the resulting continuation `c'`. Almost all operations with continuations may be expressed in terms of `SETCONTCTR`, `POPCTR`, and `PUSHCTR`.
  Category: cont\_registers Cont Registers

  #### `ED7` SETRETCTR

  Fift: c\[i] SETRETCTR
  Description: Equivalent to `c0 PUSHCTR` `c[i] SETCONTCTR` `c0 POPCTR`.
  Category: cont\_registers Cont Registers

  #### `ED8` SETALTCTR

  Fift: c\[i] SETALTCTR
  Description: Equivalent to `c1 PUSHCTR` `c[i] SETCONTCTR` `c1 POPCTR`.
  Category: cont\_registers Cont Registers

  #### `ED9` POPSAVE

  Fift: c\[i] POPSAVE
  c\[i] POPCTRSAVE
  Description: Similar to `c[i] POPCTR`, but also saves the old value of `c[i]` into continuation `c0`.
  Equivalent (up to exceptions) to `c[i] SAVECTR` `c[i] POPCTR`.
  Category: cont\_registers Cont Registers

  #### `EDA` SAVE

  Fift: c\[i] SAVE
  c\[i] SAVECTR
  Description: Saves the current value of `c(i)` into the savelist of continuation `c0`. If an entry for `c[i]` is already present in the savelist of `c0`, nothing is done. Equivalent to `c[i] PUSHCTR` `c[i] SETRETCTR`.
  Category: cont\_registers Cont Registers

  #### `EDB` SAVEALT

  Fift: c\[i] SAVEALT
  c\[i] SAVEALTCTR
  Description: Similar to `c[i] SAVE`, but saves the current value of `c[i]` into the savelist of `c1`, not `c0`.
  Category: cont\_registers Cont Registers

  #### `EDC` SAVEBOTH

  Fift: c\[i] SAVEBOTH
  c\[i] SAVEBOTHCTR
  Description: Equivalent to `c[i] SAVE` `c[i] SAVEALT`.
  Category: cont\_registers Cont Registers

  #### `F82` GETPARAM

  Fift: \[i] GETPARAM
  Description: Returns the `i`-th parameter from the *Tuple* provided at `c7` for `0 <= i <= 15`. Equivalent to `c7 PUSHCTR` `FIRST` `[i] INDEX`.
  If one of these internal operations fails, throws an appropriate type checking or range checking exception.
  Category: app\_config App Config
  Alias: NOW Returns the current Unix time as an *Integer*. If it is impossible to recover the requested value starting from `c7`, throws a type checking or range checking exception as appropriate.
  Equivalent to `3 GETPARAM`.
  Alias: BLOCKLT Returns the starting logical time of the current block.
  Equivalent to `4 GETPARAM`.
  Alias: LTIME Returns the logical time of the current transaction.
  Equivalent to `5 GETPARAM`.
  Alias: RANDSEED Returns the current random seed as an unsigned 256-bit *Integer*.
  Equivalent to `6 GETPARAM`.
  Alias: BALANCE Returns the remaining balance of the smart contract as a *Tuple* consisting of an *Integer* (the remaining Gram balance in nanograms) and a *Maybe Cell* (a dictionary with 32-bit keys representing the balance of ''extra currencies'').
  Equivalent to `7 GETPARAM`.
  Note that `RAW` primitives such as `SENDRAWMSG` do not update this field.
  Alias: MYADDR Returns the internal address of the current smart contract as a *Slice* with a `MsgAddressInt`. If necessary, it can be parsed further using primitives such as `PARSEMSGADDR` or `REWRITESTDADDR`.
  Equivalent to `8 GETPARAM`.
  Alias: CONFIGROOT Returns the *Maybe Cell* `D` with the current global configuration dictionary. Equivalent to `9 GETPARAM `.
  Alias: MYCODE Retrieves code of smart-contract from c7. Equivalent to `10 GETPARAM `.
  Alias: INCOMINGVALUE Retrieves value of incoming message from c7. Equivalent to `11 GETPARAM `.
  Alias: STORAGEFEES Retrieves value of storage phase fees from c7. Equivalent to `12 GETPARAM `.
  Alias: PREVBLOCKSINFOTUPLE Retrives PrevBlocksInfo: `[last_mc_blocks, prev_key_block]` from c7. Equivalent to `13 GETPARAM `.

  #### `FEF` DEBUGSTR

  Fift: \&#123string\&#125 DEBUGSTR
  \&#123string\&#125 \&#123x\&#125 DEBUGSTRI
  Description: `0 <= n < 16`. Length of `ssss` is `n+1` bytes.
  `&#123string&#125` is a [string literal](https://github.com/Piterden/TON-docs/blob/master/Fift.%20A%20Brief%20Introduction.md#user-content-29-string-literals).
  `DEBUGSTR`: `ssss` is the given string.
  `DEBUGSTRI`: `ssss` is one-byte integer `0 <= x <= 255` followed by the given string.
  Category: debug Debug

  #### `FFF` SETCP\_SPECIAL

  Fift: \[z-16] SETCP
  Description: Selects TVM codepage `z-16` for `1 <= z <= 15`. Negative codepages `-13...-1` are reserved for restricted versions of TVM needed to validate runs of TVM in other codepages. Negative codepage `-14` is reserved for experimental codepages, not necessarily compatible between different TVM implementations, and should be disabled in the production versions of TVM.
  Category: codepage Codepage

  #### `6F80` TUPLEVAR

  Fift: TUPLEVAR
  Description: Creates a new *Tuple* `t` of length `n` similarly to `TUPLE`, but with `0 <= n <= 255` taken from the stack.
  Category: tuple Tuple

  #### `6F81` INDEXVAR

  Fift: INDEXVAR
  Description: Similar to `k INDEX`, but with `0 <= k <= 254` taken from the stack.
  Category: tuple Tuple

  #### `6F82` UNTUPLEVAR

  Fift: UNTUPLEVAR
  Description: Similar to `n UNTUPLE`, but with `0 <= n <= 255` taken from the stack.
  Category: tuple Tuple

  #### `6F83` UNPACKFIRSTVAR

  Fift: UNPACKFIRSTVAR
  Description: Similar to `n UNPACKFIRST`, but with `0 <= n <= 255` taken from the stack.
  Category: tuple Tuple

  #### `6F84` EXPLODEVAR

  Fift: EXPLODEVAR
  Description: Similar to `n EXPLODE`, but with `0 <= n <= 255` taken from the stack.
  Category: tuple Tuple

  #### `6F85` SETINDEXVAR

  Fift: SETINDEXVAR
  Description: Similar to `k SETINDEX`, but with `0 <= k <= 254` taken from the stack.
  Category: tuple Tuple

  #### `6F86` INDEXVARQ

  Fift: INDEXVARQ
  Description: Similar to `n INDEXQ`, but with `0 <= k <= 254` taken from the stack.
  Category: tuple Tuple

  #### `6F87` SETINDEXVARQ

  Fift: SETINDEXVARQ
  Description: Similar to `k SETINDEXQ`, but with `0 <= k <= 254` taken from the stack.
  Category: tuple Tuple

  #### `6F88` TLEN

  Fift: TLEN
  Description: Returns the length of a *Tuple*.
  Category: tuple Tuple

  #### `6F89` QTLEN

  Fift: QTLEN
  Description: Similar to `TLEN`, but returns `-1` if `t` is not a *Tuple*.
  Category: tuple Tuple

  #### `6F8A` ISTUPLE

  Fift: ISTUPLE
  Description: Returns `-1` or `0` depending on whether `t` is a *Tuple*.
  Category: tuple Tuple

  #### `6F8B` LAST

  Fift: LAST
  Description: Returns the last element of a non-empty *Tuple* `t`.
  Category: tuple Tuple

  #### `6F8C` TPUSH

  Fift: TPUSH
  COMMA
  Description: Appends a value `x` to a *Tuple* `t=(x_1,...,x_n)`, but only if the resulting *Tuple* `t'=(x_1,...,x_n,x)` is of length at most 255. Otherwise throws a type check exception.
  Category: tuple Tuple

  #### `6F8D` TPOP

  Fift: TPOP
  Description: Detaches the last element `x=x_n` from a non-empty *Tuple* `t=(x_1,...,x_n)`, and returns both the resulting *Tuple* `t'=(x_1,...,x_&#123n-1&#125)` and the original last element `x`.
  Category: tuple Tuple

  #### `6FA0` NULLSWAPIF

  Fift: NULLSWAPIF
  Description: Pushes a *Null* under the topmost *Integer* `x`, but only if `x!=0`.
  Category: tuple Tuple

  #### `6FA1` NULLSWAPIFNOT

  Fift: NULLSWAPIFNOT
  Description: Pushes a *Null* under the topmost *Integer* `x`, but only if `x=0`. May be used for stack alignment after quiet primitives such as `PLDUXQ`.
  Category: tuple Tuple

  #### `6FA2` NULLROTRIF

  Fift: NULLROTRIF
  Description: Pushes a *Null* under the second stack entry from the top, but only if the topmost *Integer* `y` is non-zero.
  Category: tuple Tuple

  #### `6FA3` NULLROTRIFNOT

  Fift: NULLROTRIFNOT
  Description: Pushes a *Null* under the second stack entry from the top, but only if the topmost *Integer* `y` is zero. May be used for stack alignment after quiet primitives such as `LDUXQ`.
  Category: tuple Tuple

  #### `6FA4` NULLSWAPIF2

  Fift: NULLSWAPIF2
  Description: Pushes two nulls under the topmost *Integer* `x`, but only if `x!=0`.
  Equivalent to `NULLSWAPIF` `NULLSWAPIF`.
  Category: tuple Tuple

  #### `6FA5` NULLSWAPIFNOT2

  Fift: NULLSWAPIFNOT2
  Description: Pushes two nulls under the topmost *Integer* `x`, but only if `x=0`.
  Equivalent to `NULLSWAPIFNOT` `NULLSWAPIFNOT`.
  Category: tuple Tuple

  #### `6FA6` NULLROTRIF2

  Fift: NULLROTRIF2
  Description: Pushes two nulls under the second stack entry from the top, but only if the topmost *Integer* `y` is non-zero.
  Equivalent to `NULLROTRIF` `NULLROTRIF`.
  Category: tuple Tuple

  #### `6FA7` NULLROTRIFNOT2

  Fift: NULLROTRIFNOT2
  Description: Pushes two nulls under the second stack entry from the top, but only if the topmost *Integer* `y` is zero.
  Equivalent to `NULLROTRIFNOT` `NULLROTRIFNOT`.
  Category: tuple Tuple

  #### `83FF` PUSHNAN

  Fift: PUSHNAN
  Description: Pushes a `NaN`.
  Category: const\_int Const Int

  #### `A900` ADDDIVMOD

  Fift: ADDDIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A901` ADDDIVMODR

  Fift: ADDDIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A902` ADDDIVMODC

  Fift: ADDDIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A904` DIV

  Fift: DIV
  Description: `q=floor(x/y)`, `r=x-y*q`
  Category: arithm\_div Arithm Div

  #### `A905` DIVR

  Fift: DIVR
  Description: `q'=round(x/y)`, `r'=x-y*q'`
  Category: arithm\_div Arithm Div

  #### `A906` DIVC

  Fift: DIVC
  Description: `q''=ceil(x/y)`, `r''=x-y*q''`
  Category: arithm\_div Arithm Div

  #### `A908` MOD

  Fift: MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A909` MODR

  Fift: MODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A90A` MODC

  Fift: MODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A90C` DIVMOD

  Fift: DIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A90D` DIVMODR

  Fift: DIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A90E` DIVMODC

  Fift: DIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A920` ADDRSHIFTMOD\_VAR

  Fift: ADDRSHIFTMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A921` ADDRSHIFTMODR

  Fift: ADDRSHIFTMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A922` ADDRSHIFTMODC

  Fift: ADDRSHIFTMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A925` RSHIFTR\_VAR

  Fift: RSHIFTR
  Description:
  Category: arithm\_div Arithm Div

  #### `A926` RSHIFTC\_VAR

  Fift: RSHIFTC
  Description:
  Category: arithm\_div Arithm Div

  #### `A928` MODPOW2\_VAR

  Fift: MODPOW2
  Description:
  Category: arithm\_div Arithm Div

  #### `A929` MODPOW2R\_VAR

  Fift: MODPOW2R
  Description:
  Category: arithm\_div Arithm Div

  #### `A92A` MODPOW2C\_VAR

  Fift: MODPOW2C
  Description:
  Category: arithm\_div Arithm Div

  #### `A92C` RSHIFTMOD\_VAR

  Fift: RSHIFTMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A92D` RSHIFTMODR\_VAR

  Fift: RSHIFTMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A92E` RSHIFTMODC\_VAR

  Fift: RSHIFTMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A930` ADDRSHIFTMOD

  Fift: \[tt+1] ADDRSHIFT#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A931` ADDRSHIFTRMOD

  Fift: \[tt+1] ADDRSHIFTR#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A932` ADDRSHIFTCMOD

  Fift: \[tt+1] ADDRSHIFTC#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A935` RSHIFTR

  Fift: \[tt+1] RSHIFTR#
  Description:
  Category: arithm\_div Arithm Div

  #### `A936` RSHIFTC

  Fift: \[tt+1] RSHIFTC#
  Description:
  Category: arithm\_div Arithm Div

  #### `A938` MODPOW2

  Fift: \[tt+1] MODPOW2#
  Description:
  Category: arithm\_div Arithm Div

  #### `A939` MODPOW2R

  Fift: \[tt+1] MODPOW2R#
  Description:
  Category: arithm\_div Arithm Div

  #### `A93A` MODPOW2C

  Fift: \[tt+1] MODPOW2C#
  Description:
  Category: arithm\_div Arithm Div

  #### `A93C` RSHIFTMOD

  Fift: \[tt+1] RSHIFT#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A93D` RSHIFTRMOD

  Fift: \[tt+1] RSHIFTR#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A93E` RSHIFTCMOD

  Fift: \[tt+1] RSHIFTC#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A980` MULADDDIVMOD

  Fift: MULADDDIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A981` MULADDDIVMODR

  Fift: MULADDDIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A982` MULADDDIVMODC

  Fift: MULADDDIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A984` MULDIV

  Fift: MULDIV
  Description: `q=floor(x*y/z)`
  Category: arithm\_div Arithm Div

  #### `A985` MULDIVR

  Fift: MULDIVR
  Description: `q'=round(x*y/z)`
  Category: arithm\_div Arithm Div

  #### `A986` MULDIVC

  Fift: MULDIVC
  Description: `q'=ceil(x*y/z)`
  Category: arithm\_div Arithm Div

  #### `A988` MULMOD

  Fift: MULMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A989` MULMODR

  Fift: MULMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A98A` MULMODC

  Fift: MULMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A98C` MULDIVMOD

  Fift: MULDIVMOD
  Description: `q=floor(x*y/z)`, `r=x*y-z*q`
  Category: arithm\_div Arithm Div

  #### `A98D` MULDIVMODR

  Fift: MULDIVMODR
  Description: `q=round(x*y/z)`, `r=x*y-z*q`
  Category: arithm\_div Arithm Div

  #### `A98E` MULDIVMODC

  Fift: MULDIVMODC
  Description: `q=ceil(x*y/z)`, `r=x*y-z*q`
  Category: arithm\_div Arithm Div

  #### `A9A0` MULADDRSHIFTMOD\_VAR

  Fift: MULADDRSHIFTMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9A1` MULADDRSHIFTRMOD\_VAR

  Fift: MULADDRSHIFTRMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9A2` MULADDRSHIFTCMOD\_VAR

  Fift: MULADDRSHIFTCMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9A4` MULRSHIFT\_VAR

  Fift: MULRSHIFT
  Description: `0 <= z <= 256`
  Category: arithm\_div Arithm Div

  #### `A9A5` MULRSHIFTR\_VAR

  Fift: MULRSHIFTR
  Description: `0 <= z <= 256`
  Category: arithm\_div Arithm Div

  #### `A9A6` MULRSHIFTC\_VAR

  Fift: MULRSHIFTC
  Description: `0 <= z <= 256`
  Category: arithm\_div Arithm Div

  #### `A9A8` MULMODPOW2\_VAR

  Fift: MULMODPOW2\_VAR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9A9` MULMODPOW2R\_VAR

  Fift: MULMODPOW2R\_VAR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9AA` MULMODPOW2C\_VAR

  Fift: MULMODPOW2C\_VAR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9AC` MULRSHIFTMOD\_VAR

  Fift: MULRSHIFTMOD\_VAR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9AD` MULRSHIFTRMOD\_VAR

  Fift: MULRSHIFTRMOD\_VAR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9AE` MULRSHIFTCMOD\_VAR

  Fift: MULRSHIFTCMOD\_VAR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B0` MULADDRSHIFTMOD

  Fift: \[tt+1] MULADDRSHIFT#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B1` MULADDRSHIFTRMOD

  Fift: \[tt+1] MULADDRSHIFTR#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B2` MULADDRSHIFTCMOD

  Fift: \[tt+1] MULADDRSHIFTC#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B4` MULRSHIFT

  Fift: \[tt+1] MULRSHIFT#
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B5` MULRSHIFTR

  Fift: \[tt+1] MULRSHIFTR#
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B6` MULRSHIFTC

  Fift: \[tt+1] MULRSHIFTC#
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B8` MULMODPOW2

  Fift: \[tt+1] MULMODPOW2#
  Description:
  Category: arithm\_div Arithm Div

  #### `A9B9` MULMODPOW2R

  Fift: \[tt+1] MULMODPOW2R#
  Description:
  Category: arithm\_div Arithm Div

  #### `A9BA` MULMODPOW2C

  Fift: \[tt+1] MULMODPOW2C#
  Description:
  Category: arithm\_div Arithm Div

  #### `A9BC` MULRSHIFTMOD

  Fift: MULRSHIFT#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9BD` MULRSHIFTRMOD

  Fift: MULRSHIFTR#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9BE` MULRSHIFTCMOD

  Fift: MULRSHIFTC#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9C0` LSHIFTADDDIVMOD\_VAR

  Fift: LSHIFTADDDIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9C1` LSHIFTADDDIVMODR\_VAR

  Fift: LSHIFTADDDIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9C2` LSHIFTADDDIVMODC\_VAR

  Fift: LSHIFTADDDIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A9C4` LSHIFTDIV\_VAR

  Fift: LSHIFTDIV
  Description: `0 <= z <= 256`
  Category: arithm\_div Arithm Div

  #### `A9C5` LSHIFTDIVR\_VAR

  Fift: LSHIFTDIVR
  Description: `0 <= z <= 256`
  Category: arithm\_div Arithm Div

  #### `A9C6` LSHIFTDIVC\_VAR

  Fift: LSHIFTDIVC
  Description: `0 <= z <= 256`
  Category: arithm\_div Arithm Div

  #### `A9C8` LSHIFTMOD\_VAR

  Fift: LSHIFTMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9C9` LSHIFTMODR\_VAR

  Fift: LSHIFTMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9CA` LSHIFTMODC\_VAR

  Fift: LSHIFTMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A9CC` LSHIFTDIVMOD\_VAR

  Fift: LSHIFTDIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9CD` LSHIFTDIVMODR\_VAR

  Fift: LSHIFTDIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9CE` LSHIFTDIVMODC\_VAR

  Fift: LSHIFTDIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D0` LSHIFTADDDIVMOD

  Fift: \[tt+1] LSHIFT#ADDDIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D1` LSHIFTADDDIVMODR

  Fift: \[tt+1] LSHIFT#ADDDIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D2` LSHIFTADDDIVMODC

  Fift: \[tt+1] LSHIFT#ADDDIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D4` LSHIFTDIV

  Fift: \[tt+1] LSHIFT#DIV
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D5` LSHIFTDIVR

  Fift: \[tt+1] LSHIFT#DIVR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D6` LSHIFTDIVC

  Fift: \[tt+1] LSHIFT#DIVC
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D8` LSHIFTMOD

  Fift: \[tt+1] LSHIFT#MOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9D9` LSHIFTMODR

  Fift: \[tt+1] LSHIFT#MODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9DA` LSHIFTMODC

  Fift: \[tt+1] LSHIFT#MODC
  Description:
  Category: arithm\_div Arithm Div

  #### `A9DC` LSHIFTDIVMOD

  Fift: \[tt+1] LSHIFT#DIVMOD
  Description:
  Category: arithm\_div Arithm Div

  #### `A9DD` LSHIFTDIVMODR

  Fift: \[tt+1] LSHIFT#DIVMODR
  Description:
  Category: arithm\_div Arithm Div

  #### `A9DE` LSHIFTDIVMODC

  Fift: \[tt+1] LSHIFT#DIVMODC
  Description:
  Category: arithm\_div Arithm Div

  #### `B600` FITSX

  Fift: FITSX
  Description: Checks whether `x` is a `c`-bit signed integer for `0 <= c <= 1023`.
  Category: arithm\_logical Arithm Logical

  #### `B601` UFITSX

  Fift: UFITSX
  Description: Checks whether `x` is a `c`-bit unsigned integer for `0 <= c <= 1023`.
  Category: arithm\_logical Arithm Logical

  #### `B602` BITSIZE

  Fift: BITSIZE
  Description: Computes smallest `c >= 0` such that `x` fits into a `c`-bit signed integer (`-2^(c-1) <= c < 2^(c-1)`).
  Category: arithm\_logical Arithm Logical

  #### `B603` UBITSIZE

  Fift: UBITSIZE
  Description: Computes smallest `c >= 0` such that `x` fits into a `c`-bit unsigned integer (`0 <= x < 2^c`), or throws a range check exception.
  Category: arithm\_logical Arithm Logical

  #### `B608` MIN

  Fift: MIN
  Description: Computes the minimum of two integers `x` and `y`.
  Category: arithm\_logical Arithm Logical

  #### `B609` MAX

  Fift: MAX
  Description: Computes the maximum of two integers `x` and `y`.
  Category: arithm\_logical Arithm Logical

  #### `B60A` MINMAX

  Fift: MINMAX
  INTSORT2
  Description: Sorts two integers. Quiet version of this operation returns two `NaN`s if any of the arguments are `NaN`s.
  Category: arithm\_logical Arithm Logical

  #### `B60B` ABS

  Fift: ABS
  Description: Computes the absolute value of an integer `x`.
  Category: arithm\_logical Arithm Logical

  #### `B7A0` QADD

  Fift: QADD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A1` QSUB

  Fift: QSUB
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A2` QSUBR

  Fift: QSUBR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A3` QNEGATE

  Fift: QNEGATE
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A4` QINC

  Fift: QINC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A5` QDEC

  Fift: QDEC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A8` QMUL

  Fift: QMUL
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7AA` QLSHIFT

  Fift: \[cc+1] QLSHIFT#
  Description: `0 <= cc <= 255`
  Category: arithm\_quiet Arithm Quiet

  #### `B7AB` QRSHIFT

  Fift: \[cc+1] QRSHIFT#
  Description: `0 <= cc <= 255`
  Category: arithm\_quiet Arithm Quiet

  #### `B7AC` QLSHIFT\_VAR

  Fift: QLSHIFT
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7AD` QRSHIFT\_VAR

  Fift: QRSHIFT
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7AE` QPOW2

  Fift: QPOW2
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7B0` QAND

  Fift: QAND
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7B1` QOR

  Fift: QOR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7B2` QXOR

  Fift: QXOR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7B3` QNOT

  Fift: QNOT
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7B4` QFITS

  Fift: \[cc+1] QFITS
  Description: Replaces `x` with a `NaN` if x is not a `cc+1`-bit signed integer, leaves it intact otherwise.
  Category: arithm\_quiet Arithm Quiet

  #### `B7B5` QUFITS

  Fift: \[cc+1] QUFITS
  Description: Replaces `x` with a `NaN` if x is not a `cc+1`-bit unsigned integer, leaves it intact otherwise.
  Category: arithm\_quiet Arithm Quiet

  #### `C700` SEMPTY

  Fift: SEMPTY
  Description: Checks whether a *Slice* `s` is empty (i.e., contains no bits of data and no cell references).
  Category: compare\_other Compare Other

  #### `C701` SDEMPTY

  Fift: SDEMPTY
  Description: Checks whether *Slice* `s` has no bits of data.
  Category: compare\_other Compare Other

  #### `C702` SREMPTY

  Fift: SREMPTY
  Description: Checks whether *Slice* `s` has no references.
  Category: compare\_other Compare Other

  #### `C703` SDFIRST

  Fift: SDFIRST
  Description: Checks whether the first bit of *Slice* `s` is a one.
  Category: compare\_other Compare Other

  #### `C704` SDLEXCMP

  Fift: SDLEXCMP
  Description: Compares the data of `s` lexicographically with the data of `s'`, returning `-1`, 0, or 1 depending on the result.
  Category: compare\_other Compare Other

  #### `C705` SDEQ

  Fift: SDEQ
  Description: Checks whether the data parts of `s` and `s'` coincide, equivalent to `SDLEXCMP` `ISZERO`.
  Category: compare\_other Compare Other

  #### `C708` SDPFX

  Fift: SDPFX
  Description: Checks whether `s` is a prefix of `s'`.
  Category: compare\_other Compare Other

  #### `C709` SDPFXREV

  Fift: SDPFXREV
  Description: Checks whether `s'` is a prefix of `s`, equivalent to `SWAP` `SDPFX`.
  Category: compare\_other Compare Other

  #### `C70A` SDPPFX

  Fift: SDPPFX
  Description: Checks whether `s` is a proper prefix of `s'` (i.e., a prefix distinct from `s'`).
  Category: compare\_other Compare Other

  #### `C70B` SDPPFXREV

  Fift: SDPPFXREV
  Description: Checks whether `s'` is a proper prefix of `s`.
  Category: compare\_other Compare Other

  #### `C70C` SDSFX

  Fift: SDSFX
  Description: Checks whether `s` is a suffix of `s'`.
  Category: compare\_other Compare Other

  #### `C70D` SDSFXREV

  Fift: SDSFXREV
  Description: Checks whether `s'` is a suffix of `s`.
  Category: compare\_other Compare Other

  #### `C70E` SDPSFX

  Fift: SDPSFX
  Description: Checks whether `s` is a proper suffix of `s'`.
  Category: compare\_other Compare Other

  #### `C70F` SDPSFXREV

  Fift: SDPSFXREV
  Description: Checks whether `s'` is a proper suffix of `s`.
  Category: compare\_other Compare Other

  #### `C710` SDCNTLEAD0

  Fift: SDCNTLEAD0
  Description: Returns the number of leading zeroes in `s`.
  Category: compare\_other Compare Other

  #### `C711` SDCNTLEAD1

  Fift: SDCNTLEAD1
  Description: Returns the number of leading ones in `s`.
  Category: compare\_other Compare Other

  #### `C712` SDCNTTRAIL0

  Fift: SDCNTTRAIL0
  Description: Returns the number of trailing zeroes in `s`.
  Category: compare\_other Compare Other

  #### `C713` SDCNTTRAIL1

  Fift: SDCNTTRAIL1
  Description: Returns the number of trailing ones in `s`.
  Category: compare\_other Compare Other

  #### `CF00` STIX

  Fift: STIX
  Description: Stores a signed `l`-bit integer `x` into `b` for `0 <= l <= 257`.
  Category: cell\_build Cell Build

  #### `CF01` STUX

  Fift: STUX
  Description: Stores an unsigned `l`-bit integer `x` into `b` for `0 <= l <= 256`.
  Category: cell\_build Cell Build

  #### `CF02` STIXR

  Fift: STIXR
  Description: Similar to `STIX`, but with arguments in a different order.
  Category: cell\_build Cell Build

  #### `CF03` STUXR

  Fift: STUXR
  Description: Similar to `STUX`, but with arguments in a different order.
  Category: cell\_build Cell Build

  #### `CF04` STIXQ

  Fift: STIXQ
  Description: A quiet version of `STIX`. If there is no space in `b`, sets `b'=b` and `f=-1`.
  If `x` does not fit into `l` bits, sets `b'=b` and `f=1`.
  If the operation succeeds, `b'` is the new *Builder* and `f=0`.
  However, `0 <= l <= 257`, with a range check exception if this is not so.
  Category: cell\_build Cell Build

  #### `CF05` STUXQ

  Fift: STUXQ
  Description: A quiet version of `STUX`.
  Category: cell\_build Cell Build

  #### `CF06` STIXRQ

  Fift: STIXRQ
  Description: A quiet version of `STIXR`.
  Category: cell\_build Cell Build

  #### `CF07` STUXRQ

  Fift: STUXRQ
  Description: A quiet version of `STUXR`.
  Category: cell\_build Cell Build

  #### `CF08` STI\_ALT

  Fift: \[cc+1] STI\_l
  Description: A longer version of `[cc+1] STI`.
  Category: cell\_build Cell Build

  #### `CF09` STU\_ALT

  Fift: \[cc+1] STU\_l
  Description: A longer version of `[cc+1] STU`.
  Category: cell\_build Cell Build

  #### `CF0A` STIR

  Fift: \[cc+1] STIR
  Description: Equivalent to `SWAP` `[cc+1] STI`.
  Category: cell\_build Cell Build

  #### `CF0B` STUR

  Fift: \[cc+1] STUR
  Description: Equivalent to `SWAP` `[cc+1] STU`.
  Category: cell\_build Cell Build

  #### `CF0C` STIQ

  Fift: \[cc+1] STIQ
  Description: A quiet version of `STI`.
  Category: cell\_build Cell Build

  #### `CF0D` STUQ

  Fift: \[cc+1] STUQ
  Description: A quiet version of `STU`.
  Category: cell\_build Cell Build

  #### `CF0E` STIRQ

  Fift: \[cc+1] STIRQ
  Description: A quiet version of `STIR`.
  Category: cell\_build Cell Build

  #### `CF0F` STURQ

  Fift: \[cc+1] STURQ
  Description: A quiet version of `STUR`.
  Category: cell\_build Cell Build

  #### `CF10` STREF\_ALT

  Fift: STREF\_l
  Description: A longer version of `STREF`.
  Category: cell\_build Cell Build

  #### `CF11` STBREF

  Fift: STBREF
  Description: Equivalent to `SWAP` `STBREFR`.
  Category: cell\_build Cell Build

  #### `CF12` STSLICE\_ALT

  Fift: STSLICE\_l
  Description: A longer version of `STSLICE`.
  Category: cell\_build Cell Build

  #### `CF13` STB

  Fift: STB
  Description: Appends all data from *Builder* `b'` to *Builder* `b`.
  Category: cell\_build Cell Build

  #### `CF14` STREFR

  Fift: STREFR
  Description: Equivalent to `SWAP` `STREF`.
  Category: cell\_build Cell Build

  #### `CF15` STBREFR\_ALT

  Fift: STBREFR\_l
  Description: A longer encoding of `STBREFR`.
  Category: cell\_build Cell Build

  #### `CF16` STSLICER

  Fift: STSLICER
  Description: Equivalent to `SWAP` `STSLICE`.
  Category: cell\_build Cell Build

  #### `CF17` STBR

  Fift: STBR
  BCONCAT
  Description: Concatenates two builders.
  Equivalent to `SWAP` `STB`.
  Category: cell\_build Cell Build

  #### `CF18` STREFQ

  Fift: STREFQ
  Description: Quiet version of `STREF`.
  Category: cell\_build Cell Build

  #### `CF19` STBREFQ

  Fift: STBREFQ
  Description: Quiet version of `STBREF`.
  Category: cell\_build Cell Build

  #### `CF1A` STSLICEQ

  Fift: STSLICEQ
  Description: Quiet version of `STSLICE`.
  Category: cell\_build Cell Build

  #### `CF1B` STBQ

  Fift: STBQ
  Description: Quiet version of `STB`.
  Category: cell\_build Cell Build

  #### `CF1C` STREFRQ

  Fift: STREFRQ
  Description: Quiet version of `STREFR`.
  Category: cell\_build Cell Build

  #### `CF1D` STBREFRQ

  Fift: STBREFRQ
  Description: Quiet version of `STBREFR`.
  Category: cell\_build Cell Build

  #### `CF1E` STSLICERQ

  Fift: STSLICERQ
  Description: Quiet version of `STSLICER`.
  Category: cell\_build Cell Build

  #### `CF1F` STBRQ

  Fift: STBRQ
  BCONCATQ
  Description: Quiet version of `STBR`.
  Category: cell\_build Cell Build

  #### `CF20` STREFCONST

  Fift: \[ref] STREFCONST
  Description: Equivalent to `PUSHREF` `STREFR`.
  Category: cell\_build Cell Build

  #### `CF21` STREF2CONST

  Fift: \[ref] \[ref] STREF2CONST
  Description: Equivalent to `STREFCONST` `STREFCONST`.
  Category: cell\_build Cell Build

  #### `CF23` ENDXC

  Fift: ENDXC
  Description: If `x!=0`, creates a *special* or *exotic* cell from *Builder* `b`.
  The type of the exotic cell must be stored in the first 8 bits of `b`.
  If `x=0`, it is equivalent to `ENDC`. Otherwise some validity checks on the data and references of `b` are performed before creating the exotic cell.
  Category: cell\_build Cell Build

  #### `CF28` STILE4

  Fift: STILE4
  Description: Stores a little-endian signed 32-bit integer.
  Category: cell\_build Cell Build

  #### `CF29` STULE4

  Fift: STULE4
  Description: Stores a little-endian unsigned 32-bit integer.
  Category: cell\_build Cell Build

  #### `CF2A` STILE8

  Fift: STILE8
  Description: Stores a little-endian signed 64-bit integer.
  Category: cell\_build Cell Build

  #### `CF2B` STULE8

  Fift: STULE8
  Description: Stores a little-endian unsigned 64-bit integer.
  Category: cell\_build Cell Build

  #### `CF30` BDEPTH

  Fift: BDEPTH
  Description: Returns the depth of *Builder* `b`. If no cell references are stored in `b`, then `x=0`; otherwise `x` is one plus the maximum of depths of cells referred to from `b`.
  Category: cell\_build Cell Build

  #### `CF31` BBITS

  Fift: BBITS
  Description: Returns the number of data bits already stored in *Builder* `b`.
  Category: cell\_build Cell Build

  #### `CF32` BREFS

  Fift: BREFS
  Description: Returns the number of cell references already stored in `b`.
  Category: cell\_build Cell Build

  #### `CF33` BBITREFS

  Fift: BBITREFS
  Description: Returns the numbers of both data bits and cell references in `b`.
  Category: cell\_build Cell Build

  #### `CF35` BREMBITS

  Fift: BREMBITS
  Description: Returns the number of data bits that can still be stored in `b`.
  Category: cell\_build Cell Build

  #### `CF36` BREMREFS

  Fift: BREMREFS
  Description: Returns the number of references that can still be stored in `b`.
  Category: cell\_build Cell Build

  #### `CF37` BREMBITREFS

  Fift: BREMBITREFS
  Description: Returns the numbers of both data bits and references that can still be stored in `b`.
  Category: cell\_build Cell Build

  #### `CF38` BCHKBITS

  Fift: \[cc+1] BCHKBITS#
  Description: Checks whether `cc+1` bits can be stored into `b`, where `0 <= cc <= 255`.
  Category: cell\_build Cell Build

  #### `CF39` BCHKBITS\_VAR

  Fift: BCHKBITS
  Description: Checks whether `x` bits can be stored into `b`, `0 <= x <= 1023`. If there is no space for `x` more bits in `b`, or if `x` is not within the range `0...1023`, throws an exception.
  Category: cell\_build Cell Build

  #### `CF3A` BCHKREFS

  Fift: BCHKREFS
  Description: Checks whether `y` references can be stored into `b`, `0 <= y <= 7`.
  Category: cell\_build Cell Build

  #### `CF3B` BCHKBITREFS

  Fift: BCHKBITREFS
  Description: Checks whether `x` bits and `y` references can be stored into `b`, `0 <= x <= 1023`, `0 <= y <= 7`.
  Category: cell\_build Cell Build

  #### `CF3C` BCHKBITSQ

  Fift: \[cc+1] BCHKBITSQ#
  Description: Checks whether `cc+1` bits can be stored into `b`, where `0 <= cc <= 255`.
  Category: cell\_build Cell Build

  #### `CF3D` BCHKBITSQ\_VAR

  Fift: BCHKBITSQ
  Description: Checks whether `x` bits can be stored into `b`, `0 <= x <= 1023`.
  Category: cell\_build Cell Build

  #### `CF3E` BCHKREFSQ

  Fift: BCHKREFSQ
  Description: Checks whether `y` references can be stored into `b`, `0 <= y <= 7`.
  Category: cell\_build Cell Build

  #### `CF3F` BCHKBITREFSQ

  Fift: BCHKBITREFSQ
  Description: Checks whether `x` bits and `y` references can be stored into `b`, `0 <= x <= 1023`, `0 <= y <= 7`.
  Category: cell\_build Cell Build

  #### `CF40` STZEROES

  Fift: STZEROES
  Description: Stores `n` binary zeroes into *Builder* `b`.
  Category: cell\_build Cell Build

  #### `CF41` STONES

  Fift: STONES
  Description: Stores `n` binary ones into *Builder* `b`.
  Category: cell\_build Cell Build

  #### `CF42` STSAME

  Fift: STSAME
  Description: Stores `n` binary `x`es (`0 <= x <= 1`) into *Builder* `b`.
  Category: cell\_build Cell Build

  #### `D700` LDIX

  Fift: LDIX
  Description: Loads a signed `l`-bit (`0 <= l <= 257`) integer `x` from *Slice* `s`, and returns the remainder of `s` as `s'`.
  Category: cell\_parse Cell Parse

  #### `D701` LDUX

  Fift: LDUX
  Description: Loads an unsigned `l`-bit integer `x` from (the first `l` bits of) `s`, with `0 <= l <= 256`.
  Category: cell\_parse Cell Parse

  #### `D702` PLDIX

  Fift: PLDIX
  Description: Preloads a signed `l`-bit integer from *Slice* `s`, for `0 <= l <= 257`.
  Category: cell\_parse Cell Parse

  #### `D703` PLDUX

  Fift: PLDUX
  Description: Preloads an unsigned `l`-bit integer from `s`, for `0 <= l <= 256`.
  Category: cell\_parse Cell Parse

  #### `D704` LDIXQ

  Fift: LDIXQ
  Description: Quiet version of `LDIX`: loads a signed `l`-bit integer from `s` similarly to `LDIX`, but returns a success flag, equal to `-1` on success or to `0` on failure (if `s` does not have `l` bits), instead of throwing a cell underflow exception.
  Category: cell\_parse Cell Parse

  #### `D705` LDUXQ

  Fift: LDUXQ
  Description: Quiet version of `LDUX`.
  Category: cell\_parse Cell Parse

  #### `D706` PLDIXQ

  Fift: PLDIXQ
  Description: Quiet version of `PLDIX`.
  Category: cell\_parse Cell Parse

  #### `D707` PLDUXQ

  Fift: PLDUXQ
  Description: Quiet version of `PLDUX`.
  Category: cell\_parse Cell Parse

  #### `D708` LDI\_ALT

  Fift: \[cc+1] LDI\_l
  Description: A longer encoding for `LDI`.
  Category: cell\_parse Cell Parse

  #### `D709` LDU\_ALT

  Fift: \[cc+1] LDU\_l
  Description: A longer encoding for `LDU`.
  Category: cell\_parse Cell Parse

  #### `D70A` PLDI

  Fift: \[cc+1] PLDI
  Description: Preloads a signed `cc+1`-bit integer from *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D70B` PLDU

  Fift: \[cc+1] PLDU
  Description: Preloads an unsigned `cc+1`-bit integer from `s`.
  Category: cell\_parse Cell Parse

  #### `D70C` LDIQ

  Fift: \[cc+1] LDIQ
  Description: A quiet version of `LDI`.
  Category: cell\_parse Cell Parse

  #### `D70D` LDUQ

  Fift: \[cc+1] LDUQ
  Description: A quiet version of `LDU`.
  Category: cell\_parse Cell Parse

  #### `D70E` PLDIQ

  Fift: \[cc+1] PLDIQ
  Description: A quiet version of `PLDI`.
  Category: cell\_parse Cell Parse

  #### `D70F` PLDUQ

  Fift: \[cc+1] PLDUQ
  Description: A quiet version of `PLDU`.
  Category: cell\_parse Cell Parse

  #### `D718` LDSLICEX

  Fift: LDSLICEX
  Description: Loads the first `0 <= l <= 1023` bits from *Slice* `s` into a separate *Slice* `s''`, returning the remainder of `s` as `s'`.
  Category: cell\_parse Cell Parse

  #### `D719` PLDSLICEX

  Fift: PLDSLICEX
  Description: Returns the first `0 <= l <= 1023` bits of `s` as `s''`.
  Category: cell\_parse Cell Parse

  #### `D71A` LDSLICEXQ

  Fift: LDSLICEXQ
  Description: A quiet version of `LDSLICEX`.
  Category: cell\_parse Cell Parse

  #### `D71B` PLDSLICEXQ

  Fift: PLDSLICEXQ
  Description: A quiet version of `LDSLICEXQ`.
  Category: cell\_parse Cell Parse

  #### `D71C` LDSLICE\_ALT

  Fift: \[cc+1] LDSLICE\_l
  Description: A longer encoding for `LDSLICE`.
  Category: cell\_parse Cell Parse

  #### `D71D` PLDSLICE

  Fift: \[cc+1] PLDSLICE
  Description: Returns the first `0 < cc+1 <= 256` bits of `s` as `s''`.
  Category: cell\_parse Cell Parse

  #### `D71E` LDSLICEQ

  Fift: \[cc+1] LDSLICEQ
  Description: A quiet version of `LDSLICE`.
  Category: cell\_parse Cell Parse

  #### `D71F` PLDSLICEQ

  Fift: \[cc+1] PLDSLICEQ
  Description: A quiet version of `PLDSLICE`.
  Category: cell\_parse Cell Parse

  #### `D720` SDCUTFIRST

  Fift: SDCUTFIRST
  Description: Returns the first `0 <= l <= 1023` bits of `s`. It is equivalent to `PLDSLICEX`.
  Category: cell\_parse Cell Parse

  #### `D721` SDSKIPFIRST

  Fift: SDSKIPFIRST
  Description: Returns all but the first `0 <= l <= 1023` bits of `s`. It is equivalent to `LDSLICEX` `NIP`.
  Category: cell\_parse Cell Parse

  #### `D722` SDCUTLAST

  Fift: SDCUTLAST
  Description: Returns the last `0 <= l <= 1023` bits of `s`.
  Category: cell\_parse Cell Parse

  #### `D723` SDSKIPLAST

  Fift: SDSKIPLAST
  Description: Returns all but the last `0 <= l <= 1023` bits of `s`.
  Category: cell\_parse Cell Parse

  #### `D724` SDSUBSTR

  Fift: SDSUBSTR
  Description: Returns `0 <= l' <= 1023` bits of `s` starting from offset `0 <= l <= 1023`, thus extracting a bit substring out of the data of `s`.
  Category: cell\_parse Cell Parse

  #### `D726` SDBEGINSX

  Fift: SDBEGINSX
  Description: Checks whether `s` begins with (the data bits of) `s'`, and removes `s'` from `s` on success. On failure throws a cell deserialization exception. Primitive `SDPFXREV` can be considered a quiet version of `SDBEGINSX`.
  Category: cell\_parse Cell Parse

  #### `D727` SDBEGINSXQ

  Fift: SDBEGINSXQ
  Description: A quiet version of `SDBEGINSX`.
  Category: cell\_parse Cell Parse

  #### `D730` SCUTFIRST

  Fift: SCUTFIRST
  Description: Returns the first `0 <= l <= 1023` bits and first `0 <= r <= 4` references of `s`.
  Category: cell\_parse Cell Parse

  #### `D731` SSKIPFIRST

  Fift: SSKIPFIRST
  Description: Returns all but the first `l` bits of `s` and `r` references of `s`.
  Category: cell\_parse Cell Parse

  #### `D732` SCUTLAST

  Fift: SCUTLAST
  Description: Returns the last `0 <= l <= 1023` data bits and last `0 <= r <= 4` references of `s`.
  Category: cell\_parse Cell Parse

  #### `D733` SSKIPLAST

  Fift: SSKIPLAST
  Description: Returns all but the last `l` bits of `s` and `r` references of `s`.
  Category: cell\_parse Cell Parse

  #### `D734` SUBSLICE

  Fift: SUBSLICE
  Description: Returns `0 <= l' <= 1023` bits and `0 <= r' <= 4` references from *Slice* `s`, after skipping the first `0 <= l <= 1023` bits and first `0 <= r <= 4` references.
  Category: cell\_parse Cell Parse

  #### `D736` SPLIT

  Fift: SPLIT
  Description: Splits the first `0 <= l <= 1023` data bits and first `0 <= r <= 4` references from `s` into `s'`, returning the remainder of `s` as `s''`.
  Category: cell\_parse Cell Parse

  #### `D737` SPLITQ

  Fift: SPLITQ
  Description: A quiet version of `SPLIT`.
  Category: cell\_parse Cell Parse

  #### `D739` XCTOS

  Fift: XCTOS
  Description: Transforms an ordinary or exotic cell into a *Slice*, as if it were an ordinary cell. A flag is returned indicating whether `c` is exotic. If that be the case, its type can later be deserialized from the first eight bits of `s`.
  Category: cell\_parse Cell Parse

  #### `D73A` XLOAD

  Fift: XLOAD
  Description: Loads an exotic cell `c` and returns an ordinary cell `c'`. If `c` is already ordinary, does nothing. If `c` cannot be loaded, throws an exception.
  Category: cell\_parse Cell Parse

  #### `D73B` XLOADQ

  Fift: XLOADQ
  Description: Loads an exotic cell `c` and returns an ordinary cell `c'`. If `c` is already ordinary, does nothing. If `c` cannot be loaded, returns 0.
  Category: cell\_parse Cell Parse

  #### `D741` SCHKBITS

  Fift: SCHKBITS
  Description: Checks whether there are at least `l` data bits in *Slice* `s`. If this is not the case, throws a cell deserialization (i.e., cell underflow) exception.
  Category: cell\_parse Cell Parse

  #### `D742` SCHKREFS

  Fift: SCHKREFS
  Description: Checks whether there are at least `r` references in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D743` SCHKBITREFS

  Fift: SCHKBITREFS
  Description: Checks whether there are at least `l` data bits and `r` references in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D745` SCHKBITSQ

  Fift: SCHKBITSQ
  Description: Checks whether there are at least `l` data bits in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D746` SCHKREFSQ

  Fift: SCHKREFSQ
  Description: Checks whether there are at least `r` references in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D747` SCHKBITREFSQ

  Fift: SCHKBITREFSQ
  Description: Checks whether there are at least `l` data bits and `r` references in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D748` PLDREFVAR

  Fift: PLDREFVAR
  Description: Returns the `n`-th cell reference of *Slice* `s` for `0 <= n <= 3`.
  Category: cell\_parse Cell Parse

  #### `D749` SBITS

  Fift: SBITS
  Description: Returns the number of data bits in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D74A` SREFS

  Fift: SREFS
  Description: Returns the number of references in *Slice* `s`.
  Category: cell\_parse Cell Parse

  #### `D74B` SBITREFS

  Fift: SBITREFS
  Description: Returns both the number of data bits and the number of references in `s`.
  Category: cell\_parse Cell Parse

  #### `D750` LDILE4

  Fift: LDILE4
  Description: Loads a little-endian signed 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D751` LDULE4

  Fift: LDULE4
  Description: Loads a little-endian unsigned 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D752` LDILE8

  Fift: LDILE8
  Description: Loads a little-endian signed 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D753` LDULE8

  Fift: LDULE8
  Description: Loads a little-endian unsigned 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D754` PLDILE4

  Fift: PLDILE4
  Description: Preloads a little-endian signed 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D755` PLDULE4

  Fift: PLDULE4
  Description: Preloads a little-endian unsigned 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D756` PLDILE8

  Fift: PLDILE8
  Description: Preloads a little-endian signed 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D757` PLDULE8

  Fift: PLDULE8
  Description: Preloads a little-endian unsigned 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D758` LDILE4Q

  Fift: LDILE4Q
  Description: Quietly loads a little-endian signed 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D759` LDULE4Q

  Fift: LDULE4Q
  Description: Quietly loads a little-endian unsigned 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D75A` LDILE8Q

  Fift: LDILE8Q
  Description: Quietly loads a little-endian signed 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D75B` LDULE8Q

  Fift: LDULE8Q
  Description: Quietly loads a little-endian unsigned 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D75C` PLDILE4Q

  Fift: PLDILE4Q
  Description: Quietly preloads a little-endian signed 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D75D` PLDULE4Q

  Fift: PLDULE4Q
  Description: Quietly preloads a little-endian unsigned 32-bit integer.
  Category: cell\_parse Cell Parse

  #### `D75E` PLDILE8Q

  Fift: PLDILE8Q
  Description: Quietly preloads a little-endian signed 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D75F` PLDULE8Q

  Fift: PLDULE8Q
  Description: Quietly preloads a little-endian unsigned 64-bit integer.
  Category: cell\_parse Cell Parse

  #### `D760` LDZEROES

  Fift: LDZEROES
  Description: Returns the count `n` of leading zero bits in `s`, and removes these bits from `s`.
  Category: cell\_parse Cell Parse

  #### `D761` LDONES

  Fift: LDONES
  Description: Returns the count `n` of leading one bits in `s`, and removes these bits from `s`.
  Category: cell\_parse Cell Parse

  #### `D762` LDSAME

  Fift: LDSAME
  Description: Returns the count `n` of leading bits equal to `0 <= x <= 1` in `s`, and removes these bits from `s`.
  Category: cell\_parse Cell Parse

  #### `D764` SDEPTH

  Fift: SDEPTH
  Description: Returns the depth of *Slice* `s`. If `s` has no references, then `x=0`; otherwise `x` is one plus the maximum of depths of cells referred to from `s`.
  Category: cell\_parse Cell Parse

  #### `D765` CDEPTH

  Fift: CDEPTH
  Description: Returns the depth of *Cell* `c`. If `c` has no references, then `x=0`; otherwise `x` is one plus the maximum of depths of cells referred to from `c`. If `c` is a *Null* instead of a *Cell*, returns zero.
  Category: cell\_parse Cell Parse

  #### `D766` CLEVEL

  Fift: CLEVEL
  Description: Returns level of the cell.
  Category: cell\_parse Cell Parse

  #### `D767` CLEVELMASK

  Fift: CLEVELMASK
  Description: Returns level mask of the cell.
  Category: cell\_parse Cell Parse

  #### `D770` CHASHIX

  Fift: CHASHIX
  Description: Returns `i`th hash of the cell.
  Category: cell\_parse Cell Parse

  #### `D771` CDEPTHIX

  Fift: CDEPTHIX
  Description: Returns `i`th depth of the cell.
  Category: cell\_parse Cell Parse

  #### `DB30` RET

  Fift: RET
  RETTRUE
  Description: *Returns* to the continuation at `c0`. The remainder of the current continuation `cc` is discarded.
  Approximately equivalent to `c0 PUSHCTR` `JMPX`.
  Category: cont\_basic Cont Basic

  #### `DB31` RETALT

  Fift: RETALT
  RETFALSE
  Description: *Returns* to the continuation at `c1`.
  Approximately equivalent to `c1 PUSHCTR` `JMPX`.
  Category: cont\_basic Cont Basic

  #### `DB32` BRANCH

  Fift: BRANCH
  RETBOOL
  Description: Performs `RETTRUE` if integer `f!=0`, or `RETFALSE` if `f=0`.
  Category: cont\_basic Cont Basic

  #### `DB34` CALLCC

  Fift: CALLCC
  Description: *Call with current continuation*, transfers control to `c`, pushing the old value of `cc` into `c`'s stack (instead of discarding it or writing it into new `c0`).
  Category: cont\_basic Cont Basic

  #### `DB35` JMPXDATA

  Fift: JMPXDATA
  Description: Similar to `CALLCC`, but the remainder of the current continuation (the old value of `cc`) is converted into a *Slice* before pushing it into the stack of `c`.
  Category: cont\_basic Cont Basic

  #### `DB36` CALLCCARGS

  Fift: \[p] \[r] CALLCCARGS
  Description: Similar to `CALLXARGS`, but pushes the old value of `cc` (along with the top `0 <= p <= 15` values from the original stack) into the stack of newly-invoked continuation `c`, setting `cc.nargs` to `-1 <= r <= 14`.
  Category: cont\_basic Cont Basic

  #### `DB38` CALLXVARARGS

  Fift: CALLXVARARGS
  Description: Similar to `CALLXARGS`, but takes `-1 <= p,r <= 254` from the stack. The next three operations also take `p` and `r` from the stack, both in the range `-1...254`.
  Category: cont\_basic Cont Basic

  #### `DB39` RETVARARGS

  Fift: RETVARARGS
  Description: Similar to `RETARGS`.
  Category: cont\_basic Cont Basic

  #### `DB3A` JMPXVARARGS

  Fift: JMPXVARARGS
  Description: Similar to `JMPXARGS`.
  Category: cont\_basic Cont Basic

  #### `DB3B` CALLCCVARARGS

  Fift: CALLCCVARARGS
  Description: Similar to `CALLCCARGS`.
  Category: cont\_basic Cont Basic

  #### `DB3C` CALLREF

  Fift: \[ref] CALLREF
  Description: Equivalent to `PUSHREFCONT` `CALLX`.
  Category: cont\_basic Cont Basic

  #### `DB3D` JMPREF

  Fift: \[ref] JMPREF
  Description: Equivalent to `PUSHREFCONT` `JMPX`.
  Category: cont\_basic Cont Basic

  #### `DB3E` JMPREFDATA

  Fift: \[ref] JMPREFDATA
  Description: Equivalent to `PUSHREFCONT` `JMPXDATA`.
  Category: cont\_basic Cont Basic

  #### `DB3F` RETDATA

  Fift: RETDATA
  Description: Equivalent to `c0 PUSHCTR` `JMPXDATA`. In this way, the remainder of the current continuation is converted into a *Slice* and returned to the caller.
  Category: cont\_basic Cont Basic

  #### `DB50` RUNVMX

  Fift: RUNVMX
  Description: Runs child VM with code `code` and stack `x_1...x_n`. Returns the resulting stack `x'_1...x'_m` and exitcode. Other arguments and return values are enabled by flags.
  Category: cont\_basic Cont Basic

  #### `E300` IFREF

  Fift: \[ref] IFREF
  Description: Equivalent to `PUSHREFCONT` `IF`, with the optimization that the cell reference is not actually loaded into a *Slice* and then converted into an ordinary *Continuation* if `f=0`.
  Gas consumption of this primitive depends on whether `f=0` and whether the reference was loaded before.
  Similar remarks apply other primitives that accept a continuation as a reference.
  Category: cont\_conditional Cont Conditional

  #### `E301` IFNOTREF

  Fift: \[ref] IFNOTREF
  Description: Equivalent to `PUSHREFCONT` `IFNOT`.
  Category: cont\_conditional Cont Conditional

  #### `E302` IFJMPREF

  Fift: \[ref] IFJMPREF
  Description: Equivalent to `PUSHREFCONT` `IFJMP`.
  Category: cont\_conditional Cont Conditional

  #### `E303` IFNOTJMPREF

  Fift: \[ref] IFNOTJMPREF
  Description: Equivalent to `PUSHREFCONT` `IFNOTJMP`.
  Category: cont\_conditional Cont Conditional

  #### `E304` CONDSEL

  Fift: CONDSEL
  Description: If integer `f` is non-zero, returns `x`, otherwise returns `y`. Notice that no type checks are performed on `x` and `y`; as such, it is more like a conditional stack operation. Roughly equivalent to `ROT` `ISZERO` `INC` `ROLLX` `NIP`.
  Category: cont\_conditional Cont Conditional

  #### `E305` CONDSELCHK

  Fift: CONDSELCHK
  Description: Same as `CONDSEL`, but first checks whether `x` and `y` have the same type.
  Category: cont\_conditional Cont Conditional

  #### `E308` IFRETALT

  Fift: IFRETALT
  Description: Performs `RETALT` if integer `f!=0`.
  Category: cont\_conditional Cont Conditional

  #### `E309` IFNOTRETALT

  Fift: IFNOTRETALT
  Description: Performs `RETALT` if integer `f=0`.
  Category: cont\_conditional Cont Conditional

  #### `E30D` IFREFELSE

  Fift: \[ref] IFREFELSE
  Description: Equivalent to `PUSHREFCONT` `SWAP` `IFELSE`, with the optimization that the cell reference is not actually loaded into a *Slice* and then converted into an ordinary *Continuation* if `f=0`. Similar remarks apply to the next two primitives: cells are converted into continuations only when necessary.
  Category: cont\_conditional Cont Conditional

  #### `E30E` IFELSEREF

  Fift: \[ref] IFELSEREF
  Description: Equivalent to `PUSHREFCONT` `IFELSE`.
  Category: cont\_conditional Cont Conditional

  #### `E30F` IFREFELSEREF

  Fift: \[ref] \[ref] IFREFELSEREF
  Description: Equivalent to `PUSHREFCONT` `PUSHREFCONT` `IFELSE`.
  Category: cont\_conditional Cont Conditional

  #### `E314` REPEATBRK

  Fift: REPEATBRK
  Description: Similar to `REPEAT`, but also sets `c1` to the original `cc` after saving the old value of `c1` into the savelist of the original `cc`. In this way `RETALT` could be used to break out of the loop body.
  Category: cont\_loops Cont Loops

  #### `E315` REPEATENDBRK

  Fift: REPEATENDBRK
  Description: Similar to `REPEATEND`, but also sets `c1` to the original `c0` after saving the old value of `c1` into the savelist of the original `c0`. Equivalent to `SAMEALTSAVE` `REPEATEND`.
  Category: cont\_loops Cont Loops

  #### `E316` UNTILBRK

  Fift: UNTILBRK
  Description: Similar to `UNTIL`, but also modifies `c1` in the same way as `REPEATBRK`.
  Category: cont\_loops Cont Loops

  #### `E317` UNTILENDBRK

  Fift: UNTILENDBRK
  UNTILBRK:
  Description: Equivalent to `SAMEALTSAVE` `UNTILEND`.
  Category: cont\_loops Cont Loops

  #### `E318` WHILEBRK

  Fift: WHILEBRK
  Description: Similar to `WHILE`, but also modifies `c1` in the same way as `REPEATBRK`.
  Category: cont\_loops Cont Loops

  #### `E319` WHILEENDBRK

  Fift: WHILEENDBRK
  Description: Equivalent to `SAMEALTSAVE` `WHILEEND`.
  Category: cont\_loops Cont Loops

  #### `E31A` AGAINBRK

  Fift: AGAINBRK
  Description: Similar to `AGAIN`, but also modifies `c1` in the same way as `REPEATBRK`.
  Category: cont\_loops Cont Loops

  #### `E31B` AGAINENDBRK

  Fift: AGAINENDBRK
  AGAINBRK:
  Description: Equivalent to `SAMEALTSAVE` `AGAINEND`.
  Category: cont\_loops Cont Loops

  #### `ED10` RETURNVARARGS

  Fift: RETURNVARARGS
  Description: Similar to `RETURNARGS`, but with Integer `0 <= p <= 255` taken from the stack.
  Category: cont\_stack Cont Stack

  #### `ED11` SETCONTVARARGS

  Fift: SETCONTVARARGS
  Description: Similar to `SETCONTARGS`, but with `0 <= r <= 255` and `-1 <= n <= 255` taken from the stack.
  Category: cont\_stack Cont Stack

  #### `ED12` SETNUMVARARGS

  Fift: SETNUMVARARGS
  Description: `-1 <= n <= 255`
  If `n=-1`, this operation does nothing (`c'=c`).
  Otherwise its action is similar to `[n] SETNUMARGS`, but with `n` taken from the stack.
  Category: cont\_stack Cont Stack

  #### `ED1E` BLESS

  Fift: BLESS
  Description: Transforms a *Slice* `s` into a simple ordinary continuation `c`, with `c.code=s` and an empty stack and savelist.
  Category: cont\_create Cont Create

  #### `ED1F` BLESSVARARGS

  Fift: BLESSVARARGS
  Description: Equivalent to `ROT` `BLESS` `ROTREV` `SETCONTVARARGS`.
  Category: cont\_create Cont Create

  #### `EDE0` PUSHCTRX

  Fift: PUSHCTRX
  Description: Similar to `c[i] PUSHCTR`, but with `i`, `0 <= i <= 255`, taken from the stack.
  Notice that this primitive is one of the few ''exotic'' primitives, which are not polymorphic like stack manipulation primitives, and at the same time do not have well-defined types of parameters and return values, because the type of `x` depends on `i`.
  Category: cont\_registers Cont Registers

  #### `EDE1` POPCTRX

  Fift: POPCTRX
  Description: Similar to `c[i] POPCTR`, but with `0 <= i <= 255` from the stack.
  Category: cont\_registers Cont Registers

  #### `EDE2` SETCONTCTRX

  Fift: SETCONTCTRX
  Description: Similar to `c[i] SETCONTCTR`, but with `0 <= i <= 255` from the stack.
  Category: cont\_registers Cont Registers

  #### `EDF0` COMPOS

  Fift: COMPOS
  BOOLAND
  Description: Computes the composition `compose0(c, c')`, which has the meaning of ''perform `c`, and, if successful, perform `c'`'' (if `c` is a boolean circuit) or simply ''perform `c`, then `c'`''. Equivalent to `SWAP` `c0 SETCONT`.
  Category: cont\_registers Cont Registers

  #### `EDF1` COMPOSALT

  Fift: COMPOSALT
  BOOLOR
  Description: Computes the alternative composition `compose1(c, c')`, which has the meaning of ''perform `c`, and, if not successful, perform `c'`'' (if `c` is a boolean circuit). Equivalent to `SWAP` `c1 SETCONT`.
  Category: cont\_registers Cont Registers

  #### `EDF2` COMPOSBOTH

  Fift: COMPOSBOTH
  Description: Computes composition `compose1(compose0(c, c'), c')`, which has the meaning of ''compute boolean circuit `c`, then compute `c'`, regardless of the result of `c`''.
  Category: cont\_registers Cont Registers

  #### `EDF3` ATEXIT

  Fift: ATEXIT
  Description: Sets `c0` to `compose0(c, c0)`. In other words, `c` will be executed before exiting current subroutine.
  Category: cont\_registers Cont Registers

  #### `EDF4` ATEXITALT

  Fift: ATEXITALT
  Description: Sets `c1` to `compose1(c, c1)`. In other words, `c` will be executed before exiting current subroutine by its alternative return path.
  Category: cont\_registers Cont Registers

  #### `EDF5` SETEXITALT

  Fift: SETEXITALT
  Description: Sets `c1` to `compose1(compose0(c, c0), c1)`,
  In this way, a subsequent `RETALT` will first execute `c`, then transfer control to the original `c0`. This can be used, for instance, to exit from nested loops.
  Category: cont\_registers Cont Registers

  #### `EDF6` THENRET

  Fift: THENRET
  Description: Computes `compose0(c, c0)`.
  Category: cont\_registers Cont Registers

  #### `EDF7` THENRETALT

  Fift: THENRETALT
  Description: Computes `compose0(c, c1)`
  Category: cont\_registers Cont Registers

  #### `EDF8` INVERT

  Fift: INVERT
  Description: Interchanges `c0` and `c1`.
  Category: cont\_registers Cont Registers

  #### `EDF9` BOOLEVAL

  Fift: BOOLEVAL
  Description: Performs `cc:=compose1(compose0(c, compose0(-1 PUSHINT, cc)), compose0(0 PUSHINT, cc))`. If `c` represents a boolean circuit, the net effect is to evaluate it and push either `-1` or `0` into the stack before continuing.
  Category: cont\_registers Cont Registers

  #### `EDFA` SAMEALT

  Fift: SAMEALT
  Description: Sets `c1` to `c0`. Equivalent to `c0 PUSHCTR` `c1 POPCTR`.
  Category: cont\_registers Cont Registers

  #### `EDFB` SAMEALTSAVE

  Fift: SAMEALTSAVE
  Description: Sets `c1` to `c0`, but first saves the old value of `c1` into the savelist of `c0`.
  Equivalent to `c1 SAVE` `SAMEALT`.
  Category: cont\_registers Cont Registers

  #### `F2F0` THROWANY

  Fift: THROWANY
  Description: Throws exception `0 <= n < 2^16` with parameter zero.
  Approximately equivalent to `ZERO` `SWAP` `THROWARGANY`.
  Category: exceptions Exceptions

  #### `F2F1` THROWARGANY

  Fift: THROWARGANY
  Description: Throws exception `0 <= n < 2^16` with parameter `x`, transferring control to the continuation in `c2`.
  Approximately equivalent to `c2 PUSHCTR` `2 JMPXARGS`.
  Category: exceptions Exceptions

  #### `F2F2` THROWANYIF

  Fift: THROWANYIF
  Description: Throws exception `0 <= n < 2^16` with parameter zero only if `f!=0`.
  Category: exceptions Exceptions

  #### `F2F3` THROWARGANYIF

  Fift: THROWARGANYIF
  Description: Throws exception `0 <= n<2^16` with parameter `x` only if `f!=0`.
  Category: exceptions Exceptions

  #### `F2F4` THROWANYIFNOT

  Fift: THROWANYIFNOT
  Description: Throws exception `0 <= n<2^16` with parameter zero only if `f=0`.
  Category: exceptions Exceptions

  #### `F2F5` THROWARGANYIFNOT

  Fift: THROWARGANYIFNOT
  Description: Throws exception `0 <= n<2^16` with parameter `x` only if `f=0`.
  Category: exceptions Exceptions

  #### `F2FF` TRY

  Fift: TRY
  Description: Sets `c2` to `c'`, first saving the old value of `c2` both into the savelist of `c'` and into the savelist of the current continuation, which is stored into `c.c0` and `c'.c0`. Then runs `c` similarly to `EXECUTE`. If `c` does not throw any exceptions, the original value of `c2` is automatically restored on return from `c`. If an exception occurs, the execution is transferred to `c'`, but the original value of `c2` is restored in the process, so that `c'` can re-throw the exception by `THROWANY` if it cannot handle it by itself.
  Category: exceptions Exceptions

  #### `F400` STDICT

  Fift: STDICT
  STOPTREF
  Description: Stores dictionary `D` into *Builder* `b`, returning the resulting *Builder* `b'`.
  In other words, if `D` is a cell, performs `STONE` and `STREF`; if `D` is *Null*, performs `NIP` and `STZERO`; otherwise throws a type checking exception.
  Category: dict\_serial Dict Serial

  #### `F401` SKIPDICT

  Fift: SKIPDICT
  SKIPOPTREF
  Description: Equivalent to `LDDICT` `NIP`.
  Category: dict\_serial Dict Serial

  #### `F402` LDDICTS

  Fift: LDDICTS
  Description: Loads (parses) a (*Slice*-represented) dictionary `s'` from *Slice* `s`, and returns the remainder of `s` as `s''`.
  This is a ''split function'' for all `HashmapE(n,X)` dictionary types.
  Category: dict\_serial Dict Serial

  #### `F403` PLDDICTS

  Fift: PLDDICTS
  Description: Preloads a (*Slice*-represented) dictionary `s'` from *Slice* `s`.
  Approximately equivalent to `LDDICTS` `DROP`.
  Category: dict\_serial Dict Serial

  #### `F404` LDDICT

  Fift: LDDICT
  LDOPTREF
  Description: Loads (parses) a dictionary `D` from *Slice* `s`, and returns the remainder of `s` as `s'`. May be applied to dictionaries or to values of arbitrary `(^Y)?` types.
  Category: dict\_serial Dict Serial

  #### `F405` PLDDICT

  Fift: PLDDICT
  PLDOPTREF
  Description: Preloads a dictionary `D` from *Slice* `s`.
  Approximately equivalent to `LDDICT` `DROP`.
  Category: dict\_serial Dict Serial

  #### `F406` LDDICTQ

  Fift: LDDICTQ
  Description: A quiet version of `LDDICT`.
  Category: dict\_serial Dict Serial

  #### `F407` PLDDICTQ

  Fift: PLDDICTQ
  Description: A quiet version of `PLDDICT`.
  Category: dict\_serial Dict Serial

  #### `F40A` DICTGET

  Fift: DICTGET
  Description: Looks up key `k` (represented by a *Slice*, the first `0 <= n <= 1023` data bits of which are used as a key) in dictionary `D` of type `HashmapE(n,X)` with `n`-bit keys.
  On success, returns the value found as a *Slice* `x`.
  Category: dict\_get Dict Get

  #### `F40B` DICTGETREF

  Fift: DICTGETREF
  Description: Similar to `DICTGET`, but with a `LDREF` `ENDS` applied to `x` on success.
  This operation is useful for dictionaries of type `HashmapE(n,^Y)`.
  Category: dict\_get Dict Get

  #### `F40C` DICTIGET

  Fift: DICTIGET
  Description: Similar to `DICTGET`, but with a signed (big-endian) `n`-bit *Integer* `i` as a key. If `i` does not fit into `n` bits, returns `0`. If `i` is a `NaN`, throws an integer overflow exception.
  Category: dict\_get Dict Get

  #### `F40D` DICTIGETREF

  Fift: DICTIGETREF
  Description: Combines `DICTIGET` with `DICTGETREF`: it uses signed `n`-bit *Integer* `i` as a key and returns a *Cell* instead of a *Slice* on success.
  Category: dict\_get Dict Get

  #### `F40E` DICTUGET

  Fift: DICTUGET
  Description: Similar to `DICTIGET`, but with *unsigned* (big-endian) `n`-bit *Integer* `i` used as a key.
  Category: dict\_get Dict Get

  #### `F40F` DICTUGETREF

  Fift: DICTUGETREF
  Description: Similar to `DICTIGETREF`, but with an unsigned `n`-bit *Integer* key `i`.
  Category: dict\_get Dict Get

  #### `F412` DICTSET

  Fift: DICTSET
  Description: Sets the value associated with `n`-bit key `k` (represented by a *Slice* as in `DICTGET`) in dictionary `D` (also represented by a *Slice*) to value `x` (again a *Slice*), and returns the resulting dictionary as `D'`.
  Category: dict\_set Dict Set

  #### `F413` DICTSETREF

  Fift: DICTSETREF
  Description: Similar to `DICTSET`, but with the value set to a reference to *Cell* `c`.
  Category: dict\_set Dict Set

  #### `F414` DICTISET

  Fift: DICTISET
  Description: Similar to `DICTSET`, but with the key represented by a (big-endian) signed `n`-bit integer `i`. If `i` does not fit into `n` bits, a range check exception is generated.
  Category: dict\_set Dict Set

  #### `F415` DICTISETREF

  Fift: DICTISETREF
  Description: Similar to `DICTSETREF`, but with the key a signed `n`-bit integer as in `DICTISET`.
  Category: dict\_set Dict Set

  #### `F416` DICTUSET

  Fift: DICTUSET
  Description: Similar to `DICTISET`, but with `i` an *unsigned* `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F417` DICTUSETREF

  Fift: DICTUSETREF
  Description: Similar to `DICTISETREF`, but with `i` unsigned.
  Category: dict\_set Dict Set

  #### `F41A` DICTSETGET

  Fift: DICTSETGET
  Description: Combines `DICTSET` with `DICTGET`: it sets the value corresponding to key `k` to `x`, but also returns the old value `y` associated with the key in question, if present.
  Category: dict\_set Dict Set

  #### `F41B` DICTSETGETREF

  Fift: DICTSETGETREF
  Description: Combines `DICTSETREF` with `DICTGETREF` similarly to `DICTSETGET`.
  Category: dict\_set Dict Set

  #### `F41C` DICTISETGET

  Fift: DICTISETGET
  Description: `DICTISETGET`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F41D` DICTISETGETREF

  Fift: DICTISETGETREF
  Description: `DICTISETGETREF`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F41E` DICTUSETGET

  Fift: DICTUSETGET
  Description: `DICTISETGET`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F41F` DICTUSETGETREF

  Fift: DICTUSETGETREF
  Description: `DICTISETGETREF`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F422` DICTREPLACE

  Fift: DICTREPLACE
  Description: A *Replace* operation, which is similar to `DICTSET`, but sets the value of key `k` in dictionary `D` to `x` only if the key `k` was already present in `D`.
  Category: dict\_set Dict Set

  #### `F423` DICTREPLACEREF

  Fift: DICTREPLACEREF
  Description: A *Replace* counterpart of `DICTSETREF`.
  Category: dict\_set Dict Set

  #### `F424` DICTIREPLACE

  Fift: DICTIREPLACE
  Description: `DICTREPLACE`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F425` DICTIREPLACEREF

  Fift: DICTIREPLACEREF
  Description: `DICTREPLACEREF`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F426` DICTUREPLACE

  Fift: DICTUREPLACE
  Description: `DICTREPLACE`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F427` DICTUREPLACEREF

  Fift: DICTUREPLACEREF
  Description: `DICTREPLACEREF`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F42A` DICTREPLACEGET

  Fift: DICTREPLACEGET
  Description: A *Replace* counterpart of `DICTSETGET`: on success, also returns the old value associated with the key in question.
  Category: dict\_set Dict Set

  #### `F42B` DICTREPLACEGETREF

  Fift: DICTREPLACEGETREF
  Description: A *Replace* counterpart of `DICTSETGETREF`.
  Category: dict\_set Dict Set

  #### `F42C` DICTIREPLACEGET

  Fift: DICTIREPLACEGET
  Description: `DICTREPLACEGET`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F42D` DICTIREPLACEGETREF

  Fift: DICTIREPLACEGETREF
  Description: `DICTREPLACEGETREF`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F42E` DICTUREPLACEGET

  Fift: DICTUREPLACEGET
  Description: `DICTREPLACEGET`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F42F` DICTUREPLACEGETREF

  Fift: DICTUREPLACEGETREF
  Description: `DICTREPLACEGETREF`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F432` DICTADD

  Fift: DICTADD
  Description: An *Add* counterpart of `DICTSET`: sets the value associated with key `k` in dictionary `D` to `x`, but only if it is not already present in `D`.
  Category: dict\_set Dict Set

  #### `F433` DICTADDREF

  Fift: DICTADDREF
  Description: An *Add* counterpart of `DICTSETREF`.
  Category: dict\_set Dict Set

  #### `F434` DICTIADD

  Fift: DICTIADD
  Description: `DICTADD`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F435` DICTIADDREF

  Fift: DICTIADDREF
  Description: `DICTADDREF`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F436` DICTUADD

  Fift: DICTUADD
  Description: `DICTADD`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F437` DICTUADDREF

  Fift: DICTUADDREF
  Description: `DICTADDREF`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F43A` DICTADDGET

  Fift: DICTADDGET
  Description: An *Add* counterpart of `DICTSETGET`: sets the value associated with key `k` in dictionary `D` to `x`, but only if key `k` is not already present in `D`. Otherwise, just returns the old value `y` without changing the dictionary.
  Category: dict\_set Dict Set

  #### `F43B` DICTADDGETREF

  Fift: DICTADDGETREF
  Description: An *Add* counterpart of `DICTSETGETREF`.
  Category: dict\_set Dict Set

  #### `F43C` DICTIADDGET

  Fift: DICTIADDGET
  Description: `DICTADDGET`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F43D` DICTIADDGETREF

  Fift: DICTIADDGETREF
  Description: `DICTADDGETREF`, but with `i` a signed `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F43E` DICTUADDGET

  Fift: DICTUADDGET
  Description: `DICTADDGET`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F43F` DICTUADDGETREF

  Fift: DICTUADDGETREF
  Description: `DICTADDGETREF`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_set Dict Set

  #### `F441` DICTSETB

  Fift: DICTSETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F442` DICTISETB

  Fift: DICTISETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F443` DICTUSETB

  Fift: DICTUSETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F445` DICTSETGETB

  Fift: DICTSETGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F446` DICTISETGETB

  Fift: DICTISETGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F447` DICTUSETGETB

  Fift: DICTUSETGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F449` DICTREPLACEB

  Fift: DICTREPLACEB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F44A` DICTIREPLACEB

  Fift: DICTIREPLACEB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F44B` DICTUREPLACEB

  Fift: DICTUREPLACEB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F44D` DICTREPLACEGETB

  Fift: DICTREPLACEGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F44E` DICTIREPLACEGETB

  Fift: DICTIREPLACEGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F44F` DICTUREPLACEGETB

  Fift: DICTUREPLACEGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F451` DICTADDB

  Fift: DICTADDB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F452` DICTIADDB

  Fift: DICTIADDB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F453` DICTUADDB

  Fift: DICTUADDB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F455` DICTADDGETB

  Fift: DICTADDGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F456` DICTIADDGETB

  Fift: DICTIADDGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F457` DICTUADDGETB

  Fift: DICTUADDGETB
  Description:
  Category: dict\_set\_builder Dict Set Builder

  #### `F459` DICTDEL

  Fift: DICTDEL
  Description: Deletes `n`-bit key, represented by a *Slice* `k`, from dictionary `D`. If the key is present, returns the modified dictionary `D'` and the success flag `-1`. Otherwise, returns the original dictionary `D` and `0`.
  Category: dict\_delete Dict Delete

  #### `F45A` DICTIDEL

  Fift: DICTIDEL
  Description: A version of `DICTDEL` with the key represented by a signed `n`-bit *Integer* `i`. If `i` does not fit into `n` bits, simply returns `D` `0` (''key not found, dictionary unmodified'').
  Category: dict\_delete Dict Delete

  #### `F45B` DICTUDEL

  Fift: DICTUDEL
  Description: Similar to `DICTIDEL`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_delete Dict Delete

  #### `F462` DICTDELGET

  Fift: DICTDELGET
  Description: Deletes `n`-bit key, represented by a *Slice* `k`, from dictionary `D`. If the key is present, returns the modified dictionary `D'`, the original value `x` associated with the key `k` (represented by a *Slice*), and the success flag `-1`. Otherwise, returns the original dictionary `D` and `0`.
  Category: dict\_delete Dict Delete

  #### `F463` DICTDELGETREF

  Fift: DICTDELGETREF
  Description: Similar to `DICTDELGET`, but with `LDREF` `ENDS` applied to `x` on success, so that the value returned `c` is a *Cell*.
  Category: dict\_delete Dict Delete

  #### `F464` DICTIDELGET

  Fift: DICTIDELGET
  Description: `DICTDELGET`, but with `i` a signed `n`-bit integer.
  Category: dict\_delete Dict Delete

  #### `F465` DICTIDELGETREF

  Fift: DICTIDELGETREF
  Description: `DICTDELGETREF`, but with `i` a signed `n`-bit integer.
  Category: dict\_delete Dict Delete

  #### `F466` DICTUDELGET

  Fift: DICTUDELGET
  Description: `DICTDELGET`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_delete Dict Delete

  #### `F467` DICTUDELGETREF

  Fift: DICTUDELGETREF
  Description: `DICTDELGETREF`, but with `i` an unsigned `n`-bit integer.
  Category: dict\_delete Dict Delete

  #### `F469` DICTGETOPTREF

  Fift: DICTGETOPTREF
  Description: A variant of `DICTGETREF` that returns *Null* instead of the value `c^?` if the key `k` is absent from dictionary `D`.
  Category: dict\_mayberef Dict Mayberef

  #### `F46A` DICTIGETOPTREF

  Fift: DICTIGETOPTREF
  Description: `DICTGETOPTREF`, but with `i` a signed `n`-bit integer. If the key `i` is out of range, also returns *Null*.
  Category: dict\_mayberef Dict Mayberef

  #### `F46B` DICTUGETOPTREF

  Fift: DICTUGETOPTREF
  Description: `DICTGETOPTREF`, but with `i` an unsigned `n`-bit integer. If the key `i` is out of range, also returns *Null*.
  Category: dict\_mayberef Dict Mayberef

  #### `F46D` DICTSETGETOPTREF

  Fift: DICTSETGETOPTREF
  Description: A variant of both `DICTGETOPTREF` and `DICTSETGETREF` that sets the value corresponding to key `k` in dictionary `D` to `c^?` (if `c^?` is *Null*, then the key is deleted instead), and returns the old value `~c^?` (if the key `k` was absent before, returns *Null* instead).
  Category: dict\_mayberef Dict Mayberef

  #### `F46E` DICTISETGETOPTREF

  Fift: DICTISETGETOPTREF
  Description: Similar to primitive `DICTSETGETOPTREF`, but using signed `n`-bit *Integer* `i` as a key. If `i` does not fit into `n` bits, throws a range checking exception.
  Category: dict\_mayberef Dict Mayberef

  #### `F46F` DICTUSETGETOPTREF

  Fift: DICTUSETGETOPTREF
  Description: Similar to primitive `DICTSETGETOPTREF`, but using unsigned `n`-bit *Integer* `i` as a key.
  Category: dict\_mayberef Dict Mayberef

  #### `F470` PFXDICTSET

  Fift: PFXDICTSET
  Description:
  Category: dict\_prefix Dict Prefix

  #### `F471` PFXDICTREPLACE

  Fift: PFXDICTREPLACE
  Description:
  Category: dict\_prefix Dict Prefix

  #### `F472` PFXDICTADD

  Fift: PFXDICTADD
  Description:
  Category: dict\_prefix Dict Prefix

  #### `F473` PFXDICTDEL

  Fift: PFXDICTDEL
  Description:
  Category: dict\_prefix Dict Prefix

  #### `F474` DICTGETNEXT

  Fift: DICTGETNEXT
  Description: Computes the minimal key `k'` in dictionary `D` that is lexicographically greater than `k`, and returns `k'` (represented by a *Slice*) along with associated value `x'` (also represented by a *Slice*).
  Category: dict\_next Dict Next

  #### `F475` DICTGETNEXTEQ

  Fift: DICTGETNEXTEQ
  Description: Similar to `DICTGETNEXT`, but computes the minimal key `k'` that is lexicographically greater than or equal to `k`.
  Category: dict\_next Dict Next

  #### `F476` DICTGETPREV

  Fift: DICTGETPREV
  Description: Similar to `DICTGETNEXT`, but computes the maximal key `k'` lexicographically smaller than `k`.
  Category: dict\_next Dict Next

  #### `F477` DICTGETPREVEQ

  Fift: DICTGETPREVEQ
  Description: Similar to `DICTGETPREV`, but computes the maximal key `k'` lexicographically smaller than or equal to `k`.
  Category: dict\_next Dict Next

  #### `F478` DICTIGETNEXT

  Fift: DICTIGETNEXT
  Description: Similar to `DICTGETNEXT`, but interprets all keys in dictionary `D` as big-endian signed `n`-bit integers, and computes the minimal key `i'` that is larger than *Integer* `i` (which does not necessarily fit into `n` bits).
  Category: dict\_next Dict Next

  #### `F479` DICTIGETNEXTEQ

  Fift: DICTIGETNEXTEQ
  Description: Similar to `DICTGETNEXTEQ`, but interprets keys as signed `n`-bit integers.
  Category: dict\_next Dict Next

  #### `F47A` DICTIGETPREV

  Fift: DICTIGETPREV
  Description: Similar to `DICTGETPREV`, but interprets keys as signed `n`-bit integers.
  Category: dict\_next Dict Next

  #### `F47B` DICTIGETPREVEQ

  Fift: DICTIGETPREVEQ
  Description: Similar to `DICTGETPREVEQ`, but interprets keys as signed `n`-bit integers.
  Category: dict\_next Dict Next

  #### `F47C` DICTUGETNEXT

  Fift: DICTUGETNEXT
  Description: Similar to `DICTGETNEXT`, but interprets all keys in dictionary `D` as big-endian unsigned `n`-bit integers, and computes the minimal key `i'` that is larger than *Integer* `i` (which does not necessarily fit into `n` bits, and is not necessarily non-negative).
  Category: dict\_next Dict Next

  #### `F47D` DICTUGETNEXTEQ

  Fift: DICTUGETNEXTEQ
  Description: Similar to `DICTGETNEXTEQ`, but interprets keys as unsigned `n`-bit integers.
  Category: dict\_next Dict Next

  #### `F47E` DICTUGETPREV

  Fift: DICTUGETPREV
  Description: Similar to `DICTGETPREV`, but interprets keys as unsigned `n`-bit integers.
  Category: dict\_next Dict Next

  #### `F47F` DICTUGETPREVEQ

  Fift: DICTUGETPREVEQ
  Description: Similar to `DICTGETPREVEQ`, but interprets keys a unsigned `n`-bit integers.
  Category: dict\_next Dict Next

  #### `F482` DICTMIN

  Fift: DICTMIN
  Description: Computes the minimal key `k` (represented by a *Slice* with `n` data bits) in dictionary `D`, and returns `k` along with the associated value `x`.
  Category: dict\_min Dict Min

  #### `F483` DICTMINREF

  Fift: DICTMINREF
  Description: Similar to `DICTMIN`, but returns the only reference in the value as a *Cell* `c`.
  Category: dict\_min Dict Min

  #### `F484` DICTIMIN

  Fift: DICTIMIN
  Description: Similar to `DICTMIN`, but computes the minimal key `i` under the assumption that all keys are big-endian signed `n`-bit integers. Notice that the key and value returned may differ from those computed by `DICTMIN` and `DICTUMIN`.
  Category: dict\_min Dict Min

  #### `F485` DICTIMINREF

  Fift: DICTIMINREF
  Description: Similar to `DICTIMIN`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F486` DICTUMIN

  Fift: DICTUMIN
  Description: Similar to `DICTMIN`, but returns the key as an unsigned `n`-bit *Integer* `i`.
  Category: dict\_min Dict Min

  #### `F487` DICTUMINREF

  Fift: DICTUMINREF
  Description: Similar to `DICTUMIN`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F48A` DICTMAX

  Fift: DICTMAX
  Description: Computes the maximal key `k` (represented by a *Slice* with `n` data bits) in dictionary `D`, and returns `k` along with the associated value `x`.
  Category: dict\_min Dict Min

  #### `F48B` DICTMAXREF

  Fift: DICTMAXREF
  Description: Similar to `DICTMAX`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F48C` DICTIMAX

  Fift: DICTIMAX
  Description: Similar to `DICTMAX`, but computes the maximal key `i` under the assumption that all keys are big-endian signed `n`-bit integers. Notice that the key and value returned may differ from those computed by `DICTMAX` and `DICTUMAX`.
  Category: dict\_min Dict Min

  #### `F48D` DICTIMAXREF

  Fift: DICTIMAXREF
  Description: Similar to `DICTIMAX`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F48E` DICTUMAX

  Fift: DICTUMAX
  Description: Similar to `DICTMAX`, but returns the key as an unsigned `n`-bit *Integer* `i`.
  Category: dict\_min Dict Min

  #### `F48F` DICTUMAXREF

  Fift: DICTUMAXREF
  Description: Similar to `DICTUMAX`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F492` DICTREMMIN

  Fift: DICTREMMIN
  Description: Computes the minimal key `k` (represented by a *Slice* with `n` data bits) in dictionary `D`, removes `k` from the dictionary, and returns `k` along with the associated value `x` and the modified dictionary `D'`.
  Category: dict\_min Dict Min

  #### `F493` DICTREMMINREF

  Fift: DICTREMMINREF
  Description: Similar to `DICTREMMIN`, but returns the only reference in the value as a *Cell* `c`.
  Category: dict\_min Dict Min

  #### `F494` DICTIREMMIN

  Fift: DICTIREMMIN
  Description: Similar to `DICTREMMIN`, but computes the minimal key `i` under the assumption that all keys are big-endian signed `n`-bit integers. Notice that the key and value returned may differ from those computed by `DICTREMMIN` and `DICTUREMMIN`.
  Category: dict\_min Dict Min

  #### `F495` DICTIREMMINREF

  Fift: DICTIREMMINREF
  Description: Similar to `DICTIREMMIN`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F496` DICTUREMMIN

  Fift: DICTUREMMIN
  Description: Similar to `DICTREMMIN`, but returns the key as an unsigned `n`-bit *Integer* `i`.
  Category: dict\_min Dict Min

  #### `F497` DICTUREMMINREF

  Fift: DICTUREMMINREF
  Description: Similar to `DICTUREMMIN`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F49A` DICTREMMAX

  Fift: DICTREMMAX
  Description: Computes the maximal key `k` (represented by a *Slice* with `n` data bits) in dictionary `D`, removes `k` from the dictionary, and returns `k` along with the associated value `x` and the modified dictionary `D'`.
  Category: dict\_min Dict Min

  #### `F49B` DICTREMMAXREF

  Fift: DICTREMMAXREF
  Description: Similar to `DICTREMMAX`, but returns the only reference in the value as a *Cell* `c`.
  Category: dict\_min Dict Min

  #### `F49C` DICTIREMMAX

  Fift: DICTIREMMAX
  Description: Similar to `DICTREMMAX`, but computes the minimal key `i` under the assumption that all keys are big-endian signed `n`-bit integers. Notice that the key and value returned may differ from those computed by `DICTREMMAX` and `DICTUREMMAX`.
  Category: dict\_min Dict Min

  #### `F49D` DICTIREMMAXREF

  Fift: DICTIREMMAXREF
  Description: Similar to `DICTIREMMAX`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F49E` DICTUREMMAX

  Fift: DICTUREMMAX
  Description: Similar to `DICTREMMAX`, but returns the key as an unsigned `n`-bit *Integer* `i`.
  Category: dict\_min Dict Min

  #### `F49F` DICTUREMMAXREF

  Fift: DICTUREMMAXREF
  Description: Similar to `DICTUREMMAX`, but returns the only reference in the value.
  Category: dict\_min Dict Min

  #### `F4A0` DICTIGETJMP

  Fift: DICTIGETJMP
  Description: Similar to `DICTIGET`, but with `x` `BLESS`ed into a continuation with a subsequent `JMPX` to it on success. On failure, does nothing. This is useful for implementing `switch`/`case` constructions.
  Category: dict\_special Dict Special

  #### `F4A1` DICTUGETJMP

  Fift: DICTUGETJMP
  Description: Similar to `DICTIGETJMP`, but performs `DICTUGET` instead of `DICTIGET`.
  Category: dict\_special Dict Special

  #### `F4A2` DICTIGETEXEC

  Fift: DICTIGETEXEC
  Description: Similar to `DICTIGETJMP`, but with `EXECUTE` instead of `JMPX`.
  Category: dict\_special Dict Special

  #### `F4A3` DICTUGETEXEC

  Fift: DICTUGETEXEC
  Description: Similar to `DICTUGETJMP`, but with `EXECUTE` instead of `JMPX`.
  Category: dict\_special Dict Special

  #### `F4A8` PFXDICTGETQ

  Fift: PFXDICTGETQ
  Description: Looks up the unique prefix of *Slice* `s` present in the prefix code dictionary represented by `Cell^?` `D` and `0 <= n <= 1023`. If found, the prefix of `s` is returned as `s'`, and the corresponding value (also a *Slice*) as `x`. The remainder of `s` is returned as a *Slice* `s''`. If no prefix of `s` is a key in prefix code dictionary `D`, returns the unchanged `s` and a zero flag to indicate failure.
  Category: dict\_special Dict Special

  #### `F4A9` PFXDICTGET

  Fift: PFXDICTGET
  Description: Similar to `PFXDICTGET`, but throws a cell deserialization failure exception on failure.
  Category: dict\_special Dict Special

  #### `F4AA` PFXDICTGETJMP

  Fift: PFXDICTGETJMP
  Description: Similar to `PFXDICTGETQ`, but on success `BLESS`es the value `x` into a *Continuation* and transfers control to it as if by a `JMPX`. On failure, returns `s` unchanged and continues execution.
  Category: dict\_special Dict Special

  #### `F4AB` PFXDICTGETEXEC

  Fift: PFXDICTGETEXEC
  Description: Similar to `PFXDICTGETJMP`, but `EXEC`utes the continuation found instead of jumping to it. On failure, throws a cell deserialization exception.
  Category: dict\_special Dict Special

  #### `F4B1` SUBDICTGET

  Fift: SUBDICTGET
  Description: Constructs a subdictionary consisting of all keys beginning with prefix `k` (represented by a *Slice*, the first `0 <= l <= n <= 1023` data bits of which are used as a key) of length `l` in dictionary `D` of type `HashmapE(n,X)` with `n`-bit keys. On success, returns the new subdictionary of the same type `HashmapE(n,X)` as a *Slice* `D'`.
  Category: dict\_sub Dict Sub

  #### `F4B2` SUBDICTIGET

  Fift: SUBDICTIGET
  Description: Variant of `SUBDICTGET` with the prefix represented by a signed big-endian `l`-bit *Integer* `x`, where necessarily `l <= 257`.
  Category: dict\_sub Dict Sub

  #### `F4B3` SUBDICTUGET

  Fift: SUBDICTUGET
  Description: Variant of `SUBDICTGET` with the prefix represented by an unsigned big-endian `l`-bit *Integer* `x`, where necessarily `l <= 256`.
  Category: dict\_sub Dict Sub

  #### `F4B5` SUBDICTRPGET

  Fift: SUBDICTRPGET
  Description: Similar to `SUBDICTGET`, but removes the common prefix `k` from all keys of the new dictionary `D'`, which becomes of type `HashmapE(n-l,X)`.
  Category: dict\_sub Dict Sub

  #### `F4B6` SUBDICTIRPGET

  Fift: SUBDICTIRPGET
  Description: Variant of `SUBDICTRPGET` with the prefix represented by a signed big-endian `l`-bit *Integer* `x`, where necessarily `l <= 257`.
  Category: dict\_sub Dict Sub

  #### `F4B7` SUBDICTURPGET

  Fift: SUBDICTURPGET
  Description: Variant of `SUBDICTRPGET` with the prefix represented by an unsigned big-endian `l`-bit *Integer* `x`, where necessarily `l <= 256`.
  Category: dict\_sub Dict Sub

  #### `F4BC` DICTIGETJMPZ

  Fift: DICTIGETJMPZ
  Description: A variant of `DICTIGETJMP` that returns index `i` on failure.
  Category: dict\_special Dict Special

  #### `F4BD` DICTUGETJMPZ

  Fift: DICTUGETJMPZ
  Description: A variant of `DICTUGETJMP` that returns index `i` on failure.
  Category: dict\_special Dict Special

  #### `F4BE` DICTIGETEXECZ

  Fift: DICTIGETEXECZ
  Description: A variant of `DICTIGETEXEC` that returns index `i` on failure.
  Category: dict\_special Dict Special

  #### `F4BF` DICTUGETEXECZ

  Fift: DICTUGETEXECZ
  Description: A variant of `DICTUGETEXEC` that returns index `i` on failure.
  Category: dict\_special Dict Special

  #### `F800` ACCEPT

  Fift: ACCEPT
  Description: Sets current gas limit `g_l` to its maximal allowed value `g_m`, and resets the gas credit `g_c` to zero, decreasing the value of `g_r` by `g_c` in the process.
  In other words, the current smart contract agrees to buy some gas to finish the current transaction. This action is required to process external messages, which bring no value (hence no gas) with themselves.
  Category: app\_gas App Gas

  #### `F801` SETGASLIMIT

  Fift: SETGASLIMIT
  Description: Sets current gas limit `g_l` to the minimum of `g` and `g_m`, and resets the gas credit `g_c` to zero. If the gas consumed so far (including the present instruction) exceeds the resulting value of `g_l`, an (unhandled) out of gas exception is thrown before setting new gas limits. Notice that `SETGASLIMIT` with an argument `g >= 2^63-1` is equivalent to `ACCEPT`.
  Category: app\_gas App Gas

  #### `F807` GASCONSUMED

  Fift: GASCONSUMED
  Description: Returns gas consumed by VM so far (including this instruction).
  Category: app\_gas App Gas

  #### `F80F` COMMIT

  Fift: COMMIT
  Description: Commits the current state of registers `c4` (''persistent data'') and `c5` (''actions'') so that the current execution is considered ''successful'' with the saved values even if an exception is thrown later.
  Category: app\_gas App Gas

  #### `F810` RANDU256

  Fift: RANDU256
  Description: Generates a new pseudo-random unsigned 256-bit *Integer* `x`. The algorithm is as follows: if `r` is the old value of the random seed, considered as a 32-byte array (by constructing the big-endian representation of an unsigned 256-bit integer), then its `sha512(r)` is computed; the first 32 bytes of this hash are stored as the new value `r'` of the random seed, and the remaining 32 bytes are returned as the next random value `x`.
  Category: app\_rnd App Rnd

  #### `F811` RAND

  Fift: RAND
  Description: Generates a new pseudo-random integer `z` in the range `0...y-1` (or `y...-1`, if `y<0`). More precisely, an unsigned random value `x` is generated as in `RAND256U`; then `z:=floor(x*y/2^256)` is computed.
  Equivalent to `RANDU256` `256 MULRSHIFT`.
  Category: app\_rnd App Rnd

  #### `F814` SETRAND

  Fift: SETRAND
  Description: Sets the random seed to unsigned 256-bit *Integer* `x`.
  Category: app\_rnd App Rnd

  #### `F815` ADDRAND

  Fift: ADDRAND
  RANDOMIZE
  Description: Mixes unsigned 256-bit *Integer* `x` into the random seed `r` by setting the random seed to `Sha` of the concatenation of two 32-byte strings: the first with the big-endian representation of the old seed `r`, and the second with the big-endian representation of `x`.
  Category: app\_rnd App Rnd

  #### `F830` CONFIGDICT

  Fift: CONFIGDICT
  Description: Returns the global configuration dictionary along with its key length (32).
  Equivalent to `CONFIGROOT` `32 PUSHINT`.
  Category: app\_config App Config

  #### `F832` CONFIGPARAM

  Fift: CONFIGPARAM
  Description: Returns the value of the global configuration parameter with integer index `i` as a *Cell* `c`, and a flag to indicate success.
  Equivalent to `CONFIGDICT` `DICTIGETREF`.
  Category: app\_config App Config

  #### `F833` CONFIGOPTPARAM

  Fift: CONFIGOPTPARAM
  Description: Returns the value of the global configuration parameter with integer index `i` as a *Maybe Cell* `c^?`.
  Equivalent to `CONFIGDICT` `DICTIGETOPTREF`.
  Category: app\_config App Config

  #### `F835` GLOBALID

  Fift: GLOBALID
  Description: Retrieves `global_id` from 19 network config.
  Category: app\_config App Config

  #### `F836` GETGASFEE

  Fift: GETGASFEE
  Description: Calculates gas fee
  Category: app\_config App Config

  #### `F837` GETSTORAGEFEE

  Fift: GETSTORAGEFEE
  Description: Calculates storage fees (only current StoragePrices entry is used).
  Category: app\_config App Config

  #### `F838` GETFORWARDFEE

  Fift: GETFORWARDFEE
  Description: Calculates forward fee.
  Category: app\_config App Config

  #### `F839` GETPRECOMPILEDGAS

  Fift: GETPRECOMPILEDGAS
  Description: Returns gas usage for the current contract if it is precompiled, `null` otherwise.
  Category: app\_config App Config

  #### `F83A` GETORIGINALFWDFEE

  Fift: GETORIGINALFWDFEE
  Description: Calculate `fwd_fee * 2^16 / first_frac`. Can be used to get the original `fwd_fee` of the message.
  Category: app\_config App Config

  #### `F83B` GETGASFEESIMPLE

  Fift: GETGASFEESIMPLE
  Description: Same as `GETGASFEE`, but without flat price (just `(gas_used * price) / 2^16)`.
  Category: app\_config App Config

  #### `F83C` GETFORWARDFEESIMPLE

  Fift: GETFORWARDFEESIMPLE
  Description: Same as `GETFORWARDFEE`, but without lump price (just (`bits*bit_price + cells*cell_price) / 2^16`).
  Category: app\_config App Config

  #### `F840` GETGLOBVAR

  Fift: GETGLOBVAR
  Description: Returns the `k`-th global variable for `0 <= k < 255`.
  Equivalent to `c7 PUSHCTR` `SWAP` `INDEXVARQ`.
  Category: app\_global App Global

  #### `F860` SETGLOBVAR

  Fift: SETGLOBVAR
  Description: Assigns `x` to the `k`-th global variable for `0 <= k < 255`.
  Equivalent to `c7 PUSHCTR` `ROTREV` `SETINDEXVARQ` `c7 POPCTR`.
  Category: app\_global App Global

  #### `F900` HASHCU

  Fift: HASHCU
  Description: Computes the representation hash of a *Cell* `c` and returns it as a 256-bit unsigned integer `x`. Useful for signing and checking signatures of arbitrary entities represented by a tree of cells.
  Category: app\_crypto App Crypto

  #### `F901` HASHSU

  Fift: HASHSU
  Description: Computes the hash of a *Slice* `s` and returns it as a 256-bit unsigned integer `x`. The result is the same as if an ordinary cell containing only data and references from `s` had been created and its hash computed by `HASHCU`.
  Category: app\_crypto App Crypto

  #### `F902` SHA256U

  Fift: SHA256U
  Description: Computes `Sha` of the data bits of *Slice* `s`. If the bit length of `s` is not divisible by eight, throws a cell underflow exception. The hash value is returned as a 256-bit unsigned integer `x`.
  Category: app\_crypto App Crypto

  #### `F910` CHKSIGNU

  Fift: CHKSIGNU
  Description: Checks the Ed25519-signature `s` of a hash `h` (a 256-bit unsigned integer, usually computed as the hash of some data) using public key `k` (also represented by a 256-bit unsigned integer).
  The signature `s` must be a *Slice* containing at least 512 data bits; only the first 512 bits are used. The result is `-1` if the signature is valid, `0` otherwise.
  Notice that `CHKSIGNU` is equivalent to `ROT` `NEWC` `256 STU` `ENDC` `ROTREV` `CHKSIGNS`, i.e., to `CHKSIGNS` with the first argument `d` set to 256-bit *Slice* containing `h`. Therefore, if `h` is computed as the hash of some data, these data are hashed *twice*, the second hashing occurring inside `CHKSIGNS`.
  Category: app\_crypto App Crypto

  #### `F911` CHKSIGNS

  Fift: CHKSIGNS
  Description: Checks whether `s` is a valid Ed25519-signature of the data portion of *Slice* `d` using public key `k`, similarly to `CHKSIGNU`. If the bit length of *Slice* `d` is not divisible by eight, throws a cell underflow exception. The verification of Ed25519 signatures is the standard one, with `Sha` used to reduce `d` to the 256-bit number that is actually signed.
  Category: app\_crypto App Crypto

  #### `F912` ECRECOVER

  Fift: ECRECOVER
  Description: Recovers the public key from a secp256k1 signature, identical to Bitcoin/Ethereum operations. Takes a 32-byte hash as `uint256 hash` and a 65-byte signature as `uint8 v`, `uint256 r`, and `uint256 s`. In TON, the `v` value is strictly 0 or 1; no extra flags or extended values are supported. If the public key cannot be recovered, the instruction returns `0`. On success, it returns the recovered 65-byte public key as `uint8 h`, `uint256 x1`, and `uint256 x2`, followed by `-1`.
  Category: app\_crypto App Crypto

  #### `F914` P256\_CHKSIGNU

  Fift: P256\_CHKSIGNU
  Description: Checks seck256r1-signature `sig` of a number `h` (a 256-bit unsigned integer, usually computed as the hash of some data) and public key `k`. Returns -1 on success, 0 on failure. Public key is a 33-byte slice (encoded according to Sec. 2.3.4 point 2 of [SECG SEC 1](https://www.secg.org/sec1-v2.pdf)). Signature `sig` is a 64-byte slice (two 256-bit unsigned integers `r` and `s`).
  Category: app\_crypto App Crypto

  #### `F915` P256\_CHKSIGNS

  Fift: P256\_CHKSIGNS
  Description: Checks seck256r1-signature `sig` of data portion of slice `d` and public key `k`. Returns -1 on success, 0 on failure. Public key is a 33-byte slice (encoded according to Sec. 2.3.4 point 2 of [SECG SEC 1](https://www.secg.org/sec1-v2.pdf)). Signature `sig` is a 64-byte slice (two 256-bit unsigned integers `r` and `s`).
  Category: app\_crypto App Crypto

  #### `F920` RIST255\_FROMHASH

  Fift: RIST255\_FROMHASH
  Description: Deterministically generates a valid point `x` from a 512-bit hash (given as two 256-bit integers).
  Category: app\_crypto App Crypto

  #### `F921` RIST255\_VALIDATE

  Fift: RIST255\_VALIDATE
  Description: Checks that integer `x` is a valid representation of some curve point. Throws range\_chk on error.
  Category: app\_crypto App Crypto

  #### `F922` RIST255\_ADD

  Fift: RIST255\_ADD
  Description: Addition of two points on a curve.
  Category: app\_crypto App Crypto

  #### `F923` RIST255\_SUB

  Fift: RIST255\_SUB
  Description: Subtraction of two points on curve.
  Category: app\_crypto App Crypto

  #### `F924` RIST255\_MUL

  Fift: RIST255\_MUL
  Description: Multiplies point `x` by a scalar `n`. Any `n` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F925` RIST255\_MULBASE

  Fift: RIST255\_MULBASE
  Description: Multiplies the generator point `g` by a scalar `n`. Any `n` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F926` RIST255\_PUSHL

  Fift: RIST255\_PUSHL
  Description: Pushes integer l=2^252+27742317777372353535851937790883648493, which is the order of the group.
  Category: app\_crypto App Crypto

  #### `F940` CDATASIZEQ

  Fift: CDATASIZEQ
  Description: Recursively computes the count of distinct cells `x`, data bits `y`, and cell references `z` in the dag rooted at *Cell* `c`, effectively returning the total storage used by this dag taking into account the identification of equal cells. The values of `x`, `y`, and `z` are computed by a depth-first traversal of this dag, with a hash table of visited cell hashes used to prevent visits of already-visited cells. The total count of visited cells `x` cannot exceed non-negative *Integer* `n`; otherwise the computation is aborted before visiting the `(n+1)`-st cell and a zero is returned to indicate failure. If `c` is *Null*, returns `x=y=z=0`.
  Category: app\_misc App Misc

  #### `F941` CDATASIZE

  Fift: CDATASIZE
  Description: A non-quiet version of `CDATASIZEQ` that throws a cell overflow exception (8) on failure.
  Category: app\_misc App Misc

  #### `F942` SDATASIZEQ

  Fift: SDATASIZEQ
  Description: Similar to `CDATASIZEQ`, but accepting a *Slice* `s` instead of a *Cell*. The returned value of `x` does not take into account the cell that contains the slice `s` itself; however, the data bits and the cell references of `s` are accounted for in `y` and `z`.
  Category: app\_misc App Misc

  #### `F943` SDATASIZE

  Fift: SDATASIZE
  Description: A non-quiet version of `SDATASIZEQ` that throws a cell overflow exception (8) on failure.
  Category: app\_misc App Misc

  #### `FA00` LDGRAMS

  Fift: LDGRAMS
  LDVARUINT16
  Description: Loads (deserializes) a `Gram` or `VarUInteger 16` amount from *Slice* `s`, and returns the amount as *Integer* `x` along with the remainder `s'` of `s`. The expected serialization of `x` consists of a 4-bit unsigned big-endian integer `l`, followed by an `8l`-bit unsigned big-endian representation of `x`.
  The net effect is approximately equivalent to `4 LDU` `SWAP` `3 LSHIFT#` `LDUX`.
  Category: app\_currency App Currency

  #### `FA01` LDVARINT16

  Fift: LDVARINT16
  Description: Similar to `LDVARUINT16`, but loads a *signed* *Integer* `x`.
  Approximately equivalent to `4 LDU` `SWAP` `3 LSHIFT#` `LDIX`.
  Category: app\_currency App Currency

  #### `FA02` STGRAMS

  Fift: STGRAMS
  STVARUINT16
  Description: Stores (serializes) an *Integer* `x` in the range `0...2^120-1` into *Builder* `b`, and returns the resulting *Builder* `b'`. The serialization of `x` consists of a 4-bit unsigned big-endian integer `l`, which is the smallest integer `l>=0`, such that `x<2^(8l)`, followed by an `8l`-bit unsigned big-endian representation of `x`. If `x` does not belong to the supported range, a range check exception is thrown.
  Category: app\_currency App Currency

  #### `FA03` STVARINT16

  Fift: STVARINT16
  Description: Similar to `STVARUINT16`, but serializes a *signed* *Integer* `x` in the range `-2^119...2^119-1`.
  Category: app\_currency App Currency

  #### `FA04` LDVARUINT32

  Fift: LDVARUINT32
  Description: Loads (deserializes) a `VarUInteger 32` amount from *Slice* `s`, and returns the amount as *Integer* `x` along with the remainder `s'` of `s`. The expected serialization of `x` consists of a 5-bit unsigned big-endian integer `l`, followed by an `8l`-bit unsigned big-endian representation of `x`.
  The net effect is approximately equivalent to `4 LDU` `SWAP` `3 LSHIFT#` `LDUX`.
  Category: app\_currency App Currency

  #### `FA05` LDVARINT32

  Fift: LDVARINT32
  Description: Similar to `LDVARUINT32`, but loads a *signed* *Integer* `x`.
  Approximately equivalent to `5 LDU` `SWAP` `3 LSHIFT#` `LDIX`.
  Category: app\_currency App Currency

  #### `FA06` STVARUINT32

  Fift: STVARUINT32
  Description: Stores (serializes) an *Integer* `x` in the range `0...2^248-1` into *Builder* `b`, and returns the resulting *Builder* `b'`. The serialization of `x` consists of a 5-bit unsigned big-endian integer `l`, which is the smallest integer `l>=0`, such that `x<2^(8l)`, followed by an `8l`-bit unsigned big-endian representation of `x`. If `x` does not belong to the supported range, a range check exception is thrown.
  Category: app\_currency App Currency

  #### `FA07` STVARINT32

  Fift: STVARINT32
  Description: Similar to `STVARUINT32`, but serializes a *signed* *Integer* `x` in the range `-2^247...2^247-1`.
  Category: app\_currency App Currency

  #### `FA40` LDMSGADDR

  Fift: LDMSGADDR
  Description: Loads from *Slice* `s` the only prefix that is a valid `MsgAddress`, and returns both this prefix `s'` and the remainder `s''` of `s` as slices.
  Category: app\_addr App Addr

  #### `FA41` LDMSGADDRQ

  Fift: LDMSGADDRQ
  Description: A quiet version of `LDMSGADDR`: on success, pushes an extra `-1`; on failure, pushes the original `s` and a zero.
  Category: app\_addr App Addr

  #### `FA42` PARSEMSGADDR

  Fift: PARSEMSGADDR
  Description: Decomposes *Slice* `s` containing a valid `MsgAddress` into a *Tuple* `t` with separate fields of this `MsgAddress`. If `s` is not a valid `MsgAddress`, a cell deserialization exception is thrown.
  Category: app\_addr App Addr

  #### `FA43` PARSEMSGADDRQ

  Fift: PARSEMSGADDRQ
  Description: A quiet version of `PARSEMSGADDR`: returns a zero on error instead of throwing an exception.
  Category: app\_addr App Addr

  #### `FA44` REWRITESTDADDR

  Fift: REWRITESTDADDR
  Description: Parses *Slice* `s` containing a valid `MsgAddressInt` (usually a `msg_addr_std`), applies rewriting from the `anycast` (if present) to the same-length prefix of the address, and returns both the workchain `x` and the 256-bit address `y` as integers. If the address is not 256-bit, or if `s` is not a valid serialization of `MsgAddressInt`, throws a cell deserialization exception.
  Category: app\_addr App Addr

  #### `FA45` REWRITESTDADDRQ

  Fift: REWRITESTDADDRQ
  Description: A quiet version of primitive `REWRITESTDADDR`.
  Category: app\_addr App Addr

  #### `FA46` REWRITEVARADDR

  Fift: REWRITEVARADDR
  Description: A variant of `REWRITESTDADDR` that returns the (rewritten) address as a *Slice* `s`, even if it is not exactly 256 bit long (represented by a `msg_addr_var`).
  Category: app\_addr App Addr

  #### `FA47` REWRITEVARADDRQ

  Fift: REWRITEVARADDRQ
  Description: A quiet version of primitive `REWRITEVARADDR`.
  Category: app\_addr App Addr

  #### `FB00` SENDRAWMSG

  Fift: SENDRAWMSG
  Description: Sends a raw message contained in *Cell `c`*, which should contain a correctly serialized object `Message X`, with the only exception that the source address is allowed to have dummy value `addr_none` (to be automatically replaced with the current smart-contract address), and `ihr_fee`, `fwd_fee`, `created_lt` and `created_at` fields can have arbitrary values (to be rewritten with correct values during the action phase of the current transaction). Integer parameter `x` contains the flags. Currently `x=0` is used for ordinary messages; `x=128` is used for messages that are to carry all the remaining balance of the current smart contract (instead of the value originally indicated in the message); `x=64` is used for messages that carry all the remaining value of the inbound message in addition to the value initially indicated in the new message (if bit 0 is not set, the gas fees are deducted from this amount); `x'=x+1` means that the sender wants to pay transfer fees separately; `x'=x+2` means that any errors arising while processing this message during the action phase should be ignored. Finally, `x'=x+32` means that the current account must be destroyed if its resulting balance is zero. This flag is usually employed together with `+128`.
  Category: app\_actions App Actions

  #### `FB02` RAWRESERVE

  Fift: RAWRESERVE
  Description: Creates an output action which would reserve exactly `x` nanograms (if `y=0`), at most `x` nanograms (if `y=2`), or all but `x` nanograms (if `y=1` or `y=3`), from the remaining balance of the account. It is roughly equivalent to creating an outbound message carrying `x` nanograms (or `b-x` nanograms, where `b` is the remaining balance) to oneself, so that the subsequent output actions would not be able to spend more money than the remainder. Bit `+2` in `y` means that the external action does not fail if the specified amount cannot be reserved; instead, all remaining balance is reserved. Bit `+8` in `y` means `x:=-x` before performing any further actions. Bit `+4` in `y` means that `x` is increased by the original balance of the current account (before the compute phase), including all extra currencies, before performing any other checks and actions. Currently `x` must be a non-negative integer, and `y` must be in the range `0...15`.
  Category: app\_actions App Actions

  #### `FB03` RAWRESERVEX

  Fift: RAWRESERVEX
  Description: Similar to `RAWRESERVE`, but also accepts a dictionary `D` (represented by a *Cell* or *Null*) with extra currencies. In this way currencies other than Grams can be reserved.
  Category: app\_actions App Actions

  #### `FB04` SETCODE

  Fift: SETCODE
  Description: Creates an output action that would change this smart contract code to that given by *Cell* `c`. Notice that this change will take effect only after the successful termination of the current run of the smart contract.
  Category: app\_actions App Actions

  #### `FB06` SETLIBCODE

  Fift: SETLIBCODE
  Description: Creates an output action that would modify the collection of this smart contract libraries by adding or removing library with code given in *Cell* `c`. If `x=0`, the library is actually removed if it was previously present in the collection (if not, this action does nothing). If `x=1`, the library is added as a private library, and if `x=2`, the library is added as a public library (and becomes available to all smart contracts if the current smart contract resides in the masterchain); if the library was present in the collection before, its public/private status is changed according to `x`. Values of `x` other than `0...2` are invalid.
  Category: app\_actions App Actions

  #### `FB07` CHANGELIB

  Fift: CHANGELIB
  Description: Creates an output action similarly to `SETLIBCODE`, but instead of the library code accepts its hash as an unsigned 256-bit integer `h`. If `x!=0` and the library with hash `h` is absent from the library collection of this smart contract, this output action will fail.
  Category: app\_actions App Actions

  #### `FB08` SENDMSG

  Fift: SENDMSG
  Description: Creates an output action and returns a fee for creating a message. Mode has the same effect as in the case of `SENDRAWMSG`. Additionally `+1024` means - do not create an action, only estimate fee. Other modes affect the fee calculation as follows: `+64` substitutes the entire balance of the incoming message as an outcoming value (slightly inaccurate, gas expenses that cannot be estimated before the computation is completed are not taken into account), `+128` substitutes the value of the entire balance of the contract before the start of the computation phase (slightly inaccurate, since gas expenses that cannot be estimated before the completion of the computation phase are not taken into account).
  Category: app\_actions App Actions

  #### `FFF0` SETCPX

  Fift: SETCPX
  Description: Selects codepage `c` with `-2^15 <= c < 2^15` passed in the top of the stack.
  Category: codepage Codepage

  #### `B7A900` QADDDIVMOD

  Fift: QADDDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A901` QADDDIVMODR

  Fift: QADDDIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A902` QADDDIVMODC

  Fift: QADDDIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A904` QDIV

  Fift: QDIV
  Description: Division returns `NaN` if `y=0`.
  Category: arithm\_quiet Arithm Quiet

  #### `B7A905` QDIVR

  Fift: QDIVR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A906` QDIVC

  Fift: QDIVC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A908` QMOD

  Fift: QMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A909` QMODR

  Fift: QMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A90A` QMODC

  Fift: QMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A90C` QDIVMOD

  Fift: QDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A90D` QDIVMODR

  Fift: QDIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A90E` QDIVMODC

  Fift: QDIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A920` QADDRSHIFTMOD

  Fift: QADDRSHIFTMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A921` QADDRSHIFTMODR

  Fift: QADDRSHIFTMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A922` QADDRSHIFTMODC

  Fift: QADDRSHIFTMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A925` QRSHIFTR\_VAR

  Fift: QRSHIFTR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A926` QRSHIFTC\_VAR

  Fift: QRSHIFTC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A928` QMODPOW2\_VAR

  Fift: QMODPOW2
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A929` QMODPOW2R\_VAR

  Fift: QMODPOW2R
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A92A` QMODPOW2C\_VAR

  Fift: QMODPOW2C
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A92C` QRSHIFTMOD\_VAR

  Fift: QRSHIFTMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A92D` QRSHIFTMODR\_VAR

  Fift: QRSHIFTMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A92E` QRSHIFTMODC\_VAR

  Fift: QRSHIFTMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A930` QADDRSHIFTMOD

  Fift: \[tt+1] QADDRSHIFT#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A931` QADDRSHIFTRMOD

  Fift: \[tt+1] QADDRSHIFTR#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A932` QADDRSHIFTCMOD

  Fift: \[tt+1] QADDRSHIFTC#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A935` QRSHIFTR

  Fift: \[tt+1] QRSHIFTR#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A936` QRSHIFTC

  Fift: \[tt+1] QRSHIFTC#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A938` QMODPOW2

  Fift: \[tt+1] QMODPOW2#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A939` QMODPOW2R

  Fift: \[tt+1] QMODPOW2R#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A93A` QMODPOW2C

  Fift: \[tt+1] QMODPOW2C#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A93C` QRSHIFTMOD

  Fift: \[tt+1] QRSHIFT#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A93D` QRSHIFTRMOD

  Fift: \[tt+1] QRSHIFTR#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A93E` QRSHIFTCMOD

  Fift: \[tt+1] QRSHIFTC#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A980` QMULADDDIVMOD

  Fift: QMULADDDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A981` QMULADDDIVMODR

  Fift: QMULADDDIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A982` QMULADDDIVMODC

  Fift: QMULADDDIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A984` QMULDIV

  Fift: QMULDIV
  Description: `q=floor(x*y/z)`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A985` QMULDIVR

  Fift: QMULDIVR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A986` QMULDIVC

  Fift: QMULDIVC
  Description: `q'=ceil(x*y/z)`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A988` QMULMOD

  Fift: QMULMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A989` QMULMODR

  Fift: QMULMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A98A` QMULMODC

  Fift: QMULMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A98C` QMULDIVMOD

  Fift: QMULDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A98D` QMULDIVMODR

  Fift: QMULDIVMODR
  Description: `q=round(x*y/z)`, `r=x*y-z*q`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A98E` QMULDIVMODC

  Fift: QMULDIVMODC
  Description: `q=ceil(x*y/z)`, `r=x*y-z*q`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A0` QMULADDRSHIFTMOD\_VAR

  Fift: QMULADDRSHIFTMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A1` QMULADDRSHIFTRMOD\_VAR

  Fift: QMULADDRSHIFTRMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A2` QMULADDRSHIFTCMOD\_VAR

  Fift: QMULADDRSHIFTCMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A4` QMULRSHIFT\_VAR

  Fift: QMULRSHIFT
  Description: `0 <= z <= 256`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A5` QMULRSHIFTR\_VAR

  Fift: QMULRSHIFTR
  Description: `0 <= z <= 256`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A6` QMULRSHIFTC\_VAR

  Fift: QMULRSHIFTC
  Description: `0 <= z <= 256`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A8` QMULMODPOW2\_VAR

  Fift: QMULMODPOW2\_VAR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9A9` QMULMODPOW2R\_VAR

  Fift: QMULMODPOW2R\_VAR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9AA` QMULMODPOW2C\_VAR

  Fift: QMULMODPOW2C\_VAR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9AC` QMULRSHIFTMOD\_VAR

  Fift: QMULRSHIFTMOD\_VAR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9AD` QMULRSHIFTRMOD\_VAR

  Fift: QMULRSHIFTRMOD\_VAR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9AE` QMULRSHIFTCMOD\_VAR

  Fift: QMULRSHIFTCMOD\_VAR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B0` QMULADDRSHIFTMOD

  Fift: \[tt+1] QMULADDRSHIFT#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B1` QMULADDRSHIFTRMOD

  Fift: \[tt+1] QMULADDRSHIFTR#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B2` QMULADDRSHIFTCMOD

  Fift: \[tt+1] QMULADDRSHIFTC#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B4` QMULRSHIFT

  Fift: \[tt+1] QMULRSHIFT#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B5` QMULRSHIFTR

  Fift: \[tt+1] QMULRSHIFTR#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B6` QMULRSHIFTC

  Fift: \[tt+1] QMULRSHIFTC#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B8` QMULMODPOW2

  Fift: \[tt+1] QMULMODPOW2#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9B9` QMULMODPOW2R

  Fift: \[tt+1] QMULMODPOW2R#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9BA` QMULMODPOW2C

  Fift: \[tt+1] QMULMODPOW2C#
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9BC` QMULRSHIFTMOD

  Fift: QMULRSHIFT#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9BD` QMULRSHIFTRMOD

  Fift: QMULRSHIFTR#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9BE` QMULRSHIFTCMOD

  Fift: QMULRSHIFTC#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C0` QLSHIFTADDDIVMOD\_VAR

  Fift: QLSHIFTADDDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C1` QLSHIFTADDDIVMODR\_VAR

  Fift: QLSHIFTADDDIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C2` QLSHIFTADDDIVMODC\_VAR

  Fift: QLSHIFTADDDIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C4` QLSHIFTDIV\_VAR

  Fift: QLSHIFTDIV
  Description: `0 <= z <= 256`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C5` QLSHIFTDIVR\_VAR

  Fift: QLSHIFTDIVR
  Description: `0 <= z <= 256`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C6` QLSHIFTDIVC\_VAR

  Fift: QLSHIFTDIVC
  Description: `0 <= z <= 256`
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C8` QLSHIFTMOD\_VAR

  Fift: QLSHIFTMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9C9` QLSHIFTMODR\_VAR

  Fift: QLSHIFTMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9CA` QLSHIFTMODC\_VAR

  Fift: QLSHIFTMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9CC` QLSHIFTDIVMOD\_VAR

  Fift: QLSHIFTDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9CD` QLSHIFTDIVMODR\_VAR

  Fift: QLSHIFTDIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9CE` QLSHIFTDIVMODC\_VAR

  Fift: QLSHIFTDIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D0` QLSHIFTADDDIVMOD

  Fift: \[tt+1] QLSHIFT#ADDDIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D1` QLSHIFTADDDIVMODR

  Fift: \[tt+1] QLSHIFT#ADDDIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D2` QLSHIFTADDDIVMODC

  Fift: \[tt+1] QLSHIFT#ADDDIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D4` QLSHIFTDIV

  Fift: \[tt+1] QLSHIFT#DIV
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D5` QLSHIFTDIVR

  Fift: \[tt+1] QLSHIFT#DIVR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D6` QLSHIFTDIVC

  Fift: \[tt+1] QLSHIFT#DIVC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D8` QLSHIFTMOD

  Fift: \[tt+1] QLSHIFT#MOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9D9` QLSHIFTMODR

  Fift: \[tt+1] QLSHIFT#MODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9DA` QLSHIFTMODC

  Fift: \[tt+1] QLSHIFT#MODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9DC` QLSHIFTDIVMOD

  Fift: \[tt+1] QLSHIFT#DIVMOD
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9DD` QLSHIFTDIVMODR

  Fift: \[tt+1] QLSHIFT#DIVMODR
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7A9DE` QLSHIFTDIVMODC

  Fift: \[tt+1] QLSHIFT#DIVMODC
  Description:
  Category: arithm\_quiet Arithm Quiet

  #### `B7B600` QFITSX

  Fift: QFITSX
  Description: Replaces `x` with a `NaN` if x is not a c-bit signed integer, leaves it intact otherwise.
  Category: arithm\_quiet Arithm Quiet

  #### `B7B601` QUFITSX

  Fift: QUFITSX
  Description: Replaces `x` with a `NaN` if x is not a c-bit unsigned integer, leaves it intact otherwise.
  Category: arithm\_quiet Arithm Quiet

  #### `B7F921` RIST255\_QVALIDATE

  Fift: RIST255\_QVALIDATE
  Description: Checks that integer `x` is a valid representation of some curve point. Returns -1 on success and 0 on failure.
  Category: app\_crypto App Crypto

  #### `B7F922` RIST255\_QADD

  Fift: RIST255\_QADD
  Description: Addition of two points on a curve. Returns -1 on success and 0 on failure.
  Category: app\_crypto App Crypto

  #### `B7F923` RIST255\_QSUB

  Fift: RIST255\_QSUB
  Description: Subtraction of two points on curve. Returns -1 on success and 0 on failure.
  Category: app\_crypto App Crypto

  #### `B7F924` RIST255\_QMUL

  Fift: RIST255\_QMUL
  Description: Multiplies point `x` by a scalar `n`. Any `n` is valid, including negative. Returns -1 on success and 0 on failure.
  Category: app\_crypto App Crypto

  #### `B7F925` RIST255\_QMULBASE

  Fift: RIST255\_QMULBASE
  Description: Multiplies the generator point `g` by a scalar `n`. Any `n` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F83400` PREVMCBLOCKS

  Fift: PREVMCBLOCKS
  Description: Retrives `last_mc_blocks` part of PrevBlocksInfo from c7 (parameter 13).
  Category: app\_config App Config

  #### `F83401` PREVKEYBLOCK

  Fift: PREVKEYBLOCK
  Description: Retrives `prev_key_block` part of PrevBlocksInfo from c7 (parameter 13).
  Category: app\_config App Config

  #### `F90400` HASHEXT\_SHA256

  Fift: HASHEXT\_SHA256
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90401` HASHEXT\_SHA512

  Fift: HASHEXT\_SHA512
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90402` HASHEXT\_BLAKE2B

  Fift: HASHEXT\_BLAKE2B
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90403` HASHEXT\_KECCAK256

  Fift: HASHEXT\_KECCAK256
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90404` HASHEXT\_KECCAK512

  Fift: HASHEXT\_KECCAK512
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90500` HASHEXTR\_SHA256

  Fift: HASHEXTR\_SHA256
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90501` HASHEXTR\_SHA512

  Fift: HASHEXTR\_SHA512
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90502` HASHEXTR\_BLAKE2B

  Fift: HASHEXTR\_BLAKE2B
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90503` HASHEXTR\_KECCAK256

  Fift: HASHEXTR\_KECCAK256
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90504` HASHEXTR\_KECCAK512

  Fift: HASHEXTR\_KECCAK512
  Description: Calculates and returns hash of the concatenation of slices (or builders) `s_1...s_n`.
  Category: app\_crypto App Crypto

  #### `F90600` HASHEXTA\_SHA256

  Fift: HASHEXTA\_SHA256
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90601` HASHEXTA\_SHA512

  Fift: HASHEXTA\_SHA512
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90602` HASHEXTA\_BLAKE2B

  Fift: HASHEXTA\_BLAKE2B
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90603` HASHEXTA\_KECCAK256

  Fift: HASHEXTA\_KECCAK256
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90604` HASHEXTA\_KECCAK512

  Fift: HASHEXTA\_KECCAK512
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90700` HASHEXTAR\_SHA256

  Fift: HASHEXTAR\_SHA256
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90701` HASHEXTAR\_SHA512

  Fift: HASHEXTAR\_SHA512
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90702` HASHEXTAR\_BLAKE2B

  Fift: HASHEXTAR\_BLAKE2B
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90703` HASHEXTAR\_KECCAK256

  Fift: HASHEXTAR\_KECCAK256
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F90704` HASHEXTAR\_KECCAK512

  Fift: HASHEXTAR\_KECCAK512
  Description: Calculates hash of the concatenation of slices (or builders) `s_1...s_n`. Appends the resulting hash to a builder `b`.
  Category: app\_crypto App Crypto

  #### `F93000` BLS\_VERIFY

  Fift: BLS\_VERIFY
  Description: Checks BLS signature, return true on success, false otherwise.
  Category: app\_crypto App Crypto

  #### `F93001` BLS\_AGGREGATE

  Fift: BLS\_AGGREGATE
  Description: Aggregates signatures. `n>0`. Throw exception if `n=0` or if some `sig_i` is not a valid signature.
  Category: app\_crypto App Crypto

  #### `F93002` BLS\_FASTAGGREGATEVERIFY

  Fift: BLS\_FASTAGGREGATEVERIFY
  Description: Checks aggregated BLS signature for keys `pk_1...pk_n` and message `msg`. Return true on success, false otherwise. Return false if `n=0`.
  Category: app\_crypto App Crypto

  #### `F93003` BLS\_AGGREGATEVERIFY

  Fift: BLS\_AGGREGATEVERIFY
  Description: Checks aggregated BLS signature for key-message pairs `pk_1 msg_1...pk_n msg_n`. Return true on success, false otherwise. Return false if `n=0`.
  Category: app\_crypto App Crypto

  #### `F93010` BLS\_G1\_ADD

  Fift: BLS\_G1\_ADD
  Description: Addition on G1.
  Category: app\_crypto App Crypto

  #### `F93011` BLS\_G1\_SUB

  Fift: BLS\_G1\_SUB
  Description: Subtraction on G1.
  Category: app\_crypto App Crypto

  #### `F93012` BLS\_G1\_NEG

  Fift: BLS\_G1\_NEG
  Description: Negation on G1.
  Category: app\_crypto App Crypto

  #### `F93013` BLS\_G1\_MUL

  Fift: BLS\_G1\_MUL
  Description: Multiplies G1 point `x` by scalar `s`. Any `s` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F93014` BLS\_G1\_MULTIEXP

  Fift: BLS\_G1\_MULTIEXP
  Description: Calculates `x_1*s_1+...+x_n*s_n` for G1 points `x_i` and scalars `s_i`. Returns zero point if `n=0`. Any `s_i` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F93015` BLS\_G1\_ZERO

  Fift: BLS\_G1\_ZERO
  Description: Pushes zero point in G1.
  Category: app\_crypto App Crypto

  #### `F93016` BLS\_MAP\_TO\_G1

  Fift: BLS\_MAP\_TO\_G1
  Description: Converts FP element `f` to a G1 point.
  Category: app\_crypto App Crypto

  #### `F93017` BLS\_G1\_INGROUP

  Fift: BLS\_G1\_INGROUP
  Description: Checks that slice `x` represents a valid element of G1.
  Category: app\_crypto App Crypto

  #### `F93018` BLS\_G1\_ISZERO

  Fift: BLS\_G1\_ISZERO
  Description: Checks that G1 point `x` is equal to zero.
  Category: app\_crypto App Crypto

  #### `F93020` BLS\_G2\_ADD

  Fift: BLS\_G2\_ADD
  Description: Addition on G2.
  Category: app\_crypto App Crypto

  #### `F93021` BLS\_G2\_SUB

  Fift: BLS\_G2\_SUB
  Description: Subtraction on G2.
  Category: app\_crypto App Crypto

  #### `F93022` BLS\_G2\_NEG

  Fift: BLS\_G2\_NEG
  Description: Negation on G2.
  Category: app\_crypto App Crypto

  #### `F93023` BLS\_G2\_MUL

  Fift: BLS\_G2\_MUL
  Description: Multiplies G2 point `x` by scalar `s`. Any `s` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F93024` BLS\_G2\_MULTIEXP

  Fift: BLS\_G2\_MULTIEXP
  Description: Calculates `x_1*s_1+...+x_n*s_n` for G2 points `x_i` and scalars `s_i`. Returns zero point if `n=0`. Any `s_i` is valid, including negative.
  Category: app\_crypto App Crypto

  #### `F93025` BLS\_G2\_ZERO

  Fift: BLS\_G2\_ZERO
  Description: Pushes zero point in G2.
  Category: app\_crypto App Crypto

  #### `F93026` BLS\_MAP\_TO\_G2

  Fift: BLS\_MAP\_TO\_G2
  Description: Converts FP2 element `f` to a G2 point.
  Category: app\_crypto App Crypto

  #### `F93027` BLS\_G2\_INGROUP

  Fift: BLS\_G2\_INGROUP
  Description: Checks that slice `x` represents a valid element of G2.
  Category: app\_crypto App Crypto

  #### `F93028` BLS\_G2\_ISZERO

  Fift: BLS\_G2\_ISZERO
  Description: Checks that G2 point `x` is equal to zero.
  Category: app\_crypto App Crypto

  #### `F93030` BLS\_PAIRING

  Fift: BLS\_PAIRING
  Description: Given G1 points `x_i` and G2 points `y_i`, calculates and multiply pairings of `x_i,y_i`. Returns true if the result is the multiplicative identity in FP12, false otherwise. Returns false if `n=0`.
  Category: app\_crypto App Crypto

  #### `F93031` BLS\_PUSHR

  Fift: BLS\_PUSHR
  Description: Pushes the order of G1 and G2 (approx. `2^255`).
  Category: app\_crypto App Crypto

  #### `F12_` CALLDICT\_LONG

  Fift: \[n] CALL
  \[n] CALLDICT
  Description: For `0 <= n < 2^14`, an encoding of `[n] CALL` for larger values of `n`.
  Category: cont\_dict Cont Dict

  #### `D76E_` CDEPTHI

  Fift: \[i] CDEPTHI
  Description: Returns `i`th depth of the cell.
  Category: cell\_parse Cell Parse

  #### `D76A_` CHASHI

  Fift: \[i] CHASHI
  Description: Returns `i`th hash of the cell.
  Category: cell\_parse Cell Parse

  #### `F4A6_` DICTPUSHCONST

  Fift: \[ref] \[n] DICTPUSHCONST
  Description: Pushes a non-empty constant dictionary `D` (as a `Cell^?`) along with its key length `0 <= n <= 1023`, stored as a part of the instruction. The dictionary itself is created from the first of remaining references of the current continuation. In this way, the complete `DICTPUSHCONST` instruction can be obtained by first serializing `xF4A4_`, then the non-empty dictionary itself (one `1` bit and a cell reference), and then the unsigned 10-bit integer `n` (as if by a `STU 10` instruction). An empty dictionary can be pushed by a `NEWDICT` primitive instead.
  Category: dict\_special Dict Special

  #### `F85_` GETGLOB

  Fift: \[k] GETGLOB
  Description: Returns the `k`-th global variable for `1 <= k <= 31`.
  Equivalent to `c7 PUSHCTR` `[k] INDEXQ`.
  Category: app\_global App Global

  #### `E39_` IFBITJMP

  Fift: \[n] IFBITJMP
  Description: Checks whether bit `0 <= n <= 31` is set in integer `x`, and if so, performs `JMPX` to continuation `c`. Value `x` is left in the stack.
  Category: cont\_conditional Cont Conditional

  #### `E3D_` IFBITJMPREF

  Fift: \[ref] \[n] IFBITJMPREF
  Description: Performs a `JMPREF` if bit `0 <= n <= 31` is set in integer `x`.
  Category: cont\_conditional Cont Conditional

  #### `E3B_` IFNBITJMP

  Fift: \[n] IFNBITJMP
  Description: Jumps to `c` if bit `0 <= n <= 31` is not set in integer `x`.
  Category: cont\_conditional Cont Conditional

  #### `E3F_` IFNBITJMPREF

  Fift: \[ref] \[n] IFNBITJMPREF
  Description: Performs a `JMPREF` if bit `0 <= n <= 31` is not set in integer `x`.
  Category: cont\_conditional Cont Conditional

  #### `6FE_` INDEX3

  Fift: \[i] \[j] \[k] INDEX3
  Description: Recovers `x=t_&#123i+1&#125_&#123j+1&#125_&#123k+1&#125`.
  `0 <= i,j,k <= 3`
  Equivalent to `[i] [j] INDEX2` `[k] INDEX`.
  Category: tuple Tuple
  Alias: CADDR Recovers `x=t_2_2_1`.
  Alias: CDDDR Recovers `x=t_2_2_2`.

  #### `F16_` JMPDICT

  Fift: \[n] JMP
  Description: Jumps to the continuation in `c3`, pushing integer `0 <= n < 2^14` as its argument.
  Approximately equivalent to `n PUSHINT` `c3 PUSHCTR` `JMPX`.
  Category: cont\_dict Cont Dict

  #### `F4AE_` PFXDICTCONSTGETJMP

  Fift: \[ref] \[n] PFXDICTCONSTGETJMP
  \[ref] \[n] PFXDICTSWITCH
  Description: Combines `[n] DICTPUSHCONST` for `0 <= n <= 1023` with `PFXDICTGETJMP`.
  Category: dict\_special Dict Special

  #### `D74E_` PLDREFIDX

  Fift: \[n] PLDREFIDX
  Description: Returns the `n`-th cell reference of *Slice* `s`, where `0 <= n <= 3`.
  Category: cell\_parse Cell Parse
  Alias: PLDREF Preloads the first cell reference of a *Slice*.

  #### `D714_` PLDUZ

  Fift: \[32(c+1)] PLDUZ
  Description: Preloads the first `32(c+1)` bits of *Slice* `s` into an unsigned integer `x`, for `0 <= c <= 7`. If `s` is shorter than necessary, missing bits are assumed to be zero. This operation is intended to be used along with `IFBITJMP` and similar instructions.
  Category: cell\_parse Cell Parse

  #### `F1A_` PREPAREDICT

  Fift: \[n] PREPARE
  \[n] PREPAREDICT
  Description: Equivalent to `n PUSHINT` `c3 PUSHCTR`, for `0 <= n < 2^14`.
  In this way, `[n] CALL` is approximately equivalent to `[n] PREPARE` `EXECUTE`, and `[n] JMP` is approximately equivalent to `[n] PREPARE` `JMPX`.
  One might use, for instance, `CALLXARGS` or `CALLCC` instead of `EXECUTE` here.
  Category: cont\_dict Cont Dict

  #### `8F_` PUSHCONT

  Fift: \[builder] PUSHCONT
  \[builder] CONT
  Description: Pushes a continuation made from `builder`.
  *Details:* Pushes the simple ordinary continuation `cccc` made from the first `0 <= r <= 3` references and the first `0 <= xx <= 127` bytes of `cc.code`.
  Category: const\_data Const Data

  #### `D72A_` SDBEGINS

  Fift: \[slice] SDBEGINS
  Description: Checks whether `s` begins with constant bitstring `sss` of length `8x+3` (with continuation bit assumed), where `0 <= x <= 127`, and removes `sss` from `s` on success.
  Category: cell\_parse Cell Parse

  #### `D72E_` SDBEGINSQ

  Fift: \[slice] SDBEGINSQ
  Description: A quiet version of `SDBEGINS`.
  Category: cell\_parse Cell Parse

  #### `F87_` SETGLOB

  Fift: \[k] SETGLOB
  Description: Assigns `x` to the `k`-th global variable for `1 <= k <= 31`.
  Equivalent to `c7 PUSHCTR` `SWAP` `k SETINDEXQ` `c7 POPCTR`.
  Category: app\_global App Global

  #### `CFC0_` STSLICECONST

  Fift: \[slice] STSLICECONST
  Description: Stores a constant subslice `sss`.
  *Details:* `sss` consists of `0 <= x <= 3` references and up to `8y+2` data bits, with `0 <= y <= 7`. Completion bit is assumed.
  Note that the assembler can replace `STSLICECONST` with `PUSHSLICE` `STSLICER` if the slice is too big.
  Category: cell\_build Cell Build
  Alias: STZERO Stores one binary zero.
  Alias: STONE Stores one binary one.

  #### `F2C4_` THROW

  Fift: \[n] THROW
  Description: For `0 <= n < 2^11`, an encoding of `[n] THROW` for larger values of `n`.
  Category: exceptions Exceptions

  #### `F2CC_` THROWARG

  Fift: \[n] THROWARG
  Description: Throws exception `0 <= n <  2^11` with parameter `x`, by copying `x` and `n` into the stack of `c2` and transferring control to `c2`.
  Category: exceptions Exceptions

  #### `F2DC_` THROWARGIF

  Fift: \[n] THROWARGIF
  Description: Throws exception `0 <= nn < 2^11` with parameter `x` only if integer `f!=0`.
  Category: exceptions Exceptions

  #### `F2EC_` THROWARGIFNOT

  Fift: \[n] THROWARGIFNOT
  Description: Throws exception `0 <= n < 2^11` with parameter `x` only if integer `f=0`.
  Category: exceptions Exceptions

  #### `F2D4_` THROWIF

  Fift: \[n] THROWIF
  Description: For `0 <= n < 2^11`, an encoding of `[n] THROWIF` for larger values of `n`.
  Category: exceptions Exceptions

  #### `F2E4_` THROWIFNOT

  Fift: \[n] THROWIFNOT
  Description: For `0 <= n < 2^11`, an encoding of `[n] THROWIFNOT` for larger values of `n`.
  Category: exceptions Exceptions

  #### `F2A_` THROWIFNOT\_SHORT

  Fift: \[n] THROWIFNOT
  Description: Throws exception `0 <= n <= 63` with parameter zero only if integer `f=0`.
  Category: exceptions Exceptions

  #### `F26_` THROWIF\_SHORT

  Fift: \[n] THROWIF
  Description: Throws exception `0 <= n <= 63` with  parameter zero only if integer `f!=0`.
  Category: exceptions Exceptions

  #### `F22_` THROW\_SHORT

  Fift: \[n] THROW
  Description: Throws exception `0 <= n <= 63` with parameter zero.
  In other words, it transfers control to the continuation in `c2`, pushing `0` and `n` into its stack, and discarding the old stack altogether.
  Category: exceptions Exceptions
</div>
