error with additional encoders in lc

Hi there …

I want to add some encoders to the lc-emulation but if I try to compile the new file I got the following message:

Executing: “C:\Programme\MPLAB IDE\MCHIP_Tools\mpasmwin.exe” /q /p18F452 “main.asm” /l"main.lst" /e"main.err"

Error[126] Â D:\REMOTECONTROL\MIOS\2_XT2_MIDIBOX_LC_V1_4\LC_SFB.INC 238 : Argument out of range (1027 not between -1024 and 1023)

Halting build on first failure as requested.

BUILD FAILED

my code in “enc.inc”:

USER_ENC_NotifyChange
 Â  Â  Â ;; if encoder number within 0 and 7, send a V-pot event
      movlw      0x07
 Â  Â  Â IFLEQ Â  Â  Â MIOS_PARAMETER1, ACCESS, rgoto LC_ENC_SendVPot

      movf      MIOS_PARAMETER1, W
 Â  Â  Â ;; if encoder number == 8, send jog-wheel event
      xorlw      0x08
      bz      LC_ENC_SendJogWheel
 Â  Â  Â 
 Â  Â  Â ;; if encoder number within 9 and 13, send NRPN-event
      movf      MIOS_PARAMETER1, W
      xorlw      0x09
 Â  Â  Â bz LC_ENC_SendNRPN
      movf      MIOS_PARAMETER1, W
      xorlw      0x0A
 Â  Â  Â bz LC_ENC_SendNRPN
      movf      MIOS_PARAMETER1, W
      xorlw      0x0B
 Â  Â  Â bz LC_ENC_SendNRPN
      movf      MIOS_PARAMETER1, W
      xorlw      0x0C
 Â  Â  Â bz LC_ENC_SendNRPN
 Â  Â  Â 
 Â  Â  Â ;; if encoder number > 13, send CC-event
      movlw      0x0D
 Â  Â  Â IFGEQ Â  Â  Â MIOS_PARAMETER1, ACCESS, rgoto LC_ENC_SendCC

 Â  Â  Â ;; else do nothing
 Â  Â  Â return

LC_ENC_SendNPRN and LC_SendCC are new subroutines to handle NRPN/CC - events.

Any idea wath’s wrong?

thnx Pearl

Hi,

Error[126]   D:\REMOTECONTROL\MIOS\2_XT2_MIDIBOX_LC_V1_4\LC_SFB.INC 238 : Argument out of range (1027 not between -1024 and 1023)

whats the code at this line?

Best Regards, Thorsten.

Hi TK …

Additional info :

  • LC_SFB.inc :  I don’t know exactly (got only the online-partition here) but it’s standard code from lc emulation (ver. 4) - no changes

  • if I left out 4 lines everything is ok … it seems that the pointer from the LC_SFB.inc  is 1023 or less.

  • I can reproduce this with left out 3 lines –> makes error “Argument out of range(1024 …)” and so on

  • the new subs LC_ENC_SendNPRN and LC_SendCC are empty at the moment ( only “return”)

p.s. If it is ok we can post in german till we found the solution. [it would be much easier to describe the problem ;-)]

Bye Pearl

I didn’t saw this imperfection since it’s already fixed in my private version.

Open lc_sfb.inc, go to line 238 and change “rcall” by “call”

Best Regards, Thorsten.

Hi TK …

I will try this today  :D

Thanx and Bye

Pearl

Hi …

It works :smiley:

Cooooool ;D

Bye

Pearl

Hi there …

Today I tried to update my LC - Application to Vers. 1.6 by copying all my personal modifications to the new source files, but after compiling, I got a similar error as in the past:

“Error[126]   E:\MIOS\SW\LC 1.6\LC_1_V1_6\MACROS.H 161 : Argument out of range (1044 not between -1024 and 1023)”

What’s the meaning of this error-message? And how can I solve this problem?

I didn’t changed anything in “Macros.h”!

Thanx and bye

Pearl

Hi Pearl,

another question: are you interested in beta-testing the C version - maybe it will be easier for you to add some modifications

Best Regards, Thorsten.

Hi TK …

I didn’t writing anything in C , but I got advanced skills VB/VB.Net .

So I think, I want to try the beta and will learning by doing.  :wink:

Another question to my problem: Are memory limits or limits of “branch” and “jumping” in assembler the reason?

My additional code is OK in “LC_1_5”. I work with my LC one year.

Thanx and bye

Pearl

Hi Pearl,

Another question to my problem: Are memory limits or limits of “branch” and “jumping” in assembler the reason?

Yes, there are limitations, which can easily be fixed.

E.g., if the error happens on a “rgoto” or “bra”, use “goto” instead

If the error happens on a “rcall”, use “call” instead

If it happens on a “bz” or “bnz”, use “skpnz/skpz” and “goto” or “rgoto” instead

Just take a look into the main.lst file and search for the error message, this should make clear where it exactly happens

Alpha version (not complete!) of C based MIDIbox LC can now be downloaded from this location:

http://www.ucapps.de/mios/midibox_lc_v2_0_alpha1.zip

Best Regards, Thorsten.

Hi,

I found the wrong line in main.lst and replaced “rgoto” with “goto” and now everything works fine. 

Thanx for your hint … :slight_smile: :wink:

Bye Paerl