PDA

View Full Version : Ladybug code



TurboBuggy
05-23-2007, 10:27 PM
Ok ive been digging through the ladybug code and learning how things work slowly, everything I know (or think I know) about ASM ive learned through ladybug so im pretty new at this.

I was hoping someone on here could answer a couple questions :o

how do I control outputs? At first I though you just set the bit or cleared the bit for the corresponding output but that doesnt seem to work. Whats the difference between PIA1_PortA_Buffer and PIA1_PortA_ControlRegister?

so say I want to energize the purge solenoid, how would I go about doing that without calling the "TurnOnCannisterPurging" function


what do these do -> anda, bita, ora?

ive seen each used in a situation like this


ldab SwitchPortAccessReg ; load b with memory contents
andb #swp_PNswitch ; -10000000-





also I posted this on moparchem but no response

Ok the staging mod is pretty cool and effective but its very erratic on my car and I think its because it just has one set point in use. I attempted to modify the code to shutdown the engine at StagingModHigh and restart at StagingModLow and my ASM knowledge is very limited so I wanted you guys to look at what I came up with and point out any flaws

heres what I came up with


.if UseStagingMod
; **************************
; Staging Mod by Geoff Allan

asld ; shift left (d=d*2)
ldab SwitchPortAccessReg ; load b with memory contents
andb #swp_PNswitch ; -10000000-
beq AboveStagingSpeed ; branch if equal (park/grounded)
cmpa #StagingModSpeed ; Compare speed with activation speed
bcc AboveStagingSpeed ; branch if greater or equal

brclr *BitFlags_54, #b54_Stagingdown, L1893 ; branch if bit(s) clear
ldx #REVLMTX_StagingModLow ; load index with value
ldd DistributorFallingEdgePulsewidth ; load d (a&b) with memory contents
subd 0x00,x
bcs ShutOffEngineForThisRotation ; branch if lower
bclr *BitFlags_54, #b54_Stagingdown ; clear bit

L1893: ldx #REVLMTX_StagingModHigh ; load index with value
ldd DistributorFallingEdgePulsewidth ; load d (a&b) with memory contents
subd 0x00,x
bhi 1894 ; skip shutdown if Staging High > RPM
bset *BitFlags_54, #b54_Stagingdown ; set bit
bra ShutOffEngineForThisRotation ; branch

L1894: ldd VehicleSpeed_W ; load d (a&b) with memory contents
asld ; shift left (d=d*2)
asld ; shift left (d=d*2)

AboveStagingSpeed:
; **************************
.endif


I believe "BitFlags_54" could be modified to include


b54_Stagingdown = $%00000011 ;

am I correct?



any input is appreciated ;)

TurboBuggy
05-24-2007, 10:15 PM
anybody?