Skip to content

Step 3 of 11

LIST, CONFIG, and interrupt vectors

Goal

Write the file base: CONFIG, reset at 0x0000, and vectors at 0x0008 (08H) and 0x0018 (18H).

Vectors are fixed addresses the PIC jumps to on interrupt. They go at the top of the file, after CONFIG — like reset at ORG 0x0000.

For now isr_alta and isr_baja only have RETFIE (return without doing anything). Later steps fill isr_alta with Timer0 logic.

  1. Open guia-interrupciones.asm and paste Your file so far (LIST, #include, CONFIG, vectors, ISR stubs, inicio, bucle, END).
  2. Check there are three ORG lines: 0x0000, 0x0008, and 0x0018.
  3. Build — must say BUILD SUCCESSFUL.
  4. LED does not blink yet; we only verify structure.
						        LIST    P=18F4550
        #include <P18F4550.INC>

        CONFIG  FOSC = HS
        CONFIG  WDT = OFF
        CONFIG  LVP = OFF
        CONFIG  PBADEN = OFF

        ORG     0x0000
        GOTO    inicio

        ORG     0x0008            ; vector alta (tambien ORG 08H)
        GOTO    isr_alta

        ORG     0x0018            ; vector baja (tambien ORG 18H)
        GOTO    isr_baja

; --- variables en RAM ---
        CBLOCK  0x20
temp_w
temp_status
        ENDC

; --- subrutinas ---
init_gpio:
        RETURN

init_timer0:
        RETURN

isr_alta:
        RETFIE

isr_baja:
        RETFIE

; --- programa principal ---
inicio:
        CALL    init_gpio
        CALL    init_timer0
bucle:
        GOTO    bucle

        END
					
						        ORG     0x0000
        GOTO    inicio

        ORG     0x0008            ; alta prioridad (tambien ORG 08H)
        GOTO    isr_alta

        ORG     0x0018            ; baja prioridad (tambien ORG 18H)
        GOTO    isr_baja
					
  • I have ORG 0x0000, 0x0008, and 0x0018 with GOTO to their labels.
  • `isr_alta` and `isr_baja` exist with at least RETFIE.
  • Builds with no errors.

Tip: `ORG 08H` and `ORG 0x0008` are the same address — the course uses both notations.