| Get the address of the jump table (needed a few times). move.l 0xC8,%a0 /* Calculator Detection */ | At first, assume TI-92 Plus. | It takes less space to write the values into %d0 first and then check whether they are correct. moveq #1,%d0 | Move the address of the jump table to %d1. move.l %a0,%d1 and.l #0x400000,%d1 | Now %d1 is 0 on a TI-89 or V200, or 0x400000 on a TI-92+. jbne __calc_in_d0__ | Otherwise, assume TI-89. clr.w %d0 | Get the address of the ScrRect variable into a1. move.l (%a0,0x2F*4),%a1 /* ScrRect */ | If ScrRect+2 (x2) is less than 200, it is a TI-89. cmp.b #200,2(%a1) jbcs __calc_in_d0__ | Otherwise, it is a V200. moveq #3,%d0 __calc_in_d0__: | Fill __calculator now, since __calc_is_OK__ may be located at different places. lea __calculator(%pc),%a1 move.w %d0,(%a1)
avec:
.xdef __calculator .even __calculator: .word -1
Mets ce code au début de ton programme (et la variable en un endroit approprié), puis:
tst.w __calculator ;beq TI-89, bne TI-92+/V200
cmp.w #1,__calculator ;beq TI-92+
cmp.w #3,__calculator ;beq V200
