DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

SWI in $8D

Thread Tools
 
Search this Thread
 
Old 01-19-2005, 05:55 PM
  #1  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
SWI in $8D

I'm going through the execution of the AUJP and I come to a point at LB0EB that calls for software interrupt and the code just loops there until IT happens.

What is the trigger of this interrupt?
Is it cleared after 1 pass through the program?

If I trigger the interrupt manually in my simulator, I throw an error like it should not have been STILL there. I can't clear it soon enough or something.
I have a few guesses that maybe its the DRP counter that make the code continue but am not sure, something that is indicating a starting or running engine (I think).

;-----------------------------
; WAIT HERE FOR INTERUPT
; SWI VECTOR TO $6000
;-----------------------------
LB0EB: swi ; Force reset

Last edited by JP86SS; 01-19-2005 at 05:57 PM.
Old 01-20-2005, 05:01 PM
  #2  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
TTT

Anyone have any guesses?
The more far fetched, the better at this point.
Old 01-20-2005, 07:03 PM
  #3  
Member

 
HaulnA$$'s Avatar
 
Join Date: Jul 2003
Location: Dallas
Posts: 458
Received 2 Likes on 2 Posts
Re: TTT

Originally posted by JP86SS
Anyone have any guesses?
The more far fetched, the better at this point.
Maybe its waiting for a DRP. Just a guess but it makes sense to me. HTH
Old 01-20-2005, 08:32 PM
  #4  
Member
 
1981TTA's Avatar
 
Join Date: May 2004
Location: SE Michigan
Posts: 289
Likes: 0
Received 0 Likes on 0 Posts
Car: 81 Turbo Trans Am
Engine: 301 T
Transmission: 200-4R
The SWI call will force a reset of the ECM. The SWI call will move the PC to address $6000. The interrupt is "cleared" by the processor once the PC is changed. Assuming there's nothing at $6000 for the ECM to reference, it is an "Illegal Address". This interrupt is vectored to $B000 where it all starts over again.... While I don't know for certain, I'd imagine GM had some sort of hardware at $6000 to detect this this type of condition....?

If I'm reading the code correctly, you'll wind up at LB0EB when MALF 51 (bad PROM) is present. Unless you're in a test mode with that MALF, you'll just get resets over and over.
Old 01-20-2005, 09:16 PM
  #5  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
After looking into the instruction some more it seems that when this instruction is called, all ifo in the registers is pushed to the stack. The status bit is set is set and the vectored address is loaded into the program counter.
Like you stated, the $6000 is an illegal address call and forces the reset back to the begining.
I don't know why this was done, but that's what it is.
Thanks,
Old 01-21-2005, 12:12 AM
  #6  
Supreme Member

iTrader: (1)
 
junkcltr's Avatar
 
Join Date: Jan 2002
Location: garage
Posts: 4,432
Likes: 0
Received 1 Like on 1 Post
Engine: 3xx ci tubo
Transmission: 4L60E & 4L80E
I don't think that address $6000 is an illegal address. If the bus gets corrupt (illegal op-code) or the MCU executes the SWI instruction it transfers execution to address $6000.

I *think* that there is some mask ROM there with code for GM debugging (HU unit). If you are curious, you could read out the entire address space via the ALDL (mode 2 I think) and disassemble at address $6000 and beyond.

Anyway, back to your question. The MCU nevers gets to the SWI instruction UNLESS some went wrong in the initial factory test part of the code. If the A/Ds, checksum, etc went OK, then the MCU jumps around the SWI op-code. This is done at:

LB0CE: BRCLR L0003,#8,LB0EE ; Br if ERR 51 not set

error 51 is set if something goes wrong during the initial factory test.

J
Old 01-21-2005, 12:27 AM
  #7  
Supreme Member

iTrader: (1)
 
junkcltr's Avatar
 
