Basic Arithmetic Operation Using TMS320L50 DSP Processor:
ADDITION:
C000 LDP #100H
C001 LACC #05,0
C003 ADD #02
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-05 8010 - 0007
IMMEDIATE DATA-02 8011 - 0000
SUBTRACTION:
C000 LDP #100H
C001 LACC #07,0
C003 SUB #03
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-07 8010 - 0004
IMMEDIATE DATA-03 8011 - 0000
AND OPERATION:
C000 LDP #100
C001 LACC #06,0
C003 AND #05
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-06 8020 - 0004
IMMEDIATE DATA-05 8021 - 0000
OR OPERATION:
C000 LDP #100
C001 LACC #08,0
C003 OR #03
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-08 8020 - 000B
IMMEDIATE DATA-03 8021 - 0000
XOR OPERATION:
C000 LDP #100
C001 LACC #04,0
C003 XOR #09
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-04 8020 - 000D
IMMEDIATE DATA-09 8021 - 0000
INDIRECT ADDRESSING MODES:
LDP #100
LAR 0,#8001
LAR 1,#8010
MAR *,0
LACC *+
ADD *,0,1
SACL *+
SACH *
MULTIPLICATION:
LDP #100
LACC #037A,0
SACL 0000,0
LACC #012E,0
SACL 0001,0
LT 0000
MPY 0001
PAC
SACL 0002,0
SACH 0003,0
INPUT OUTPUT
ACCUMULATOR-05 8020 - 0050
IMMEDIATE DATA-10 8021 - 0000
ADDITION:
C000 LDP #100H
C001 LACC #05,0
C003 ADD #02
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-05 8010 - 0007
IMMEDIATE DATA-02 8011 - 0000
SUBTRACTION:
C000 LDP #100H
C001 LACC #07,0
C003 SUB #03
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-07 8010 - 0004
IMMEDIATE DATA-03 8011 - 0000
AND OPERATION:
C000 LDP #100
C001 LACC #06,0
C003 AND #05
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-06 8020 - 0004
IMMEDIATE DATA-05 8021 - 0000
OR OPERATION:
C000 LDP #100
C001 LACC #08,0
C003 OR #03
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-08 8020 - 000B
IMMEDIATE DATA-03 8021 - 0000
XOR OPERATION:
C000 LDP #100
C001 LACC #04,0
C003 XOR #09
C004 SACL 0010,0
C005 SACH 0011,0
C006 B C006
INPUT OUTPUT
ACCUMULATOR-04 8020 - 000D
IMMEDIATE DATA-09 8021 - 0000
INDIRECT ADDRESSING MODES:
LDP #100
LAR 0,#8001
LAR 1,#8010
MAR *,0
LACC *+
ADD *,0,1
SACL *+
SACH *
MULTIPLICATION:
LDP #100
LACC #037A,0
SACL 0000,0
LACC #012E,0
SACL 0001,0
LT 0000
MPY 0001
PAC
SACL 0002,0
SACH 0003,0
INPUT OUTPUT
ACCUMULATOR-05 8020 - 0050
IMMEDIATE DATA-10 8021 - 0000
0 comments:
Post a Comment