PDA

View Full Version : fatal: out of memory (pbpw.exe)



Sphere
- 21st August 2011, 11:57
I get this error when I compile this. fatal: out of memory (pbpw.exe)
My system has a 4 gig of memory.



high PORTB.2 'CHIP SELECT
shiftout PORTB.1,PORTB.0,0,[%00000001,10,%11111111,%10000001,%11111111,%111111 11,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000, %00000000,_
11,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,_
12,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,_
13,%11111111,%00000000,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,_
14,%11111111,%00000000,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,_
15,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,_
16,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,_
17,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,%00000001]
LOW PORTB.2 'CHIP SELECT



Any ideas. Sphere.:)

HenrikOlsson
- 21st August 2011, 12:59
Hi,
Splitting that major SHIFTOUT statement into multiple made it work here.

High PORTB.2 'CHIP SELECT
Shiftout PORTB.1,PORTB.0,0,[%00000001,10,%11111111,%10000001,%11111111,%111111 11,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000, %00000000]

Shiftout PortB.1,PortB.0,0,[11,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000]

Shiftout PortB.1,PortB.0,0,[12,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000]

Shiftout PortB.1,PortB.0,0,[13,%11111111,%00000000,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000]

Shiftout PortB.1,PortB.0,0,[14,%11111111,%00000000,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000]

Shiftout PortB.1,PortB.0,0,[15,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000]

Shiftout PortB.1,PortB.0,0,[16,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000]

Shiftout PortB.1,PortB.0,0,[17,%11111111,%00111100,%11111111,%11111111,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00,%00000000,%00000000,%00000000,%00000000,%000000 00, %00000000,%00000001]
LOW PORTB.2 'CHIP SELECT

Since there seems to be a lot of repeating zeros in each "packet" you might be able to replace that with a subroutine, something like:

i VAR BYTE
ZeroCount VAR BYTE

High PORTB.2 'CHIP SELECT

Shiftout PORTB.1,PORTB.0,0,[%00000001,10,%11111111,%10000001,%11111111,%111111 11]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[11,%11111111,%00111100,%11111111,%11111111]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[12,%11111111,%00111100,%11111111,%11111111]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[13,%11111111,%00000000,%11111111,%11111111]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[14,%11111111,%00000000,%11111111,%11111111]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[15,%11111111,%00111100,%11111111,%11111111]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[16,%11111111,%00111100,%11111111,%11111111]
ZeroCount = 46 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[17,%11111111,%00111100,%11111111,%11111111]
ZeroCount = 45 : GOSUB ShiftThoseZerosOut

Shiftout PortB.1,PortB.0,0,[%00000001]

LOW PORTB.2 'CHIP SELECT



ShiftThoseZerosOut:

For i = 1 to ZeroCount
shiftout PORTB.1,PORTB.0,0,[0]
NEXT
RETURN
I may not have the number of zeros correct but you get the idea, the size of the code shrunk to 1/4 in size.

/Henrik.

EDIT: I'm getting sick of this editor. Everything looks fine when i click Preview post then when I post it looks completely different and I have to go back and add linefeeds etc. And the code window that looked perfect in the preview, with horizontal scroll now looks like crap. Aaarg....what am I doing wrong.

Sphere
- 21st August 2011, 14:28
I already tried your solution and it works but I just wondered why you couldn't do it the way I posted. The reason why you see a lot of zeros in my code is that im testing a new glcd that is only line addressable so you have update the full width of the display + it also allows multi line updating of the display witch it what I posted. I was just trying to maximise the speed of the screen update.

Thanks for the reply Sphere.

HenrikOlsson
- 21st August 2011, 16:35
Hi,
Which PIC are you using? If it has a MSSP module you can use that to speed up the communcations conciderably. There's no commands available to use it, like with HSEROUT, but once it's setup it's pretty trivial. There's an example on MELABS site that shows you how to work it.

/Henrik.

Sphere
- 21st August 2011, 21:50
The pic im using is a PIC18LF46K22 and it does have an MSSP module. Just a question on using the MSSP in terms of speed, are we talking 2x 3x 4x speed increase. I can currently completely fill the screen in less than a second.

Sphere.

mister_e
- 21st August 2011, 22:05
If it's to output screen to a GLCD or whatever else, I would ever use multiple shiftout but a LookupTable (in the codespace OR EEPROM) + Shiftout Loop (or MSSP), way more code efficient, more flexible too.