Join Date: Jan 2002
Location: garage
Posts: 4,432
Likes: 0
Received 1 Like on 1 Post
Engine: 3xx ci tubo
Transmission: 4L60E & 4L80E
Re: SWI in $8D

Originally posted by JP86SS

If I trigger the interrupt manually in my simulator, I throw an error like it should not have been STILL there. I can't clear it soon enough or something.
You found a simulator for the GM 68HC11 hybrid??? Are you simulating on a PC? Or are "simulating" using an ECM on a bench?
Old 01-21-2005, 10:25 AM
  #8  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Simulating on the PC.
Its nice to see all registers and step through the code.
I'm using THRSim11 and another "Dos" Sim68 program.
Between the two there is some neat features to watch execution.
https://www.thirdgen.org/techbb2/sho...ight=SIMULATOR

This is the link to the thread about them.
Old 01-23-2005, 10:26 PM
  #9  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
I think I've figured out why the simulators do not work for this.

I do not have the ROM code from $6000 to $6FFF.
This maybe why I get stuck at the SWI.
The ROM code handles the interrupts.
Can anyone confirm my thoughts on this.

Has anyone dumped the ROM code on a 730?
Old 01-23-2005, 11:06 PM
  #10  
Member
 
1981TTA's Avatar
 
Join Date: May 2004
Location: SE Michigan
Posts: 289
Likes: 0
Received 0 Likes on 0 Posts
Car: 81 Turbo Trans Am
Engine: 301 T
Transmission: 200-4R
When my 7749 tries to access $6000, it does as I described earlier. I don't think there's any "code" at $6000 in the production version of the ECM. My guess is that this is like the $58xx calls seen in the $58 mask. During development, GM probably installs some hardware/software at that address to do "something".

According to the pink book (page 189), the ECU considers a $00 as an illegal opcode. (I know I incorrectly called this an "Illegal Address" before.) Maybe you could make sure $6000 has "00" instead of "FF"? The $00 should trigger the interrupt. $FF is an opcode for STX.

Last edited by 1981TTA; 01-23-2005 at 11:08 PM.
Old 02-03-2005, 06:16 PM
  #11  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,432
Likes: 0
Received 225 Likes on 211 Posts
Car: check
Engine: check
Transmission: check
What I discovered with the '730 ( and '749) is any access to the $6000 block will cause the ECM to reset. This access can even be a read. I ran into it back a ways while writing some new code. I forgot the '#' in front of the table label which caused the ECM to reset each time it accessed that table.

I figured it was something built into the ECM hardware.

RBob.
Old 02-04-2005, 08:11 PM
  #12  
Member
 
1981TTA's Avatar
 
Join Date: May 2004
Location: SE Michigan
Posts: 289
Likes: 0
Received 0 Likes on 0 Posts
Car: 81 Turbo Trans Am
Engine: 301 T
Transmission: 200-4R
Yep. Any time the MCU sees "$00" as an opcode, a jump to $6000 is only a few cycles away!

Maybe I've just missed this over time. But, I'd imagine there are a few other $XX values that would cause a similar situation...?? (I.e. no opcode assigne to the particular hex value....)
Old 02-04-2005, 09:36 PM
  #13  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Originally posted by junkcltr
The MCU nevers gets to the SWI instruction UNLESS some went wrong in the initial factory test part of the code. If the A/Ds, checksum, etc went OK, then the MCU jumps around the SWI op-code. This is done at:

LB0CE: BRCLR L0003,#8,LB0EE ; Br if ERR 51 not set

error 51 is set if something goes wrong during the initial factory test.

J
You hit that one on the head.
My checksum was not correct and I was getting 51 set.
I set the $AA as the mask and the swi never hit again.

Now I've gotten farther in the sequencs and have everything up to the ram refresh executing (seems to be ok)

This sequence was the original question that I had but thought the swi error was part of it.
The sequence refreshes the ram but never seems to have an exit.
Watching the registers and looking at the code, there is no way to exit the routine.
Theremust be an external trigger from an input (DRP maybe) that gets the code past this point.

