Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Steve Fryatt Newsgroups: comp.sys.acorn.programmer Subject: Re: Learning ARM machine code Date: Sat, 15 Nov 2025 23:46:36 +0000 Organization: A noiseless patient Spider Lines: 25 Message-ID: References: <5c0c6984e5bavariasound@chiemgau-net.de> <5c294aefcbbavariasound@chiemgau-net.de> <1026m5i$jcpt$4@solani.org> <5c2adc4465bavariasound@chiemgau-net.de> <5c2cea6fccbavariasound@chiemgau-net.de> <5c75805cc6bavariasound@chiemgau-net.de> <5c7c29dce9bavariasound@chiemgau-net.de> Content-Type: text/plain; charset=us-ascii Injection-Date: Sat, 15 Nov 2025 23:55:03 +0000 (UTC) Injection-Info: dont-email.me; posting-host="9370e5dca6071f6bc22c8466a4ccf15d"; logging-data="4030599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aMvymcClJ8jtoUUCeYXV/QtwE1JDhZCY=" User-Agent: Messenger-Pro/2.73.6.4252 (Qt/5.15.13) (Linux-x86_64) Cancel-Lock: sha1:SK7J2DlvMT6H5KH4mcUJ/O0Jx1A= Xref: csiph.com comp.sys.acorn.programmer:6560 On 15 Nov, Alexander Ausserstorfer wrote in message <5c7c29dce9bavariasound@chiemgau-net.de>: > And if I use the GCC to convert the command MOV PC, R14 to machine code, > the result is not a file type of Absolute but of ELF and it has a file > size of huge blowy shit! 784 bytes for just ONE command! I don't > understand that. Because an ELF file isn't just the code itself: it's a structured file that can contain more data. So somewhere in there will be the 4 bytes of the MOV command, plus a header to tell the ELF loader where in memory to put that command when it loads the file. And other infrastructure needed to allow the file to do things like initialise separate blocks of memory, or load other chunks of assembled commands, linkable blocks like libraries, and so on. We moved on from doing *Save and *Load many years ago, because it's not that flexible and forces too many assumptions about the file contents to be made. See https://en.wikipedia.org/wiki/Executable_and_Linkable_Format for details. -- Steve Fryatt - Leeds, England http://www.stevefryatt.org.uk/