Groups | Search | Server Info | Login | Register


Groups > comp.sys.acorn.programmer > #6558

Re: Learning ARM machine code

From Alexander Ausserstorfer <bavariasound@chiemgau-net.de>
Newsgroups comp.sys.acorn.programmer
Subject Re: Learning ARM machine code
Date 2025-11-15 15:11 +0200
Organization None
Message-ID <5c7c29dce9bavariasound@chiemgau-net.de> (permalink)
References (3 earlier) <1026m5i$jcpt$4@solani.org> <iKm*CnCeA@news.chiark.greenend.org.uk> <5c2adc4465bavariasound@chiemgau-net.de> <5c2cea6fccbavariasound@chiemgau-net.de> <5c75805cc6bavariasound@chiemgau-net.de>

Show all headers | View raw


In article <5c75805cc6bavariasound@chiemgau-net.de>,
   Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
> In article <5c2cea6fccbavariasound@chiemgau-net.de>,
>    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:

> I discovered some interesting points. I will write about later here.

What I don't understand ist that: Bruce Smith wrotes in his book, that
the command

MOV PC, R14

will stop your programme and jump back to RISC OS.

In machine code, it has the value &E1A0 E00F.

This is okey.

But when I use the Acorn Assembler (DDE) to translate this command (MOV
PC, R14) to machine code (&E1A0 E00F) the result is much bigger as 4
bytes! You will geht this here:

