_detect_calc.s 771 B

12345678910111213141516171819202122232425
  1. .xdef __detect_calc
  2. | This object file needs the jump table in %a0.
  3. .xdef __ref_all___get_jump_table
  4. .section _st30
  5. __detect_calc:
  6. | At first, assume TI-92 Plus.
  7. | It takes less space to write the values into %d0 first and then check whether they are correct.
  8. moveq #1,%d0
  9. | Move the address of the jump table to %d1.
  10. move.l %a0,%d1
  11. and.l #0x400000,%d1
  12. | Now %d1 is 0 on a TI-89, TI-89 Titanium or V200, or 0x400000 on a TI-92+.
  13. jbne __calc_in_d0__
  14. | Otherwise, assume TI-89 / TI-89 Titanium.
  15. clr.w %d0
  16. | Get the address of the ScrRect variable into a1.
  17. move.l (%a0,0x2F*4),%a1 /* ScrRect */
  18. | If ScrRect+2 (x2) is less than 200, it is a TI-89 or TI-89 Titanium.
  19. cmp.b #200,2(%a1)
  20. jbcs __calc_in_d0__
  21. | Otherwise, it is a V200.
  22. moveq #3,%d0
  23. __calc_in_d0__: