en-us_products:mpino_studio2:box_functions:bit_operations
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_products:mpino_studio2:box_functions:bit_operations [2026/09/09 17:54] – 만듦 - 바깥 편집 127.0.0.1 | en-us_products:mpino_studio2:box_functions:bit_operations [2026/09/10 01:05] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| {{ : | {{ : | ||
| - | This ladder screen compares the input forms of WAND, SHL, and ROL. | + | ===== Common Rules ===== |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | ===== 1. Common Rules ===== | + | |
| Bit-operation commands process all 16 bits in a WORD. A shift discards bits that leave the word and fills with zero; a rotate brings those bits back at the opposite end. | Bit-operation commands process all 16 bits in a WORD. A shift discards bits that leave the word and fills with zero; a rotate brings those bits back at the opposite end. | ||
| - | ===== 2. WAND, WOR, and WXOR ===== | + | ===== Box Function List ===== |
| - | + | ||
| - | ==== WAND ==== | + | |
| - | + | ||
| - | **Word AND** | + | |
| - | + | ||
| - | Applies bitwise AND to two WORD values and stores the result. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x00CC, D1=0x00AA | '' | + | |
| - | + | ||
| - | ==== WOR ==== | + | |
| - | + | ||
| - | **Word OR** | + | |
| - | + | ||
| - | Applies bitwise OR to two WORD values and stores the result. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x00CC, D1=0x00AA | '' | + | |
| - | + | ||
| - | ==== WXOR ==== | + | |
| - | + | ||
| - | **Word XOR** | + | |
| - | + | ||
| - | Applies bitwise XOR to two WORD values and stores the result. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x00CC, D1=0x00AA | '' | + | |
| - | + | ||
| - | ===== 3. WNOT ===== | + | |
| - | + | ||
| - | **Word NOT** | + | |
| - | + | ||
| - | Inverts every bit in the source WORD and stores the result. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = S: source address or constant to invert | + | |
| - | * 2nd = D: result destination address | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x00CC | '' | + | |
| - | + | ||
| - | ===== 4. SHL and SHR ===== | + | |
| - | + | ||
| - | ==== SHL ==== | + | |
| - | + | ||
| - | **Shift Left** | + | |
| - | + | ||
| - | Shifts a WORD left and stores the result. Bits leaving the left are discarded and zeros fill from the right. Use a shift count from 0 to 15. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = source: integer WORD address | + | |
| - | * 2nd = shift count: 0 to 15 | + | |
| - | * 3rd = destination: | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x0003 | '' | + | |
| - | + | ||
| - | ==== SHR ==== | + | |
| - | + | ||
| - | **Shift Right** | + | |
| - | + | ||
| - | Logically shifts a D WORD right and stores the result. Bits leaving the right are discarded and zeros fill from the left. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = source: D WORD address | + | |
| - | * 2nd = shift count: 0 to 15 | + | |
| - | * 3rd = destination: | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x000C | '' | + | |
| - | + | ||
| - | ===== 5. ROL and ROR ===== | + | |
| - | + | ||
| - | ==== ROL ==== | + | |
| - | + | ||
| - | **Rotate Left** | + | |
| - | + | ||
| - | Rotates a D, C, or T WORD left. Bits leaving the left return at the right end. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = source: D, C, or T WORD address | + | |
| - | * 2nd = rotate count | + | |
| - | * 3rd = destination: | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x8001 | '' | + | |
| - | + | ||
| - | ==== ROR ==== | + | |
| - | + | ||
| - | **Rotate Right** | + | |
| - | + | ||
| - | Rotates a D, C, or T WORD right. Bits leaving the right return at the left end. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = source: D, C, or T WORD address | + | |
| - | * 2nd = rotate count | + | |
| - | * 3rd = destination: | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=0x0003 | '' | + | |
| - | + | ||
| - | ===== 6. Troubleshooting | + | |
| - | ^ Symptom | + | ^ Command |
| - | | A sign bit does not fill the left side during a right shift. | SHR is a logical shift that fills the upper empty bits with zero. | | + | | [[en-us_products: |
| - | | Bits disappear after a shift. | Use ROL or ROR instead of SHL or SHR when the shifted-out bits must be preserved. | | + | | [[en-us_products: |
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| ===== Related Documentation ===== | ===== Related Documentation ===== | ||
| * [[en-us_products: | * [[en-us_products: | ||
| - | * [[en-us_products: | ||
| - | * [[en-us_products: | ||
| * [[en-us_products: | * [[en-us_products: | ||
en-us_products/mpino_studio2/box_functions/bit_operations.1788944071.txt.gz · Last modified: by 127.0.0.1
