Implementation Details
5-61
Code Development Tools
;–––––––––––––––––––––––––––––––––––––––––––––––––––––
; called from C––
; void oport(char Port, int Data)
; Writes Data to the I/O port specified by the letter Port.
; Example:
; oport(’B’, 0xAA); //Write 0xAA to port B.
;–––––––––––––––––––––––––––––––––––––––––––––––––––––
_oport
mov
a0, *r7 – 4
; port address
mov
a0~, *r7 – 2
; data
add
a0, _out_port_access – ’A’ ; find the location in the table
mov
a0, *a0
; get the value of the label in the table
jmp
*a0
; jump to the label from the table
_prta
out
0x00, a0~
; write to PortA
ret
_prtb
out
0x08, a0~;
write to PortB
ret
_prtc
out
0x10, a0~
; write to PortC
ret
_prtd
out
0x18, a0~
; write to PortD
ret
_prte
out
0x20, a0~
; write to PortE
ret
_out_port_access
; table for table lookup
DATA
_prta
DATA
_prtb
DATA
_prtc
DATA
_prtd
DATA
_prte
;–––––––––––––––––––––––––––––––––––––––––––––––––––––
;–––––––––––––––––––––––––––––––––––––––––––––––––––––
; called from C––
; int iport(char Port)
; Reads data from the I/O port specified by the letter Port.
; Example:
; int data = iport(’F’); //Read port F.
;–––––––––––––––––––––––––––––––––––––––––––––––––––––
_iport
mov
a0, *r7 – 2
; port address
add
a0, _in_port_access – ’A’ ; find the location in the table
mov
a0, *a0
; get the value of the label in the table
jmp
*a0
; jump to the label from the table
_iprta
in
a0, 0x00
; read from PortA
ret
_iprtb
in
a0, 0x08
; read from PortB
ret
Summary of Contents for MSP50C614
Page 1: ...MSP50C614 Mixed Signal Processor User s Guide SPSU014 January 2000 Printed on Recycled Paper ...
Page 6: ...vi ...
Page 92: ...3 22 ...
Page 300: ...Instruction Set Summay 4 208 Assembly Language Instructions ...
Page 314: ...Software Emulator 5 14 Figure 5 13 Project Menu Figure 5 14 Project Open Dialog ...
Page 325: ...Software Emulator 5 25 Code Development Tools Figure 5 25 EPROM Programming Dialog ...
Page 331: ...Software Emulator 5 31 Code Development Tools Figure 5 31 Context Sensitive Help System ...
Page 368: ...5 68 ...
Page 394: ...7 12 ...
Page 402: ...A 8 ...
Page 412: ...Packaging B 10 ...