12-07-2004, 02:12 AM
The following code generates invalid ASM code when using FreeBASIC Compiler - Version 0.05b
The following errors are reported by the compiler:
Also, I noticed that it forced dword alignment on each element of the UDT. Can you either a) not do that by default or b) have a NoAlign option (per UDT)? ie:
For most things, this is not needed, but for communication buffers, it's is critical.
Code:
Type MyType
A as byte
B as integer
c as short
d as long
e as single
f as double
end type
dim X as MyType
dim Y(0 to 7) as integer
print x.a
print x.b
print x.c
print x.d
print x.e
print x.f
for x.a = 0 to 7
print y(x.a)
next x.a
The following errors are reported by the compiler:
Quote:E:\freeBASIC>fbc -v -r examples\vartest.bas
FreeBASIC Compiler - Version 0.05b
Copyright © 2004-2005 Andre Victor T. Vicentini (av1ctor@yahoo.com.br)
compiling: examples\vartest.bas -o examples\vartest.asm
assembling: --strip-local-absolute examples\vartest.asm -o examples\vartest.o
examples\vartest.asm: Assembler messages:
examples\vartest.asm:83: Error: suffix or operands invalid for `movsx'
examples\vartest.asm:84: Warning: using `%esi' instead of `%si' due to `l' suffix
examples\vartest.asm:93: Error: suffix or operands invalid for `movsx'
examples\vartest.asm:94: Warning: using `%esi' instead of `%si' due to `l' suffix
Also, I noticed that it forced dword alignment on each element of the UDT. Can you either a) not do that by default or b) have a NoAlign option (per UDT)? ie:
Code:
Type MyType NoAlign
A as byte
B as integer
c as short
d as long
e as single
f as double
end type
For most things, this is not needed, but for communication buffers, it's is critical.
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'