Subj : Re: Inline Assembler bug with structs of certain size To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Thu Dec 02 2004 03:53 pm Ed Mulroy [TeamB] wrote: >When I built to compile via assembly it seemed to >handle the code generation well. When I built without >that, I saw the same thing you reported, the second >function's assembly mov instruction was not generated. With 3.1, it wouldn't compile at all (unless compile-to-asm) It just doesn't like arrays of that size. added an additional char[1] to struct1, and it complained. > >F:\Projects\lookat\q408>ques408 >length of asm_test1 = 8 >&TestStruct1 = 0b70, via asm = 1441 >length of asm_test2 = 5 >&TestStruct2 = 594a, via asm = 1441 This line is wrong for you: >> printf("&TestStruct1 = %04x, via asm = %04x\n", &TestStruct1, asm_test1()); Try > printf("&TestStruct1 = %4p, via asm = %p\n", &TestStruct1, asm_test1()); At least, on my machine, it pushes ds:address for &TestStruct1 and cs:value for asm_test1(). The %p properly uses the 16bit address instead of the original 4 and 4 (ignoring the second parameter) .