HPlogo System Debug Reference Manual > Chapter 10 System Debug Standard Functions

func cmbpinstr

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Returns the original CM instruction at a specified CM code address where a CM breakpoint has been set.

Syntax



   cmbpinstr (cmaddr [pin])

This function accepts the address (either logical or absolute) of an existing CM breakpoint and returns the instruction associated with that breakpoint. The default action is to look for breakpoints set by the current PIN. Breakpoint indices for other PINs (including the global pin) may be retrieved by utilizing the optional pin parameter.

Formal Declaration


cmbpinstr:s16 (cmaddr:cptr [pin:s16=0])

Parameters


cmaddr

Look for this address in the CM breakpoint table. Both logical and absolute code addresses are supported.

pin

Look for breakpoints set by this PIN. Default is the caller's PIN (a pin of 0 implies this). To specify system (global) breakpoints, use a -1 (or 32762) as the PIN.

Examples



   %cmdebug > dc FOPEN,1
   %005274:  FOPEN+%0                     004300  ..   STAX, NOP

Display code at the address of FOPEN so we can see what the current instruction at that address is.

   %cmdebug > b FOPEN
   added: CM      [1] SYS  % 161.5274  FOPEN+%0

   %cmdebug > dc FOPEN,1
   %005274:  FOPEN+%0                     003600  <.   BRKP

Now set a breakpoint at FOPEN and display the code there. The old instruction has been replaced with a breakpoint instruction.

   %cmdebug > wl cmbpinstr(FOPEN)
   %4300

Use the function to look up the actual instruction. The instruction that is stored in the system breakpoint table is returned by the function.

Limitations, Restrictions


none




func cmbpindex


func cmentry