Autor Tema: error 150  (Leído 2132 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado alan18a

  • PIC10
  • *
  • Mensajes: 3
error 150
« en: 15 de Junio de 2018, 03:59:58 »
Buenas tardes la verdad no se por que se me presentan estos errores, es una practica de mi escula, pero por mas que intento ver el error nadamas no lo encuentro, se aprecia mucho su ayuda.


   LIST P=16F887 ;microcontrolador a utilizar
   #include <p16F887.inc>
   cblock 025
;-----------------------------   
   dato
   dato1
   TEMP
   
   endc
   
;----------------------------
INICIO
      movlw    07H
      movwf    dato
      incf    dato,1
      movlw    0F1H
      movwf    dato1
      movf    dato1,0
      movwf    TEMP
      decf    TEMP,1
       goto    INICIO

   
   end   





-----------------------------------
Error[150]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 12 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 13 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 14 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 15 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 16 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 17 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 18 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 19 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 20 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 21 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\PRINC_000\DESKTOP\NUEVA CARPETA\P3\P3.ASM 21 : Executable code and data must be defined in an appropriate section
Halting build on first failure as requested.

Desconectado planeta9999

  • Moderadores
  • DsPIC30
  • *****
  • Mensajes: 3520
    • Pinballsp
Re:error 150
« Respuesta #1 en: 15 de Junio de 2018, 04:26:13 »
 
No publiques el mismo mensajes dos veces, eso no va a hacer que recibas más ayuda.

Lo mío no es el ensamblador, pero los mensajes de error del compilador, te lo están diciendo bien claro. El primer error hace referencia a una ubicación incorrecta de la etiqueta, y el resto de errores probablemente derivan del primero al trastocar la ubicación de todo.




Prueba así, y fíjate donde deben de ir colocadas las etiquetas en el fuente. Aparte lo tienes todo bastante desordenado y sin documentar, mala costumbre.

Código: ASM
  1. ;*****************************************
  2. ;*** Test en ensamblador con PIC16F887 ***
  3. ;*****************************************
  4.         #include <p16F887.inc>
  5.         LIST P=16F887
  6.  
  7. ;** Definición variables
  8.         cblock 025
  9.         dato
  10.         dato1
  11.         TEMP
  12.         endc
  13.        
  14. ;*****************************************
  15. ;***** Programa principal  ***************
  16. ;*****************************************
  17. INICIO  movlw   07H
  18.         movwf   dato
  19.         incf    dato,1
  20.         movlw   0F1H
  21.         movwf   dato1
  22.         movf    dato1,0
  23.         movwf   TEMP
  24.         decf    TEMP,1
  25.         goto    INICIO
  26.  
  27.         end    
  28. ;*****************************************
  29. ;*****************************************



Mírate el tutorial de programación en ensamblador, para PIC, de Mikroe, es bastante completo.
https://www.mikroe.com/ebooks/pic-microcontrollers-programming-in-assembly/introduction

En concreto el apéndice A, que trata sobre la sintaxis.
https://www.mikroe.com/ebooks/pic-microcontrollers-programming-in-assembly/appendix-a-programming-a-microcontroller




« Última modificación: 15 de Junio de 2018, 06:56:42 por planeta9999 »

Desconectado KILLERJC

  • Colaborador
  • DsPIC33
  • *****
  • Mensajes: 8242
Re:error 150
« Respuesta #2 en: 15 de Junio de 2018, 08:28:55 »
Lo que te esta faltando ademas de lo que te paso planeta es un ORG 0x00 antes de INICIO