<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="guide" id="mode-programming" lang="ca">

  <info>
      <link type="guide" xref="index#number"/>
  <credit type="translator copyright"><name>Joan Duran</name><email>jodufi@gmail.com</email><years>2008</years></credit><credit type="translator copyright"><name>Sergi Morraja</name><email>sergi256@gmail.com</email><years>2011, 2012</years></credit><credit type="translator copyright"><name>Gil Forcada</name><email>gilforcada@guifi.net</email><years>2013</years></credit><credit type="translator copyright"><name>Miquel-Àngel Burgos i Fradeja</name><email>miquel.angel.burgos@gmail.com</email><years>2020</years></credit><credit type="translator copyright"><name>Victor Dargallo</name><email>victordargallo@disroot.org</email><years>2025</years></credit></info>

      <title>Mode de programació</title>

  <p>
  <gui style="menuitem">Programming mode</gui> provides the tools required for common mathematical operations in software development. For example, programming mode makes math on hexadecimal numbers very easy. It also supports common <link xref="boolean">bitwise operators</link> like <gui>NOT</gui>, <gui>AND</gui>, <gui>OR</gui>, etc. A binary view for numbers up to 64 bits long is displayed, where the user can manually toggle each bit using the mouse cursor.
  </p>
  <p>
  Additionally, bit-shifting operations are possible by using the <gui>≪</gui>, <gui>≫</gui> and <gui>⋙</gui> buttons. <link xref="modulus">Modulo arithmetic</link> can be accomplished using the <gui>mod</gui> button.
  </p>
  <p>
  The default word size for bitwise, two’s complement, and swap endianness functions can be changed both in the <gui style="menuitem">Preferences</gui> menu, or by using the word size button in the bottom of the keypad while in programming mode. This will affect how results from these functions are shown. For example, here we show the two’s complement of the number 6B in 64 bit and 16 bit word sizes:
  </p>
    <example>
    <p>64 bits:</p>
    <p>
    twos 6B
    </p>
    <p>FFFFFFFFFFFFFF95</p>
    <p>16 bits:</p>
    <p>
    twos 6B
    </p>
    <p>FF95</p>
    </example>
    <note style="warning">
    <p>Attempting to enter a larger number than will fit in the selected word size will result in an Overflow error.</p>
    </note>

</page>
