OK, so the subroutine would look like this:
Code:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
; Routine to enable Electric Water Pump when engine not running
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9000 1D 00 01 bclr 0, X, #%00000001 ; Disable WP (X already set to $1800)
9003 B6 01 28 ldaA L0128 ; Load A/D Ignition Voltage
9006 81 30 cmpA #$30 ; Compare to 48
9008 23 0A bls @1 ; Bra to return if Ign Voltage <= 4.8V (Ignition off)
900A B6 01 92 ldaA l_0192_CoolTmp_fltrd_$f0 ; Load Coolant Temp
900D 81 B9 cmpA #$B9 ; Compare temp to 99 deg C
900F 23 03 bls @1 ; Bra to return if Temp <= threshold
9011 1C 00 01 bset 0, X, #%00000001 ; Enable WP (X already set to $1800)
9014 7E 49 44 @1 jmp L4944
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And:
Code:
4935 CE 18 00 ldX #$1800
4938 12 23 80 05 brset L0023, #%10000000, @7
493C 7E 90 00 jmp L9000 ; jump to new subroutine
493F 20 03 jr @8
;
4941 1C 00 01 @7 bset 0, X, #%00000001
Now I just need 23 bytes of program memory to add my subroutine. Kur4o, can you point me at some usable address?
[EDIT] I've found E-side 0x9000 - 0x93FF marked as free memory in EEXtra.xdf, so I guess the subroutine goes to 0x9000 :)
Bookmarks