8000 : E1A00000 : .. á : MOV     R0,R0
8004 : E1A00000 : .. á : MOV     R0,R0
8008 : E1A00000 : .. á : MOV     R0,R0
800C : EB00001B : ...ë : BL      &00008080
8010 : EF000011 : ...ï : SWI     OS_Exit
8014 : 00000080 : €... : ANDEQ   R0,R0,R0,LSL #1
8018 : 00000004 : .... : ANDEQ   R0,R0,R4
801C : 00000000 : .... : ANDEQ   R0,R0,R0
8020 : 00000000 : .... : ANDEQ   R0,R0,R0
8024 : 00000000 : .... : ANDEQ   R0,R0,R0
8028 : 00008000 : .€.. : ANDEQ   R8,R0,R0
802C : 00000000 : .... : ANDEQ   R0,R0,R0
8030 : 00000020 :  ... : ANDEQ   R0,R0,R0,LSR #32
8034 : 00000000 : .... : ANDEQ   R0,R0,R0
8038 : 00000000 : .... : ANDEQ   R0,R0,R0
803C : 00000000 : .... : ANDEQ   R0,R0,R0
8040 : E1A00000 : .. á : MOV     R0,R0
8044 : E04EC00F : .ÀNà : SUB     R12,R14,PC
8048 : E08FC00C : .À*à : ADD     R12,PC,R12
804C : E99C000F : ..?é : LDMIB   R12,{R0-R3}
8050 : E24CC010 : .ÀLâ : SUB     R12,R12,#&10       ; =16
8054 : E59C2030 : 0 ?å : LDR     R2,[R12,#48]
8058 : E3120C01 : ...ã : TST     R2,#&0100          ; =256
805C : 159CC034 : 4À?. : LDRNE   R12,[R12,#52]
8060 : 008CC000 : .À.... : ADDEQ   R12,R12,R0
8064 : E08CC001 : .À...à : ADD     R12,R12,R1
8068 : E3A00000 : .. ã : MOV     R0,#0
806C : E3530000 : ..Sã : CMP     R3,#0
8070 : D1A0F00E : .ð Ñ : MOVLE   PC,R14
8074 : E48C0004 : .....ä : STR     R0,[R12],#4
8078 : E2533004 : .0Sâ : SUBS    R3,R3,#4
807C : EAFFFFFB : ûÿÿê : B       &00008070
8080 : E1A0F00E : .ð á : MOV     PC,R14

The file has a size of 132 bytes for just ONE command! At &8080 you'll
find the command MOV PC, R14. Why is this happen?

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.

It is also a shame that I had never read about that in the GAG News and
that the editor seems to have no interests in this aspects of RISC OS.
He doesn't answered to any of my latest emails but writes pages about
things which don't belongs RISC OS like PHP or creating web pages.

A.

-- 
http://home.chiemgau-net.de/ausserstorfer/

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-04-12 15:11 +0200
  Re: Learning ARM machine code Harriet Bazley <harriet@bazleyfamily.co.uk> - 2025-04-13 18:27 +0100
    Re: Learning ARM machine code Jean-Michel <jmc.bruck@orange.fr> - 2025-04-14 11:40 +0200
  Re: Learning ARM machine code Theo <theom+news@chiark.greenend.org.uk> - 2025-04-14 17:56 +0100
    Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-06-07 17:08 +0200
      Re: Learning ARM machine code Sebastian Barthel <naitsabes@freenet.de> - 2025-06-09 13:04 +0000
        Re: Learning ARM machine code Theo <theom+news@chiark.greenend.org.uk> - 2025-06-09 17:36 +0100
          Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-06-10 18:11 +0200
            Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-06-14 17:58 +0200
              Re: Learning ARM machine code Martin <News03@avisoft.f9.co.uk> - 2025-06-14 17:54 +0100
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-06-19 06:31 +0200
                Re: Learning ARM machine code Martin <News03@avisoft.f9.co.uk> - 2025-06-19 10:09 +0100
                Re: Learning ARM machine code Jean-Michel <jmc.bruck@orange.fr> - 2025-06-19 11:32 +0200
              Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-11-02 16:42 +0200
                Re: Learning ARM machine code Martin <News03@avisoft.f9.co.uk> - 2025-11-02 17:01 +0000
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-11-15 14:55 +0200
                Re: Learning ARM machine code druck <news@druck.org.uk> - 2025-11-17 19:08 +0000
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-11-15 15:11 +0200
                Re: Learning ARM machine code Harriet Bazley <harriet@bazleyfamily.co.uk> - 2025-11-15 19:46 +0000
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-12-06 17:57 +0200
                Re: Learning ARM machine code Martin <News04@avisoft.f9.co.uk> - 2025-12-06 18:15 +0000
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-12-07 16:25 +0200
                Re: Learning ARM machine code Martin <News04@avisoft.f9.co.uk> - 2025-12-07 15:57 +0000
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-12-21 17:13 +0200
                Re: Learning ARM machine code druck <news@druck.org.uk> - 2025-12-22 20:02 +0000
                Re: Learning ARM machine code Paul Sprangers <Paul@sprie.nl> - 2025-12-22 23:32 +0100
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2026-01-06 14:42 +0200
                Re: Learning ARM machine code anonymouse <na@ignoreme.com> - 2026-01-06 15:02 +0000
                Re: Learning ARM machine code Jean-Michel <jmc.bruck@orange.fr> - 2025-12-08 10:23 +0100
                Re: Learning ARM machine code Harriet Bazley <harriet@bazleyfamily.co.uk> - 2025-12-06 20:06 +0000
                Re: Learning ARM machine code druck <news@druck.org.uk> - 2025-12-09 08:21 +0000
                Re: Learning ARM machine code Martin <News04@avisoft.f9.co.uk> - 2025-12-09 09:48 +0000
                Re: Learning ARM machine code Richard Ashbery <basura@invalid.addr.uk> - 2025-12-09 10:54 +0000
                Re: Learning ARM machine code Steve Fryatt <news@stevefryatt.org.uk> - 2025-11-15 23:46 +0000
                Re: Learning ARM machine code Theo <theom+news@chiark.greenend.org.uk> - 2025-11-16 11:59 +0000
                Re: Learning ARM machine code Alexander Ausserstorfer <bavariasound@chiemgau-net.de> - 2025-12-06 18:10 +0200
                Re: Learning ARM machine code Steve Fryatt <news@stevefryatt.org.uk> - 2025-12-07 12:18 +0000
          Re: Learning ARM machine code Sebastian Barthel <naitsabes@freenet.de> - 2025-06-10 18:37 +0000

csiph-web