Jerson
- 22nd August 2011, 02:28
I suspect this to be more of a compiler issue rather than anything to do with the code itself. I imagine some internal compiler table being overflowed that can cause this problem. I may be wrong.

mister_e
- 22nd August 2011, 02:46
Code Parser going to lalaland ;)

HenrikOlsson
- 22nd August 2011, 06:18
The pic im using is a PIC18LF46K22 and it does have an MSSP module. Just a question on using the MSSP in terms of speed, are we talking 2x 3x 4x speed increase. I can currently completely fill the screen in less than a second.
Hi, it's my understanding that SHIFTOUT runs at 50kHz with a 4MHz oscillator and then scales linearly with increased oscillator speed, but I'm not 100% sure on that. The MSSP module can run at Fosc/4 which at 4Mhz is 20 times faster than SHIFTOUT.

Now, the code must be able to keep up with the increased speed, and must be able to feed the MSSP module with data to shift out. Basically you have only 8 instructioncyles to get the next byte and then load it to the MSSP module as soon as there's room in its output register. If you're not able to do it in 8 cycles the overall thruput will drop - obviously.

So, just because the "clock" runs 20times fater than SHIFTOUT I don't think you should expect a 20 times increase, somewhere around 5-10 sounds more realistic.

/Henrik.

Sphere
- 22nd August 2011, 07:22
Thanks all for the replies. Now where's that darn lookup table gone.

Cheers Sphere.

mister_e
- 22nd August 2011, 09:06
something like that should give some hints


goto init
ASM
ifdef BSR
PIC_TYPE = 2 ; 2=PIC18
else
PIC_TYPE = 1 ; 1=PIC16
endif

;%00000001,10,%11111111,%10000001,%11111111,%11111 111,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000, %00000000]
tbl10 dt 1,10, b'11111111',b'10000001',b'11111111',b'11111111', 0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0

;11,%11111111,%00111100,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000]
tbl11 dt 11, b'11111111',b'00111100',b'11111111',b'11111111',0, 0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0

;12,%11111111,%00111100,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000]
tbl12 dt 12,b'11111111',b'00111100',b'11111111',b'11111111' , 0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0

;13,%11111111,%00000000,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000]
tbl13 dt 13, b'11111111',0,b'11111111',b'11111111',0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0

;14,%11111111,%00000000,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000]
tbl14 dt 14, b'11111111',0,b'11111111',b'11111111',0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0

;15,%11111111,%00111100,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000]
tbl15 dt 15, b'11111111',b'00111100',b'11111111',b'11111111',0, 0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0

;16,%11111111,%00111100,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000]
tbl16 dt 16, b'11111111',b'00111100',b'11111111',b'11111111',0, 0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0

;17,%11111111,%00111100,%11111111,%11111111,%00000 000,%00000000,%00000000,%00000000,%00000000,%00000 000,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000000,%00000000,%00000000,%00000000 ,%00000000,%00000000,%00000000,%00000000,%00000000 ,
;%00000000,%00000001]
tbl17 dt 17, b'11111111',b'00111100',b'11111111',b'11111111',0, 0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,0,0,0,0,0,0,0,0,0
dt 0,1

tblend = $ - PIC_TYPE

endasm
init:
PIC_TYPE CON EXT
tbl10 CON EXT
tbl11 CON EXT
tbl12 CON EXT
tbl13 CON EXT
tbl14 CON EXT
tbl15 CON EXT
tbl16 CON EXT
tbl17 CON EXT
tblend CON EXT
addr VAR WORD
dta VAR BYTE
cntr VAR BYTE

CLEAR
TRISC = 0
TRISB = 0
PAUSE 50

MAIN:
HIGH PORTB.2 'CHIP SELECT
FOR addr=tbl10 TO tblend STEP PIC_TYPE
READCODE addr, dta
SHIFTOUT portb.1, portb.0,0,[dta]
cntr=cntr+1
HSEROUT ["%",BIN8 dta,", "]
IF cntr=10 THEN
HSEROUT [13,10]
cntr=0
ENDIF
NEXT
LOW PORTB.2 'CHIP SELECT
HSEROUT [13,10,"----- done ------<", 13,10,_
dec ((tblend-tbl10)/PIC_TYPE), " Byte sent>"]

HERE: GOTO HERE
there's still room for improvement.