Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Also, something in your code and error output does not match: The linker complains about the symbol s2_putc, whereas you attempt to call __putc according to your code snippet. Is this actually the version of the code that produces the error?
In 32-bits mode, function arguments smaller than a doubleword are still stored as a doubleword, so "popw" will not work. Also, the value pushed last (and in this case, popped first) is the return address, not an argument. You should read up on calling conventions.
Also, something in your code and error output does not match: The linker complains about the symbol s2_putc, whereas you attempt to call __putc according to your code snippet. Is this actually the version of the code that produces the error?
Cheers,
Adam
I must be copied the older error message because I have changed the name to s2_putc for test... ...The new error message is as same as older one except function name.
Hobbes wrote:In 32-bits mode, function arguments smaller than a doubleword are still stored as a doubleword, so "popw" will not work. Also, the value pushed last (and in this case, popped first) is the return address, not an argument. You should read up on calling conventions.
Thanks, I will try it.
Another thing is that The apple gcc can not compile it because it can not recognize such symbol like .2byte(I compile those code with Linux before).
Unknown pseudo-op: .2byte
Do it needs something like 'int', 'double'?