asm problem

Robert Spanton rob@xgoat.com
Sat Feb 15 13:51:00 GMT 2003


Firstly, the function main should return an integer and return one. And 
secondly, doesn't the asm statement requre the assembly statement to be 
in quotes, i.e. "int $0x19" ?


> anantaneja@fastmail.fm wrote:
>
>> i wrote a program :
>>
>> void main()
>> {
>> asm (int $0x19);
>> }
>>
>> compiled and linked with
>> g++ <filename>
>>
>> and ran a.out to get
>> Segmentation Fault(<somethin here i dont remember>)
>
> Your a.out must be from some other source file.
>
> nathan@garibaldi:12>g++ foo.c
> foo.c:2: `main' must return `int'
> foo.c:2: return type for `main' changed to `int'
> foo.c: In function `int main(...)':
> foo.c:3: parse error before `int'
> foo.c:3: stray '$' in program
>
> nathan
>




More information about the Gcc-help mailing list