построить вот эти два исходника на asm (лежат в примерах MPLAB)
Example2.asm
Код
;
; File: Example2.asm
; This is the second file in the MPASM assembler/MPLINK linker example
; Use with Example.asm
;
list p=16f84a
#include p16f84a.inc
extern main, service; These routines are in Example.asm
STARTUP CODE ; This area is defined in 16f84a.lkr,
; the linker script
goto main; Jump to main code defined in Example.asm
nop ; Pad out so interrupt
nop ; service routine gets
nop ; put at address 0x0004.
goto service ; Points to interrupt service routine
end
; File: Example2.asm
; This is the second file in the MPASM assembler/MPLINK linker example
; Use with Example.asm
;
list p=16f84a
#include p16f84a.inc
extern main, service; These routines are in Example.asm
STARTUP CODE ; This area is defined in 16f84a.lkr,
; the linker script
goto main; Jump to main code defined in Example.asm
nop ; Pad out so interrupt
nop ; service routine gets
nop ; put at address 0x0004.
goto service ; Points to interrupt service routine
end
Example.asm
Код
list p=16f84a
#include p16f84a.inc
PROG CODE
main ; Min code entry called from Example2.asm
global main; Define as global so can be used in Example2.asm
nop; Main does nothing -- Put your code here
goto main; Our sample "main" is just an infinite loop
service ; Interrupt routine, called from Example2.asm
global service; Define as global so can be used in Example2.asm
nop; Interrupt code would go here
nop
retfie
IDLOCS CODE; ID location data, address is in 16f84a.lkr
dw 0x0102
dw 0x0304
CONFIG CODE; Set config bits from defines in p16f84a.inc
; Config address for device programmer is in 16f84a.lkr
dw _LP_OSC & _PWRTE_OFF & _WDT_OFF & _CP_OFF
end
#include p16f84a.inc
PROG CODE
main ; Min code entry called from Example2.asm
global main; Define as global so can be used in Example2.asm
nop; Main does nothing -- Put your code here
goto main; Our sample "main" is just an infinite loop
service ; Interrupt routine, called from Example2.asm
global service; Define as global so can be used in Example2.asm
nop; Interrupt code would go here
nop
retfie
IDLOCS CODE; ID location data, address is in 16f84a.lkr
dw 0x0102
dw 0x0304
CONFIG CODE; Set config bits from defines in p16f84a.inc
; Config address for device programmer is in 16f84a.lkr
dw _LP_OSC & _PWRTE_OFF & _WDT_OFF & _CP_OFF
end
и получаю ошибки:
Warning[205] C:\PICC950\MY_SRC\ZXC2\EXAMPLE.ASM 22 : Found directive in column 1. (CONFIG)
Error[176] C:\PICC950\MY_SRC\ZXC2\EXAMPLE.ASM 22 : CONFIG Directive Error: (processor "16F84A" is invalid for CONFIG directive)
вопрос - как мне сообщить транслятору mpasm, что CONFIG - это не директива, а метка (обьявлена в p16f84a.inc)?
Пробел перед конфигом, избавляет от Warning[205] но не от Error[176]