4 ms·
> I don't have to specify clobber registers, So how does the compiler know that these are clobbered then ?
by fluffything 6y ago
> I don't have to specify clobber registers,
So how does the compiler know that these are clobbered then ?
- masklinn 6y agoI expect the entire assembly is encoded into the language.
- int_19h 6y agoThat doesn't really help - the compiler doesn't know what could be clobbered by any given (sys)call.
- livre 6y agoNot really, the other reply is right. Most registers are clobbered. FreeBASIC only passes the asm code inside the asm block directly to GAS (using the .intel_syntax noprefix directive). As I said, the compiler is too dumb to figure out what registers are being used so as a safety measure it clobbers almost all of them (see Register Preservation here[1]). [1] https://documentation.help/FreeBASIC/KeyPgAsm.html https://documentation.help/FreeBASIC/KeyPgAsm.html
- cesarb 6y agoSince the parent comment said "just pushes and pops all important regs", it probably assumes that all registers are clobbered.