COP8SA-DM National Semiconductor, COP8SA-DM Datasheet - Page 156
COP8SA-DM
Manufacturer Part Number
COP8SA-DM
Description
MODULE DEBUGGING FOR COP8SA
Manufacturer
National Semiconductor
Datasheet
1.DM-COP820D.pdf
(254 pages)
Specifications of COP8SA-DM
Module/board Type
Debugger Module
For Use With/related Products
Cop 8
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
*COP8SA-DM
- Current page: 156 of 254
- Download datasheet (2Mb)
This section is intended to be an overview of programming examples. For more detailed
and varied programming examples, refer to the Microontroller COP8 Databook.
2.19.1 Clear RAM
The following program clears all RAM locations in the base segment except for the stack
pointer. The value of the argument to IFBNE may need to be adjusted, depending on the
size of RAM in specific family members.
PROGRAM TO CLEAR ALL RAM EXCEPT SP
CLRAM:
CLRAM2: LD
CLRAM3: LD
2.19.2 Binary/BCD Arithmetic Operations
The arithmetic instructions include the Add (ADD), Add with Carry (ADC), Subtract
with Carry (SUBC), Increment (INC), Decrement (DEC), Decimal Correct (DCOR), Clear
Accumulator (CLR), Set Carry (SC), and Reset Carry (RC). The shift and rotate
instructions, which include the Rotate Right through Carry (RRC), the Rotate Left
through Carry (RLC), and the Swap accumulator nibbles (SWAP), may also be considered
arithmetic instruction variations. The RRC instruction is instrumental in writing a fast
multiply routine.
In subtraction, a borrow is represented by the absence of a Carry and vice versa.
Consequently, the Carry flag needs to be set (no borrow) before a subtraction, just as the
Carry flag is reset (no carry) before an addition. The ADD instruction does not use the
Carry flag as an input. It should also be noted that both the Carry and Half Carry flags
(Bits 6 and 7, respectively, of the PSW control register) are cleared with RESET and
remain unchanged with the ADD, INC, DEC, DCOR, CLR, and SWAP instructions. The
DCOR instruction uses both the Carry and Half Carry flags. The SC instruction sets both
the Carry and Half Carry flags, while the RC instruction resets both these flags.
The following program examples illustrate additions and subtractions of 4-byte data
fields in both binary and BCD (Binary Coded Decimal). The four bytes from data memory
locations 24 through 27 are added to or subtracted from the four bytes in data memory
locations 16 through 19. The results replace the data in memory locations 24 through 27.
These operations are performed both in binary and BCD. It should be noted that the BCD
preconditioning of adding (ADD) the hexadecimal value 66 is necessary only with the
BCD addition, not with the BCD subtraction. The binary coded decimal DCOR (Decimal
Correct) instruction uses both the Cary and Half Carry flags as inputs but does not
change the Carry and Half Carry flags. Also note that the #12 with the IFBNE
2-118
COP8SAx7 MICROCONTROLLER
LD
LD
DRSZ
JP
LD
IFBNE
JP
LD
0FC,#070
B,#0
[B+],#0
0FC
CLRAM2
B,#0F0
[B+],#0
#0D
CLRAM3
B,#0
;Define X-pointer as counter
:Initialize B pointer
;Load mem with 0 and incr B pointer
;Decrement counter
;Skip if lower half RAM is cleared
;Point B to upper half of RAM
;Load upper RAM half with 0
;until B points to 0FD (=SP)
;Skip if B=0FD
;Initialize B to 0
Related parts for COP8SA-DM
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
PROGRAMING UNIT FOR COP8SA PARTS
Manufacturer:
National Semiconductor
Part Number:
Description:
ADAPTER SOIC 16,20,28,44 PLCC
Manufacturer:
National Semiconductor
Part Number:
Description:
8-Bit CMOS ROM Based and One-Time Programmable OTP Microcontroller with 1k to 4k Memory/ Power On Reset/ and Very Small Packaging
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
National Semiconductor [8-Bit D/A Converter]
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
National Semiconductor [Media Coprocessor]
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
Digitally Controlled Tone and Volume Circuit with Stereo Audio Power Amplifier, Microphone Preamp Stage and National 3D Sound
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
Digitally Controlled Tone and Volume Circuit with Stereo Audio Power Amplifier, Microphone Preamp Stage and National 3D Sound
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
AC97 Rev 2 Codec with Sample Rate Conversion and National 3D Sound
Manufacturer:
National Semiconductor
Part Number:
Description:
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
General Purpose, Low Voltage, Low Power, Rail-to-Rail Output Operational Amplifiers
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
8-bit 20 MSPS flash A/D converter.
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
Low Noise Quad Operational Amplifier
Manufacturer:
National Semiconductor
Datasheet:
Part Number:
Description:
Quad Differential Line Receivers
Manufacturer:
National Semiconductor
Datasheet: