TODOPIC
Microcontroladores PIC => Almacén del Assembler => Mensaje iniciado por: JoseLuis2801 en 29 de Septiembre de 2011, 07:58:55
-
Hola, a ver si alguine me puede ayudar, una subrutina de pausa.:
; SUBRUTINA PAUSA 2 NIVELES
Cont1 EQU 20h
Cont2 EQU 21h
Sigui EQU 100h
; CODIGO RESET
ORG 00h
CALL Pausa
GOTO Sigui
ORG 05h
Pausa CLRF Cont1
CLRF Cont2
Bucle DECFSZ Cont1
GOTO Bucle
DECFSZ Cont2
GOTO Bucle
Return
Sigui end
Y cuando ensambla, me da un mensaje de error:
----------------------------------------------------------------------
Debug build of project `C:\Users\Jose Luis\Desktop\PROYECTOS\SPAUSA2.mcp' started.
Language tool versions: MPASMWIN.exe v5.42, mplink.exe v4.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu Sep 29 12:45:32 2011
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F886 "SPAUSA2.asm" /l"SPAUSA2.lst" /e"SPAUSA2.err" /d__DEBUG=1
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 5 : Found label after column 1. (Cont1)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 6 : Found label after column 1. (Cont2)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 7 : Found label after column 1. (Sigui)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 21 : Found label after column 1. (Pausa)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 26 : Found label after column 1. (Bucle)
Message[305] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 26 : Using default destination of 1 (file).
Message[305] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 28 : Using default destination of 1 (file).
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 32 : Found label after column 1. (Sigui)
Error[121] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 32 : Illegal label (Sigui)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Users\Jose Luis\Desktop\PROYECTOS\SPAUSA2.mcp' failed.
Language tool versions: MPASMWIN.exe v5.42, mplink.exe v4.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu Sep 29 12:45:38 2011
----------------------------------------------------------------------
BUILD FAILED
------------------------
No entiendo porque es ilegal la etiqueta Sigui
Gracias.
Un saludo
-
Creo que es porque la tienes duplicada, ya que al principio declaras una posición de memoria para registro propio y luego, al final, llamas de la misma forma a una etiqueta.
Una pregunta, porqué separas tanto los dos primeros registros del ultimo ? los dos primeros a 0x20h y 0x21h y el ultimo 0100h
saludos
-
Perdona, es que como soy novato, no lo tenía claro, y queria que la rutina empezase desde la dirección 100h. Empieza a partir de la 5h por el ORG 5h claro.
MIra ya la he quitado:
;
Cont1 EQU 20h
Cont2 EQU 21h
; CODIGO RESET
ORG 00h
CALL Pausa
GOTO Sigui
ORG 05h
; SUBRUTINA PAUSA 2 NIVELES
Pausa CLRF Cont1
CLRF Cont2
Bucle DECFSZ Cont1
GOTO Bucle
DECFSZ Cont2
GOTO Bucle
Return
Sigui end
Y al ensamblar, el mensaje me da 2 errorres:
----------------------------------------------------------------------
Debug build of project `C:\Users\Jose Luis\Desktop\PROYECTOS\pausa.mcp' started.
Language tool versions: MPASMWIN.exe v5.42, mplink.exe v4.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu Sep 29 15:33:41 2011
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F886 "SPAUSA2.asm" /l"SPAUSA2.lst" /e"SPAUSA2.err" /d__DEBUG=1
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 5 : Found label after column 1. (Cont1)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 6 : Found label after column 1. (Cont2)
Error[113] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 15 : Symbol not previously defined (Sigui)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 23 : Found label after column 1. (Pausa)
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 28 : Found label after column 1. (Bucle)
Message[305] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 28 : Using default destination of 1 (file).
Message[305] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 30 : Using default destination of 1 (file).
Warning[207] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 34 : Found label after column 1. (Sigui)
Error[121] C:\USERS\JOSE LUIS\DESKTOP\PROYECTOS\SPAUSA2.ASM 34 : Illegal label (Sigui)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Users\Jose Luis\Desktop\PROYECTOS\pausa.mcp' failed.
Language tool versions: MPASMWIN.exe v5.42, mplink.exe v4.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu Sep 29 15:33:44 2011
----------------------------------------------------------------------
BUILD FAILED
GRacias compi
Un saludo
-
El "end" como finalización del programa no debe ir con una etiqueta. Si no tiene que hacer nada más pon en la linea de la etiqueta Sigui un nop (que es un paso que no hace "nada" especifico) y luego en la siguiente linea el end.
Es decir:
Sigui nop
end
Salud
-
Si señor , perfecto ahora.
Ya he visto que NOP lo único que hace es consumir 1 ciclo de instrucción..
Muchas gracias
Un saludo