main.pp 709 B

1234567891011121314151617181920212223242526272829
  1. program main;
  2. {$apptype arm9}
  3. {$define ARM9}
  4. {$mode objfpc}
  5. uses
  6. ctypes, nds9;
  7. // The default exception handler displays the exception type - data abort or undefined instruction
  8. // you can relate the exception to your code using arm-eabi-addr2line -e <elf file> <address>
  9. // assuming you built with debug info this will display a source file and a line number
  10. // The address of the instruction is shown as pc, beside the address which faulted
  11. // the rest of the screen is a dump of the registers.
  12. begin
  13. // install the default exception handler
  14. defaultExceptionHandler();
  15. irqInit();
  16. irqEnable(IRQ_VBLANK);
  17. // generate an exception
  18. pu32(250)^ := 100;
  19. while true do
  20. swiWaitForVBlank();
  21. end.