SX User’s Manual Rev. 3.1 88 © 2000 Scenix Semiconductor, Inc. All rights reserved. www.scenix.com Chapter 3 Instruction Set 3.6.19    MOV M,#lit Move Literal to MODE Register Operation: MODE = lit Bits affected: none Opcode: 0000 0101 kkkk Description: For SX18/20/28AC and SX18/20/28AC75 devices, this instruction writes a 4-bit
value to the lower four bits of the MODE register. For SX48/52BD devices, this in-
struction writes a 5-bit value to the lower five bits of the MODE register. These bits
select the port control registers accessed by the “MOV !rx,W” instructions. For in-
formation on the specific MODE register values to use for accessing the port control
registers, see Section 5.3.2.
Cycles: 1 Example: mov   W,#$1D    ;1Dh to control level sensitivity
mov   M,W
                            ;put 1Dh into MODE register
mov   W,#$00    ;W = 0000 0000
mov   !RA,W
;select CMOS levels for Port A mov   M,#$E                              ;1Eh to control pullups
mov   W,#$03    ;W = 0000 1111
mov   !RA,W
;disconnect pullups for RA3:RA0 mov   M,#$F                              ;1Fh to control data direction
mov   W,#$0F   ;W = 1111 0000
mov   !RA,W
;make RA3:RA0 operate as outputs This example sets the configuration of Port A pins: the level sensitivity, the pullup
connections, and the data direction. The “mov M,W” instruction is used to load the
MODE register the first time because it controls the four lower bits of the MODE
register ( SX18/20/28AC and SX18/20/28AC75 devices) and the five lower bitsof
the MODE register for the SX48/52BD devices. The two subsequent “mov M,#lit”
instructions change the lower four bits of the MODE register.