-
I'm unhappy with the patch as a general solution.
While in the code I noticed that any types for array indexes other than "long" and "unsigned long" will be converted to "int". The patch changes this to convert to "long" instead which causes the multiplication to be done in a slower way.
eg.
push (long) 8192 on the stack
push (long) 4 on the stack
call the "multiply" routine...
2009-02-21 14:04:42 UTC by a1291762
-
For a binary with the patch applied, see:
http://ramsay.webhop.org/OnBoard/long_array_offsets.zip.
2009-02-21 13:48:28 UTC by a1291762
-
Here is a patch that makes this work. It causes array offsets to be treated as long values and needs a hack to get the assembler to produce the correct move.l (a0,d0.l) statement.
diff --git a/OnBoardC/Src/codegen.c b/OnBoardC/Src/codegen.c
index 823f06f..e2b0347 100644
--- a/OnBoardC/Src/codegen.c
+++ b/OnBoardC/Src/codegen.c
@@ -337,6 +337,12 @@ void emitOperand(Node *operand...
2009-02-21 13:39:13 UTC by a1291762
-
Since I was out and didn't have access to the OnBoardC code today I spent some time going over the assembly it produces. I used Code68Dis (an apparently unreleased 68k disassembler I got from John Wilund) to see what OnBoardC had generated for each of the two statements. I've commented what is going on (I used http://68k.hax.com/ to fill in my understanding of 68k assembler as I went).
value...
2009-02-21 11:14:22 UTC by a1291762
-
With UInt32 *arrayP,
arrayP[8192] accesses the wrong location in memory
*(arrayP+8192) accesses the correct location in memory
This looks like a limitation of the 68k system rather than OnBoardC per-se. OnBoardC generates the ASM code:
writeTokenToBuffer(Asm_LeftParen);
writeRegToBuffer(operand->reg);
writeTokenToBuffer(Asm_Comma);
writeRegToBuffer(operand->reg2);...
2009-02-21 02:09:47 UTC by a1291762
-
Using OS 4.1 on Palm M130 (in emulator)
Onboard C version 2.51
Doing
DateTimePtr dtP;
FrmAlert(GetsToHere);
TimSecondsToDateTime(TimGetSeconds(),dtP);
FrmAlert(NotGetToHere);
Nothing fancy as you can see
Code works on earlier OS versions fine but in OS 4.1
get emulator message
"...wrote to memory location 0x002635DC, which is in the
storage heap. In order to protect...
2008-07-19 08:10:45 UTC by nobody
-
This has been fixed in CVS.
2008-07-16 09:33:43 UTC by a1291762
-
a1291762 committed patchset 962 of module OnBoardC to the OnBoard C CVS repository, changing 1 files.
2008-07-16 09:31:19 UTC by a1291762
-
a1291762 committed patchset 961 of module OnBoardC to the OnBoard C CVS repository, changing 1 files.
2008-07-16 09:30:50 UTC by a1291762
-
a1291762 committed patchset 960 of module OnBoardC to the OnBoard C CVS repository, changing 1 files.
2008-07-16 09:27:52 UTC by a1291762