I pasted the code here:
Code:
; -----------------------------------------------------------
; RAM Refresh Loop $01C2 to $0000
;
; Uses Index Reg X as Pointer Address
; $0121 - Location of Index Reg X Pointer Address
;
; Loads and stores a Double Byte from each RAM location from $01C2
; into Accumulator D.  The routine decrements the Index Reg X by
; two for the double bytes steps.  While loading and storing between
; Accumulator D and the Memory Location referenced by Index Reg X,
; all interupts are disabled.  After completing the load/store
; interrupts are re-enabled.
; -----------------------------------------------------------
              ldx     L0121                   ; RAM Loc
              beq     LB6D3                   ; Do RE-FRESH
LB6C6:        dex                                                                       ; CRef: $B6D1
              dex
LB6C8:        sei                             ; DISABLE INT'S WHILE RE-FRESH            ; CRef: $B6D6
              ldd     $00,x                   ; GET OLD DATA
              std     $00,x                   ; REFRESH LOCATION
              cli                             ; CLEAR & RESTORE INTERUPTS
              stx     L0121
              bne     LB6C6                   ; BR IF N/Z
                                              ; .... else
LB6D3:        ldx     #$01C2                  ; STACK OVER WRITE TEST ADDR              ; CRef: $B6C4
              bra     LB6C8                   ; BRANCH ALWAYS
;------------------------------------------------------------------------------------------
The code jumps in at LB6C6 and just keeps doing the routine.
Any comments?

Last edited by JP86SS; 02-04-2005 at 09:39 PM.
Old 02-05-2005, 04:56 AM
  #14  
Member
 
1981TTA's Avatar
 
Join Date: May 2004
Location: SE Michigan
Posts: 289
Likes: 0
Received 0 Likes on 0 Posts
Car: 81 Turbo Trans Am
Engine: 301 T
Transmission: 200-4R
Take a look at the value in $0121. This memory location contains the starting address. (Should be equal to $01C2 or $01C4.) RegX is loaded with this value initially. Then, it's decremented by 2 (since it's doing double byte reads/writes) each time through the loop. Once the value of RegX is zero, it bails. "BNE L6B6" is the exit point.

You are right that an interrupt may come along and get you out of this loop, too.....
Old 02-05-2005, 06:51 AM
  #15  
Moderator

iTrader: (1)
 
RBob's Avatar
 
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,432
Likes: 0
Received 225 Likes on 211 Posts
Car: check
Engine: check
Transmission: check
It is running until the IRQ1 interrupt occurs. This can happen from the 160Hz timer clock or the SCI serial (ALDL) status. At this point the RAM refresh is being executed after the minor loop (spark or fuel) and the selected major loop has run. There is nothing else to do until IRQ1 occurs.

RBob.
Old 02-05-2005, 07:55 AM
  #16  
Supreme Member

Thread Starter
iTrader: (1)
 
JP86SS's Avatar
 
Join Date: Apr 2004
Location: Browns Town
Posts: 3,178
Likes: 0
Received 3 Likes on 3 Posts
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
Thanks guys,
I figured it was some kind of interrupt but could not determine which one or what triggers it.
I'll keep looking into the loop timing and execution and figure out the whole sequence of events.
It will probably clear up future issues that are similar in nature.

Even if I can't get the simulator to fully execute in the end, Its turning out to be a really good learning tool for the instructions and execution.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Veaceonee
Car Audio
22
01-14-2024 05:51 PM
Lab Rat
Car Audio
2
06-24-2014 07:24 PM
formula_355
Electronics
2
05-21-2012 04:04 PM
86Red4+3
DIY PROM
1
08-29-2001 08:22 PM
MintGTA
Car Audio
7
06-27-2001 10:22 PM



Quick Reply: SWI in $8D



All times are GMT -5. The time now is 02:13 PM.