Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Having troubles with compiling

Status
Not open for further replies.

psecody

Member
STATUS equ 03h
PORTA equ 05h
PORTB equ 06h
TRISA equ 85h
TRISB equ 86h
org 0x0000 ;org sets the origin, 0x0000 for the 16F628,

bsf STATUS, 5 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movwf TRISA ;set PortA all outputs
bcf STATUS, 5 ;select bank 0

Loop
movlw 0xff
movwf PORTA ;set all bits on
movwf PORTB
nop ;the nop's make up the time taken by the goto
nop ;giving a square wave output
movlw 0x00
movwf PORTA
movwf PORTB ;set all bits off
goto Loop ;go back and do it again

end

This is one of the codes I am just using to try and get the stupid thing to compile something, none of mine work after I use the MOVWF command. This is a modified version of one of Nigels codes off of his website, I figured it should work since its a tutorial but it won't even compile.

Heres the eror message:

MPLINK 4.11, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x0000001c
Errors : 1

Its something to do with the linking but I can't figure it out, if someone could tell me why it keeps returning this error it would be much appreciated.
 
The program has been assembled succesfully with MPASM. I've added the list and __config directives (you may change those settings)
 

Attachments

  • p1.asm
    613 bytes · Views: 130
Remove the linker file from your project and it will compile correctly.

Mike.
 
Thanks I appreciate the help. I'll probably have some more noob questions to ask after I start reading some more haha. Thanks again
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top