Buenas que tal, trataba de compilar un ejemplo de código de Microchip específicamente el de la nota AN700 sobre un convertidor Delta-Sigma utilizando un comparador analógico, sin embargo, cuando lo copio a MPLAB no se ensambla, la verdad no se a que se deba aun soy principiante en ensamblador, aqui los errores:
Error[152] \DELTASIGMAADC\DELTASIG.ASM 11 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 12 : Executable code and data must be defined in an appropriate section
Message[302] \DELTASIGMAADC\DELTASIG.ASM 13 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[152] \DELTASIGMAADC\DELTASIG.ASM 13 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 14 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 15 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 16 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 17 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 18 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 21 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 22 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 23 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 24 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 25 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 26 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 27 : Labels must be defined in a code or data section when making an object file
Error[152] \DELTASIGMAADC\DELTASIG.ASM 28 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 29 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 29 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 30 : Labels must be defined in a code or data section when making an object file
Error[152] \DELTASIGMAADC\DELTASIG.ASM 31 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 32 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 33 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 34 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 34 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 35 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 36 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 36 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 37 : Labels must be defined in a code or data section when making an object file
Error[152] \DELTASIGMAADC\DELTASIG.ASM 38 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 39 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 40 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 40 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 41 : Labels must be defined in a code or data section when making an object file
Error[151] \DELTASIGMAADC\DELTASIG.ASM 42 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 42 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 43 : Labels must be defined in a code or data section when making an object file
Error[152] \DELTASIGMAADC\DELTASIG.ASM 44 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 45 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 45 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 46 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 47 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 48 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 49 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 50 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 50 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 51 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 51 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 52 : Labels must be defined in a code or data section when making an object file
Error[150] \DELTASIGMAADC\DELTASIG.ASM 53 : Labels must be defined in a code or data section when making an object file
Error[152] \DELTASIGMAADC\DELTASIG.ASM 53 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 54 : Executable code and data must be defined in an appropriate section
Error[151] \DELTASIGMAADC\DELTASIG.ASM 55 : Operand contains unresolvable labels or is too complex
Error[152] \DELTASIGMAADC\DELTASIG.ASM 55 : Executable code and data must be defined in an appropriate section
Error[150] \DELTASIGMAADC\DELTASIG.ASM 56 : Labels must be defined in a code or data section when making an object file
Error[152] \DELTASIGMAADC\DELTASIG.ASM 57 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 58 : Executable code and data must be defined in an appropriate section
Error[152] \DELTASIGMAADC\DELTASIG.ASM 59 : Executable code and data must be defined in an appropriate section
Halting build on first failure as requested.
Si alguien quiere consultar la nota original aqui esta el link:
https://ww1.microchip.com/downloads/en/Appnotes/00700a.pdfDesde ya gracias por la ayuda!
Aqui esta el codigo tal cual lo copie
;*********************************************************************
;* Filename: DeltaSig.asm
;*********************************************************************
;* Author: Dan Butler
;* Company: Microchip Technology Inc.
;* Revision: 1.00
;* Date: 02 December 1998
;* Assembled using MPASM V2.20
;*********************************************************************
;* Include Files:
;* p16C622.inc V1.01
;*********************************************************************
;* Provides two functions implementing the Delta Sigma A2D.
;* InitDeltaSigA2D sets up the voltage reference and comparator
;* in the "idle" state.
;* DeltaSigA2D runs the actual conversion. Results provided in
;* result_l and result_h.
;* See An700 figure 2 for external circuitry required.
;*********************************************************************
;* What's changed
;*
;* Date Description of change
;*
;*********************************************************************
#include <p16f628a.inc>
cblock
result_l
result_h
counter:2
endc
;
;
;
;InitDeltaSigA2D
bsf STATUS,RP0
movlw 0xEC
movwf VRCON
bcf PORTA,3 ;
bcf STATUS,RP0
movlw 0x06 ;
movwf CMCON
return
;
; Delta Sigma A2D
; The code below contains a lot of nops and goto next instruction. These
; are necessary to ensure that each pass through the loop takes the same
; amount of time, no matter the path through the code.
;DeltaSigA2D
clrf counter
clrf counter+1
clrf result_l
clrf result_h
movlw 0x03 ;
movwf CMCON
loop
btfsc CMCON,C1OUT ;
goto complow ;
comphigh
nop
bcf PORTA,3 ;
incfsz result_l,f ;
goto eat2cycles ;
incf result_h,f ;
goto endloop ;
complow
bsf PORTA,3 ;
nop ;
goto eat2cycles ;
eat2cycles
goto endloop ;
endloop
incfsz counter,f ;
goto eat5cycles ;
incf counter+1,f ;
movf counter+1,w ;
andlw 0x04 ;
btfsc STATUS,Z ;
goto loop ;
goto exit ;
eat5cycles
goto $+1 ;
nop ;
goto loop ;
exit
movlw 0x06 ;
movwf CMCON
return
end