Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/17/09 23:35
Read: times


 
#163549 - my application code is in C but bootloader in assembly 8051
Responding to: ???'s previous message
Erik Malund said:
... and saved a lot of hassle by writing the 'vector switch' in assembler, why on earth does that part HAVE to be in C?

Erik

Are you suggesting that I add the following code in assembly in my C program?

I will leave the bootloader code written in assembly 8051 as it is. I just want to point the ISRs in application code written in C to the right values. I need help pointing the application ISR addresses. Basically I need the "main subroutine" to start at 0x600,"external Interrupt 0" to start at 0x603 and so on.
What should I do in C to achieve that?





;-----------------------------------------------------------------------------
; reset and interrupt vector table in APPLICATION CODE STARTING AT 0x600
;-----------------------------------------------------------------------------

cseg at 600h
ljmp  main	
						
org 603h; External Interrupt 0 
reti            
org 60bh					
ljmp  timerr0_isr; timer0 overflow interrupt
org 613h
reti; External Interrupt 1
org 61bh 											;Timer 1 Overflow
reti;Timer 1 Overflow				
org 623h					
ljmp  uart0_isr; uart0 interrupt						
org 62bh            
ljmp  timer2_isr; timer2 overflow interrupt
org 633h ; SPI0
reti
org 63Bh
ljmp SMBus_ISR; SMBus Interrupt Vector
org 643h ; RESERVED
reti
org 64bh ; ADC0 Window Compare
reti
org 653h ; ADC0 Conversion Complete
reti
org 65bh ; Programmable Counter Array
reti
org 663h ; Comparator0
reti
org 66bh ; Comparator1
reti
org 673h
ljmp timer3_isr; timer3 overflow interrupt


 



List of 5 messages in thread
TopicAuthorDate
Bootloader code in C - ISR locations            01/01/70 00:00      
   I have done something similar .....            01/01/70 00:00      
      my application code is in C but bootloader in assembly 8051            01/01/70 00:00      
         modules            01/01/70 00:00      
            Thanks            01/01/70 00:00      

Back to Subject List