"bank not found" when inserting a chunk of ASM

General discussion on mikroPascal.
Post Reply
Author
Message
Moas
Posts: 25
Joined: 14 Apr 2009 19:50

"bank not found" when inserting a chunk of ASM

#1 Post by Moas » 28 Apr 2009 21:15

Hello,
I am now struggling with inserting an ASM chunk to the program. I know only the very basic from ASM (to be able to configure ports etc.) so I am trying to do my best - I received the ASM code from one experienced guy and now I am trying to make it run in Pascal.
Below you can find a start of a procedure I would like to use:

Code: Select all

Procedure Mereni;

var
STRIDAL,STRIDAH,COUNTL,COUNTH : byte; volatile;

Begin
 STRIDAL := 0;
 STRIDAH := 0;
 COUNTL := 0;
 COUNTH := 0;

 asm

  CLRF	  STRIDAL
  CLRF	  STRIDAH

  MOVLW   020h
  MOVWF	  COUNTL
  MOVLW   036h
  MOVWF	  COUNTH

  BCF	    3,2	

...code continues...

The problem is that when I try to compile this, I receive a message

Code: Select all

Linker error: STRIDAL: not found
Linker error: Bank not found: STRIDAL
Any idea what should I do? I know that there is some bank switching necessary for some memory areas of PIC (I use 16f84a) but here my knowledge ends. :(
Thanks to anyone for your help!

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

#2 Post by milan » 01 May 2009 17:15

Hi,

you must use asm name of the variable inside asm block.

Example for mikroPascal PRO for PIC:

Code: Select all

program test;

Procedure Mereni;
var STRIDAL : byte; volatile;
Begin
 STRIDAL := 0xFF;
 asm
  CLRF     Mereni_STRIDAL
 end;
 
end;

// main 
begin
   Mereni();
end.
If you want to see asm name of some variable, write some code,
compile, start simulator (F9), and find variable in Watch window.
SmartADAPT2 rules !

Moas
Posts: 25
Joined: 14 Apr 2009 19:50

#3 Post by Moas » 03 May 2009 18:58

milan wrote:you must use asm name of the variable inside asm block.
Thanks milan, this indeed works! :P

Post Reply

Return to “mikroPascal General”