Groups | Search | Server Info | Keyboard shortcuts | Login | Register
| From | Jonathan Lamothe <jonathan@jlamothe.net> |
|---|---|
| Newsgroups | comp.lang.c, alt.lang.asm |
| Subject | Re: A thought of C |
| Date | 2026-04-15 10:51 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <87ldeoz38r.fsf@posteo.de> (permalink) |
| References | <3a3462bdd72c4ed9d392a78b7d369a7b5ccc3b04.camel@gmail.com> <10ro4gm$vh0m$1@dont-email.me> |
Cross-posted to 2 groups.
makendo <makendo@makendo.invalid> writes: >> The 4th difference: Local variable. >> (Assembly can theoritically do the same but I don't have impression which one >> support this feature.) > > If you are talking about function-local data, there are multiple ways > to do store them in an easy-to-clean-up fashion: > > - Volatile registers, for the shortest lived data. Calling other > functions causes them to be overwritten with the function's > return value or irrelevant data. > - Non-volatile registers, for data that need to persist across > function calls. You save the contents of them before using them, > as your caller expects the contents of these registers to be > intact once you return. > - The stack, for long-lived function-local data when you are out of > non-volatile registers. You manipulate a dedicated stack pointer > register to allocate and deallocate space for your data. > - Immediates, and the .rodata (ELF) / .rdata (PE) section, for > constants and tables of constants. > > The notion of local variable allows you to ignore all of these in C, > though. Assembly having multiple ways to store local data instead of > one can make things fairly complicated to read, write and debug. > > (forwarding to alt.lang.asm because you are comparing C with it) > So what you're saying is that assembly can do anything that any other arbitrary language (that has to eventually compile down to the same machine code) can do? This should not be surprising to anyone. -- Regards, Jonathan Lamothe https://jlamothe.net
Back to alt.lang.asm | Previous | Next — Previous in thread | Next in thread | Find similar
Re: A thought of C makendo <makendo@makendo.invalid> - 2026-04-15 21:40 +0800
Re: A thought of C Jonathan Lamothe <jonathan@jlamothe.net> - 2026-04-15 10:51 -0400
Re: A thought of C makendo <makendo@makendo.invalid> - 2026-04-16 12:44 +0800
Re: A thought of C wij <wyniijj5@gmail.com> - 2026-04-16 01:10 +0800
Re: A thought of C 🇵🇱Jacek Marcin Jaworski🇵🇱 <jmj@energokod.gda.pl> - 2026-04-15 20:23 +0200
Re: A thought of C "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-04-15 21:01 +0100
Re: A thought of C 🇵🇱Jacek Marcin Jaworski🇵🇱 <jmj@energokod.gda.pl> - 2026-04-15 22:40 +0200
Re: A thought of C "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-04-16 11:38 +0100
Re: A thought of C "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-04-30 11:31 +0100
Re: A thought of C Rosario19 <Ros@invalid.invalid> - 2026-04-19 10:03 +0200
csiph-web