DSP2803x_DisInt.asm 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ;//###########################################################################
  2. ;//
  3. ;// FILE: DSP2803x_DisInt.asm
  4. ;//
  5. ;// TITLE: Disable and Restore INTM and DBGM
  6. ;//
  7. ;// Function Prototypes:
  8. ;//
  9. ;// Uint16 DSP28x_DisableInt();
  10. ;// and void DSP28x_RestoreInt(Uint16 Stat0);
  11. ;//
  12. ;// Usage:
  13. ;//
  14. ;// DSP28x_DisableInt() sets both the INTM and DBGM
  15. ;// bits to disable maskable interrupts. Before doing
  16. ;// this, the current value of ST1 is stored on the stack
  17. ;// so that the values can be restored later. The value
  18. ;// of ST1 before the masks are set is returned to the
  19. ;// user in AL. This is then used to restore their state
  20. ;// via the DSP28x_RestoreInt(Uint16 ST1) function.
  21. ;//
  22. ;// Example
  23. ;//
  24. ;// Uint16 StatusReg1
  25. ;// StatusReg1 = DSP28x_DisableInt();
  26. ;//
  27. ;// ... May also want to disable INTM here
  28. ;//
  29. ;// ... code here
  30. ;//
  31. ;// DSP28x_RestoreInt(StatusReg1);
  32. ;//
  33. ;// ... Restore INTM enable
  34. ;//
  35. ;//###########################################################################
  36. ;// $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  37. ;// $Release Date: May 8, 2015 $
  38. ;// $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  39. ;// http://www.ti.com/ ALL RIGHTS RESERVED $
  40. ;//###########################################################################
  41. .def _DSP28x_DisableInt
  42. .def _DSP28x_RestoreInt
  43. _DSP28x_DisableInt:
  44. PUSH ST1
  45. SETC INTM,DBGM
  46. MOV AL, *--SP
  47. LRETR
  48. _DSP28x_RestoreInt:
  49. MOV *SP++, AL
  50. POP ST1
  51. LRETR
  52. ;//===========================================================================
  53. ;// End of file.
  54. ;//===========================================================================