@Aaron:
Quote: "Your statement annoys me greatly"
You mean
cat's statement.
(That comment was 'sposed to make you laugh - hope it didn't annoy you further :s )
Seriously though, saw your post on my email this morning and I was "Huh???" coz it basically implied one of the earliest things I learned was wrong (implying I shouldn't trust stuff I learn on the internet - as if the internet would lie). So I decided to actually investigate further (If someone challenges something I learned or was taught I will always re-evaluate it and do my best to find out if there is something wrong with the information because dogmatism only gets in the way of learning). Btw, I do agree about the general lack of optimization in DBPro. I was just saying that I was under the impression that optimization didn't necessarily always mean compact code. You see I didn't really take cache into account because modern processors boast relatively large cache sizes but I do see your point there and it's a very valid one. I was only thinking of the processing of instructions. So, for example, jumping back and forth may slow things down as apposed to just repeating the process on a linear fashion.
Repeating the same code block:
DBPro:
FOR i = 1 TO 1000
a = a + 5
a = a + 5
a = a + 5
a = a + 5
a = a + 5
a = a + 5
a = a + 5
a = a + 5
a = a + 5
a = a + 5
NEXT i
END
ASM Output:
######CODE:
0 PUSH REGISTERS ; PUSH REGISTERS
0 MOV MEM4 ESP @$_ESP_ ; STORE STACK IN MEM
1 LINE : R i = 1 TO 10000
1 MOV EAX IMM4 , 1
1 SUB EAX IMM4 , 1
1 MOV MEM4 EAX @i ; SUB
1 MOV MEM IMM4 @$_SLN_, 1
1 MOV EAX MEM4 @$_ERR_
1 CMP EAX4 0
1 JNE $labelend ; CALL Normal Runtime Error Hook
1 MOV EAX MEM4 @i
1 ADD EAX IMM4 , 1
1 MOV MEM4 EAX @i ; ADD
1 MOV MEM IMM4 @$_SLN_, 1
1 MOV EAX MEM4 @$_ERR_
1 CMP EAX4 0
1 JNE $labelend ; CALL Normal Runtime Error Hook
1 MOV EAX IMM4 , 10000
1 PUSH EAX
1 MOV EAX MEM4 @i
1 MOV EBX EAX4
1 POP EDX
1 MOV EAX IMM4 0
1 CMP EDX EBX4
1 SETLE EAX
1 MOV MEM4 EAX @$L3 ; LESSEQUAL
1 MOV EAX MEM4 @$L3
1 CMP EAX4 0 ; CONDITION COMPARE
1 JE $label1[12] ; JUMP IF EQUAL
2 LINE : a , a + 5
2 MOV EAX MEM4 @a
2 ADD EAX IMM4 , 5
2 MOV MEM4 EAX @$L0 ; ADD
2 MOV EAX MEM4 @$L0
2 MOV MEM4 EAX @a ; ASSIGN X TO X
2 MOV MEM IMM4 @$_SLN_, 2
2 MOV EAX MEM4 @$_ERR_
2 CMP EAX4 0
2 JNE $labelend ; CALL Normal Runtime Error Hook
3 LINE : a , a + 5
3 MOV EAX MEM4 @a
3 ADD EAX IMM4 , 5
3 MOV MEM4 EAX @$L0 ; ADD
3 MOV EAX MEM4 @$L0
3 MOV MEM4 EAX @a ; ASSIGN X TO X
3 MOV MEM IMM4 @$_SLN_, 3
3 MOV EAX MEM4 @$_ERR_
3 CMP EAX4 0
3 JNE $labelend ; CALL Normal Runtime Error Hook
4 LINE : a , a + 5
4 MOV EAX MEM4 @a
4 ADD EAX IMM4 , 5
4 MOV MEM4 EAX @$L0 ; ADD
4 MOV EAX MEM4 @$L0
4 MOV MEM4 EAX @a ; ASSIGN X TO X
4 MOV MEM IMM4 @$_SLN_, 4
4 MOV EAX MEM4 @$_ERR_
4 CMP EAX4 0
4 JNE $labelend ; CALL Normal Runtime Error Hook
5 LINE : a , a + 5
5 MOV EAX MEM4 @a
5 ADD EAX IMM4 , 5
5 MOV MEM4 EAX @$L0 ; ADD
5 MOV EAX MEM4 @$L0
5 MOV MEM4 EAX @a ; ASSIGN X TO X
5 MOV MEM IMM4 @$_SLN_, 5
5 MOV EAX MEM4 @$_ERR_
5 CMP EAX4 0
5 JNE $labelend ; CALL Normal Runtime Error Hook
6 LINE : a , a + 5
6 MOV EAX MEM4 @a
6 ADD EAX IMM4 , 5
6 MOV MEM4 EAX @$L0 ; ADD
6 MOV EAX MEM4 @$L0
6 MOV MEM4 EAX @a ; ASSIGN X TO X
6 MOV MEM IMM4 @$_SLN_, 6
6 MOV EAX MEM4 @$_ERR_
6 CMP EAX4 0
6 JNE $labelend ; CALL Normal Runtime Error Hook
7 LINE : a , a + 5
7 MOV EAX MEM4 @a
7 ADD EAX IMM4 , 5
7 MOV MEM4 EAX @$L0 ; ADD
7 MOV EAX MEM4 @$L0
7 MOV MEM4 EAX @a ; ASSIGN X TO X
7 MOV MEM IMM4 @$_SLN_, 7
7 MOV EAX MEM4 @$_ERR_
7 CMP EAX4 0
7 JNE $labelend ; CALL Normal Runtime Error Hook
8 LINE : a , a + 5
8 MOV EAX MEM4 @a
8 ADD EAX IMM4 , 5
8 MOV MEM4 EAX @$L0 ; ADD
8 MOV EAX MEM4 @$L0
8 MOV MEM4 EAX @a ; ASSIGN X TO X
8 MOV MEM IMM4 @$_SLN_, 8
8 MOV EAX MEM4 @$_ERR_
8 CMP EAX4 0
8 JNE $labelend ; CALL Normal Runtime Error Hook
9 LINE : a , a + 5
9 MOV EAX MEM4 @a
9 ADD EAX IMM4 , 5
9 MOV MEM4 EAX @$L0 ; ADD
9 MOV EAX MEM4 @$L0
9 MOV MEM4 EAX @a ; ASSIGN X TO X
9 MOV MEM IMM4 @$_SLN_, 9
9 MOV EAX MEM4 @$_ERR_
9 CMP EAX4 0
9 JNE $labelend ; CALL Normal Runtime Error Hook
10 LINE : a , a + 5
10 MOV EAX MEM4 @a
10 ADD EAX IMM4 , 5
10 MOV MEM4 EAX @$L0 ; ADD
10 MOV EAX MEM4 @$L0
10 MOV MEM4 EAX @a ; ASSIGN X TO X
10 MOV MEM IMM4 @$_SLN_, 10
10 MOV EAX MEM4 @$_ERR_
10 CMP EAX4 0
10 JNE $labelend ; CALL Normal Runtime Error Hook
11 LINE : a , a + 5
11 MOV EAX MEM4 @a
11 ADD EAX IMM4 , 5
11 MOV MEM4 EAX @$L0 ; ADD
11 MOV EAX MEM4 @$L0
11 MOV MEM4 EAX @a ; ASSIGN X TO X
11 MOV MEM IMM4 @$_SLN_, 11
11 MOV EAX MEM4 @$_ERR_
11 CMP EAX4 0
11 JNE $labelend ; CALL Normal Runtime Error Hook
12 JMP $label0[1] ; DIRECT JUMP
1 MOV MEM IMM4 @$_SLN_, 1
1 MOV EAX MEM4 @$_ERR_
1 CMP EAX4 0
1 JNE $labelend ; CALL Normal Runtime Error Hook
12 LINE : NEXT i
13 LINE : END
13 JMP $labelend ; DIRECT JUMP
13 MOV MEM IMM4 @$_SLN_, 13
13 MOV EAX MEM4 @$_ERR_
13 CMP EAX4 0
13 JNE $labelend ; CALL Normal Runtime Error Hook
13 MOV EAX MEM4 @$_REK_
13 CMP EAX4 0
13 JNE LEAP
13 MOV EBX IMM4 [1
13 CALL EBX ; CALL [dbprocore.dll ,?Quit@@YAKXZ
13 MOV ESP MEM4 @$_ESP_ ; RESTORE STACK FROM MEM
13 POP REGISTERS ; POP REGISTERS
13 RET ; RETURN
VARIABLES:
@$_ESP_=0 [STRUCT@dword]
@$_ERR_=4 [STRUCT@dword]
@$_ESC_=8 [STRUCT@dword]
@$_REK_=12 [STRUCT@dword]
@$_SLN_=16 [STRUCT@dword]
@$_TEMPA_=20 [STRUCT@dword]
@$_TEMPB_=24 [STRUCT@dword]
@$L0=28 [STRUCT@integer]
@$L1=32 [STRUCT@integer]
@$L2=36 [STRUCT@integer]
@$L3=40 [STRUCT@integer]
@a=44 [STRUCT@integer]
@i=48 [STRUCT@integer]
SIZE OF VARIABLE BUFFER = 52
DLLS:
>>1=dbprocore.dll
COMMANDS:
>>1=1,?Quit@@YAKXZ
LABELS:
$label0[1] code:1 data:0 byte:48
$label1[12] code:12 data:0 byte:675
$labelend code:13 data:0 byte:706
DEBUG:
STRUCT@integer Overall Size:4
STRUCT@float Overall Size:4
STRUCT@string Overall Size:4
STRUCT@boolean Overall Size:1
STRUCT@byte Overall Size:1
STRUCT@word Overall Size:2
STRUCT@dword Overall Size:4
STRUCT@double float Overall Size:8
STRUCT@double integer Overall Size:8
STRUCT@label Overall Size:4
STRUCT@dabel Overall Size:4
STRUCT@integer array Overall Size:4
STRUCT@float array Overall Size:4
STRUCT@string array Overall Size:4
STRUCT@boolean array Overall Size:4
STRUCT@byte array Overall Size:4
STRUCT@word array Overall Size:4
STRUCT@dword array Overall Size:4
STRUCT@double float array Overall Size:4
STRUCT@double integer array Overall Size:4
STRUCT@anytype non casted Overall Size:4
STRUCT@userdefined var ptr Overall Size:4
STRUCT@userdefined array ptr Overall Size:4
Using a Function called multiple times:
DBPro:
FOR i = 1 TO 10000
a = AddThis(a, 5)
NEXT i
END
FUNCTION AddThis(x, y)
INC x, y
ENDFUNCTION x
ASM Output:
######CODE:
0 PUSH REGISTERS ; PUSH REGISTERS
0 MOV MEM4 ESP @$_ESP_ ; STORE STACK IN MEM
1 LINE : R i = 1 TO 10000
1 MOV EAX IMM4 , 1
1 SUB EAX IMM4 , 1
1 MOV MEM4 EAX @i ; SUB
1 MOV MEM IMM4 @$_SLN_, 1
1 MOV EAX MEM4 @$_ERR_
1 CMP EAX4 0
1 JNE $labelend ; CALL Normal Runtime Error Hook
1 MOV EAX MEM4 @i
1 ADD EAX IMM4 , 1
1 MOV MEM4 EAX @i ; ADD
1 MOV MEM IMM4 @$_SLN_, 1
1 MOV EAX MEM4 @$_ERR_
1 CMP EAX4 0
1 JNE $labelend ; CALL Normal Runtime Error Hook
1 MOV EAX IMM4 , 10000
1 PUSH EAX
1 MOV EAX MEM4 @i
1 MOV EBX EAX4
1 POP EDX
1 MOV EAX IMM4 0
1 CMP EDX EBX4
1 SETLE EAX
1 MOV MEM4 EAX @$L3 ; LESSEQUAL
1 MOV EAX MEM4 @$L3
1 CMP EAX4 0 ; CONDITION COMPARE
1 JE $label1[3] ; JUMP IF EQUAL
2 LINE : a , AddThis(a, 5)
2 MOV EAX IMM4 , 5
2 PUSH EAX ; PUSH TO STACK
2 MOV EAX MEM4 @a
2 PUSH EAX ; PUSH TO STACK
2 CALL MEM $label AddThis ; DIRECT SUBCALL
2 ADD ESP 8 ; ADD ESP
2 MOV MEM4 EAX @$L2 ; ASSIGN EAX TO X
2 MOV MEM IMM4 @$_SLN_, 2
2 MOV EAX MEM4 @$_ERR_
2 CMP EAX4 0
2 JNE $labelend ; CALL Normal Runtime Error Hook
2 MOV EAX MEM4 @$L2
2 MOV MEM4 EAX @a ; ASSIGN X TO X
2 MOV MEM IMM4 @$_SLN_, 2
2 MOV EAX MEM4 @$_ERR_
2 CMP EAX4 0
2 JNE $labelend ; CALL Normal Runtime Error Hook
3 JMP $label0[1] ; DIRECT JUMP
1 MOV MEM IMM4 @$_SLN_, 1
1 MOV EAX MEM4 @$_ERR_
1 CMP EAX4 0
1 JNE $labelend ; CALL Normal Runtime Error Hook
3 LINE : NEXT i
4 LINE : END
4 JMP $labelend ; DIRECT JUMP
4 MOV MEM IMM4 @$_SLN_, 4
4 MOV EAX MEM4 @$_ERR_
4 CMP EAX4 0
4 JNE $labelend ; CALL Normal Runtime Error Hook
5 LINE :
6 LINE :
7 LINE : FUNCTION AddThis(x, y)
7 MOV EBX IMM4 [1
7 CALL EBX ; CALL [dbprocore.dll ,?EarlyEnd@@YAXXZ
7 JMP $labelend ; DIRECT JUMP
7 MOV MEM IMM4 @$_SLN_, 7
7 MOV EAX MEM4 @$_ERR_
7 CMP EAX4 0
7 JNE $labelend ; CALL Normal Runtime Error Hook
7 PUSH EBP ; PUSH EBP
7 MOV EBP ESP ; MOV EBP ESP
7 SUB ESP 16 ; SUB ESP
7 MOV EAX ESP
7 MOV ECX IMM4 1
7 MOV SIB[EAX:ECX*4],IMM4 , 0
7 LOOP ECX , -9 ; CLEAR STACK
8 LINE : INC x, y
8 MOV EAX4 [EBP+A] 12
8 PUSH EAX
8 MOV EAX4 [EBP+A] 8
8 POP EBX
8 ADD EAX EBX4
8 MOV [EBP+A] EAX4 8 ; ADD
8 MOV MEM IMM4 @$_SLN_, 8
8 MOV EAX MEM4 @$_ERR_
8 CMP EAX4 0
8 JNE $labelend ; CALL Normal Runtime Error Hook
9 MOV EAX4 [EBP+A] 8 ; ASSIGN X TO EAX
9 MOV ESP EBP ; MOV ESP EBP
9 POP EBP ; POP EBP
9 RET ; RETURN
9 LINE : ENDFUNCTION x
9 MOV EAX MEM4 @$_REK_
9 CMP EAX4 0
9 JNE LEAP
9 MOV EBX IMM4 [2
9 CALL EBX ; CALL [dbprocore.dll ,?Quit@@YAKXZ
9 MOV ESP MEM4 @$_ESP_ ; RESTORE STACK FROM MEM
9 POP REGISTERS ; POP REGISTERS
9 RET ; RETURN
VARIABLES:
@$_ESP_=0 [STRUCT@dword]
@$_ERR_=4 [STRUCT@dword]
@$_ESC_=8 [STRUCT@dword]
@$_REK_=12 [STRUCT@dword]
@$_SLN_=16 [STRUCT@dword]
@$_TEMPA_=20 [STRUCT@dword]
@$_TEMPB_=24 [STRUCT@dword]
@$L0=28 [STRUCT@integer]
@$L1=32 [STRUCT@integer]
@$L2=36 [STRUCT@integer]
@$L3=40 [STRUCT@integer]
@$L4=44 [STRUCT@integer]
@a=48 [STRUCT@integer]
@i=52 [STRUCT@integer]
SIZE OF VARIABLE BUFFER = 56
DLLS:
>>1=dbprocore.dll
COMMANDS:
>>1=1,?EarlyEnd@@YAXXZ
>>2=1,?Quit@@YAKXZ
LABELS:
$label AddThis code:7 data:0 byte:324
$label0[1] code:1 data:0 byte:48
$label1[3] code:3 data:0 byte:255
$labelend code:9 data:0 byte:407
DEBUG:
STRUCT@integer Overall Size:4
STRUCT@float Overall Size:4
STRUCT@string Overall Size:4
STRUCT@boolean Overall Size:1
STRUCT@byte Overall Size:1
STRUCT@word Overall Size:2
STRUCT@dword Overall Size:4
STRUCT@double float Overall Size:8
STRUCT@double integer Overall Size:8
STRUCT@label Overall Size:4
STRUCT@dabel Overall Size:4
STRUCT@integer array Overall Size:4
STRUCT@float array Overall Size:4
STRUCT@string array Overall Size:4
STRUCT@boolean array Overall Size:4
STRUCT@byte array Overall Size:4
STRUCT@word array Overall Size:4
STRUCT@dword array Overall Size:4
STRUCT@double float array Overall Size:4
STRUCT@double integer array Overall Size:4
STRUCT@anytype non casted Overall Size:4
STRUCT@userdefined var ptr Overall Size:4
STRUCT@userdefined array ptr Overall Size:4
FS@AddThis Overall Size:12 Parameter Count:3
STRUCT@returnvalue TYPE>integer OFFSET>0
STRUCT@x TYPE>integer OFFSET>4
STRUCT@y TYPE>integer OFFSET>8
The code containing less lines actually takes longer while the greter number of lines processes quicker. If I missed something, then I'm sorry. Please excuse my lack of full knowledge here but I started learning ASM many moons ago and got sidetracked (the tutorial isn't even on my machine anymore, lol) and never picked up where I left off. It's possible (more than 'just') that I'm missing something (like maybe one of the dbprocore dll functions being called is slowing it down??). If that's the case then please lemme know I've messed up as I do need to know if something I
think I know isn't what it appears to be.
Quote: "How to Improve the DBPro Compiler
DBPro to C; compile with clang. Output will be more optimal. Everything will still work. It'd be more cross-platform (e.g., 64-bit Intel, ARM, etc) ready. All of the DLL loading and stuff could still work because it's all automated by the source language."
I fully agree. In fact when you (I'm sure it was you who mentioned it on another thread I read recently) mentioned the idea the first time around I was really excited about the prospects of such a compiler as it would negate the need for a 64-bit version of DBPro (a pie-in-the-sky thought I had a while back) and allow infinite flexibility. This is actually WHY I WANTED THE OPTION TO KEEP UNCALLED FUNCTIONS in the ouput source - TO BUILD DLLs IN DBPRO

Can you imagine how fun that would be *grins maniacally* (For the record I have an obsession with trying to make things do what they shouldn't do. I'm strange that way. Example: Vegetable peeler = cheese slicer - for real). Well, this is all based on the hypothetical compiler of course but still. So basically that's what I meant by the comment (I did say "future uses"). Sorry, I perhaps should have clarified myself - or rather the cat should have.
On the note of tools vs creativity, I'm afraid I have to stick with Jeku on that one. I still believe that it's about 30% tools, 70% developer - within reason of course. I mean somebody without a creative bone in their body can't produce anything but generic rubbish, regardless of their software. Okay, if they're using professional tools it'll be pretty polished generic rubbish but generic rubbish nonetheless.
Hopefully nothing in my post annoys you this time

and I promise I'll have a word with the cat about making posts on my behalf. In fact I'll even noob slap the cat as I have given him a warning about posting on my other accounts already.
Anyway, here's to hoping Lee gives the go-ahead on this new compiler idea of yours

as I think it's an excellent idea.