(value)
| 38 | // check if value is in Binary Coded Decimal format |
| 39 | // assumes integer and is in the range [0, 0xffff] |
| 40 | function check_bcd(value) { |
| 41 | for (let i = 0; i <= 12; i += 4) { |
| 42 | const nibble = (value >>> i) & 0xf; |
| 43 | |
| 44 | if (nibble > 9) { |
| 45 | return false; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | export function set_target(value) { |
| 53 | if (!Number.isInteger(value)) { |