Read the value from S38 using ATS38?
Convert it to binary, using the following weight table:
Bit | Binary value | Decimal value | Hexadecimal value |
0 | 00000001 | 1 | $01 |
1 | 00000010 | 2 | $02 |
2 | 00000100 | 4 | $04 |
3 | 00001000 | 8 | $08 |
4 | 00010000 | 16 | $10 |
5 | 00100000 | 32 | $20 |
6 | 01000000 | 64 | $40 |
7 | 10000000 | 128 | $80 |
To set bit 3 to 1 (binary), do a logic OR operation with the value.
Operation |
|
|
|
|
|
|
| Binary | Dec. | Hex | Binary | Dec. | Hex. |
| 10001000 | 136 | $88 | 01000000 | 64 | $40 |
OR | 00001000 | 8 | $08 | 00001000 | 8 | $08 |
| 10001000 | 136 | $88 | 01001000 | 72 | $48 |
To set bit 3 to 0 (binary), you must invert the value using a logic NOT operation and then do an logic AND operation.
NOT | 00001000 | 8 | $08 | 00001000 | 8 | $08 |
| 11110111 | 247 | $F7 | 11110111 | 247 | $F7 |
AND | 10001000 | 136 | $88 | 01000000 | 64 | $40 |
| 10000000 | 128 | $80 | 01000000 | 64 | $40 |
Finally, using the result decimal value, issue an ATS38=n to set the register.
S-Register Descriptions
The descriptions for each
Values followed by an asterisk * are the factory default settings.
Status Registers and Result Codes 127