Code: Select all
Dim cnt As Byte
cnt = 8
Repeat
Dec(cnt)
Until cnt = 0
Moderators: David Barker, Jerry Messina
Code: Select all
Dim cnt As Byte
cnt = 8
Repeat
Dec(cnt)
Until cnt = 0
Perhaps you could post or email the code that is causing the problem. At least then I could give an explanation as to why this might be happening and hopefully suggest some workarounds...I was having fun until I ran out of room with the RAM limit rather quickly in a relatively small program that used an 11 character string, a single long integer, and a couple bytes...
Code: Select all
cnt = 8
REPEAT
inc(LATB)
UNTIL dec(cnt) = 0
Code: Select all
cnt = 8
DO
inc(LATB)
LOOP UNTIL dec(cnt) = 0
Code: Select all
cnt = 8
Repeat
Inc(LATB)
ASM
decfsz cnt, 1, 0
End ASM
Until 1=2
Code: Select all
M0_U08 EQU 25
It was my mistake. I got confused with the array and string dimensioning. The is what I did that caused the problem:David Barker wrote:Perhaps you could post or email the code that is causing the problem. At least then I could give an explanation as to why this might be happening and hopefully suggest some workarounds...
Code: Select all
dim target(11) as string
Code: Select all
dim target as string(11)
I can understand these being difficult at first. Obviously, some means of 'name mangling' is required, as Swordfish is highly scoped and the same names can appear in different places. For example, 'Index' as a local variable, parameter or at the module level. It's made slightly more difficult in that modules can share the same function names. For example, USART.Write and LCD.Write. In addition, subs and functions can be overloaded. The Swordfish approach is just one of a few possibilities, designed primarily to support debugging in the future. However, here is how the variable in question decodes...There must be a reason but I find the assembler variable naming conventions hard to track relative to the source code...except these are killing me.....
Code: Select all
I0_F1_000005 ; L#MK CNT = 8
MOVLW 8
MOVWF M0_U08,0
Code: Select all
MOVLW 8
MOVWF M0_U08,0
It was my mistake. I got confused with the array and string dimensioning.
Code: Select all
dim target(11) as string
Code: Select all
dim target(11) as string(24)