Motorola MC68340 manual Chkstat MOVE.B SRA,D0

Models: MC68340

1 441
Download 441 pages 2.45 Kb
Page 222
Image 222

Freescale Semiconductor, Inc.

Command Sequence:

CALL

MS ADDR

LS ADDR

???

"NOT READY"

"NOT READY"

 

XXX

NEXT CMD

 

"ILLEGAL"

"NOT READY"

STACK

RETURN PC

FREEZE

NEGATED

PREFETCH

STARTED

NORMAL

MODE

XXX

NEXT CMD

BERR/AERR

"NOT READY"

Freescale Semiconductor, Inc...

Operand Data:

The 32-bit operand data is the starting location of the patch routine, which is the initial PC upon exiting BDM.

Result Data: None

As an example, consider the following code segment. It outputs a character from the MC68340 serial module channel A.

CHKSTAT:

MOVE.B

SRA,D0

Move serial status to D0

 

BNE.B

CHKSTAT

Loop until condition true

 

MOVE.B

TBA,OUTPUT

Transmit character

MISSING:

ANDI.B

#3,D0

Check for TxEMP flag

 

RTS

 

 

BDM and the CALL command can be used to patch the code as follows:

1.Breakpoint user program at CHKSTAT

2.Enter BDM

3.Execute CALL command to MISSING

4.Exit BDM

5.Execute MISSING code

6.Return to user program

5.6.2.8.14Reset Peripherals (RST). RST asserts RESET for 512 clock cycles. The CPU is not reset by this command. This command is synonymous with the CPU RESET instruction.

MOTOROLAMC68340 USER’S MANUAL5- 85

For More Information On This Product,

Go to: www.freescale.com

Page 222
Image 222
Motorola MC68340 manual Chkstat MOVE.B SRA,D0