Closed tehKaiN closed 4 years ago
For registers, have a look at https://github.com/BartmanAbyss/vscode-amiga-debug/blob/master/bin/opt/m68k-amiga-elf/sys-include/inline/macros.h That's how it's done for the AmigaOS interface. You should be able to adapt from there. Otherwise the default calling convention is to just push all arguments on the stack. For __far, I think that's not needed. I have used pointers to custom registers without it.
So I see there are only some wrappers which put regs into certain registers and call os functions using inline asm, but there's no way to declare a function which has params bound to registers - e.g. for declaring OS-friendly interrupt handler. That's a bit of bummer, but should suffice for now since I'm taking over os anyway.
I'll revise my __far usage, perhaps I'm unnecessarily using it, but I think I've added that for a reason which I don't remember right now. Should've done some comments inside code. ;)
Anyway, that's all I need to know right now. Thanks for your reply and for all work on this extension!
I'm maintaining game engine/framework/library/whatever as seen here https://github.com/AmigaPorts/ACE . I use some low level stuff in my code via macros in a way that is compatible with Bebbo's GCC, (kinda) VBCC and x86 (logic only).
For example putting function args in registers:
which is used like:
Unfortunately GNUC variant syntax doesn't work with your compiler. In fact I tried some variations and I wasn't able to make it run. Also __far:
I've tried putting that __far everywhere but it didn't work. What's the correct syntax in both cases?