• Learning ARM machine code

    From Alexander Ausserstorfer@21:1/5 to All on Sat Apr 12 15:11:13 2025
    In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von Bruce
    Smith I'M missing the links to the ARM machine code. I want to see the
    commands in hex or binary values and want to be able to calculate it by
    myself.

    Is there another book or anything else you can recommend?

    Thanks,

    A.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harriet Bazley@21:1/5 to Alexander Ausserstorfer on Sun Apr 13 18:27:26 2025
    On 12 Apr 2025 as I do recall,
    Alexander Ausserstorfer wrote:

    In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von Bruce Smith I'M missing the links to the ARM machine code. I want to see the commands in hex or binary values and want to be able to calculate it by myself.

    Is there another book or anything else you can recommend?

    StrongED can disassemble ARM code instructions for you in Dump mode, so technically speaking you can use the BBC BASIC built-in assembler (I
    assume the Bruce Smith book gives instructions for that?), save out the
    area of memory into which you have assembled your code, and inspect it
    in StrongED in order to see the hex values.

    If you look inside !Textseek.Resources you will find the file 'detoken',
    for example, which is just raw machine code that gets loaded and
    executed by the BASIC !RunImage. It doesn't have any kind of executable
    header or anything, so you can load that directly into Dump mode and
    select the ASM button to ask StrongED to interpret it as assembly
    language, which will display the assembler instructions in one column
    and the raw hex values (and ASCII equivalents) in another. The 0101
    button will do the same, but displaying the raw values as binary rather
    than hex.

    e.g.
    0000001C : E92D5FFE : ____ : STMDB R13!,{R1-R12,R14}
    00000020 : E24FC024 : ____ : ADR R12,&00000004 ; ADR -> &00000004 00000024 : E28E704C : ____ : ADD R7,R14,#&4C ; ="L"
    00000028 : E58C7010 : ____ : STR R7,[R12,#16]
    0000002C : E1A0E00C : ____ : MOV R14,R12
    00000030 : E59E0004 : ____ : LDR R0,[R14,#4]
    00000034 : E5900000 : ____ : LDR R0,[R0,#0]
    00000038 : E280C001 : ____ : ADD R12,R0,#1
    0000003C : E08CA002 : ____ : ADD R10,R12,R2
    00000040 : E59E0014 : ____ : LDR R0,[R14,#20]
    00000044 : E590B000 : ____ : LDR R11,[R0,#0]
    00000048 : E28BB001 : ____ : ADD R11,R11,#1
    0000004C : E1A0600B : ____ : MOV R6,R11

    (upper-bit-set characters in the third column blanked out in case it
    messes up the formatting)


    --
    Harriet Bazley == Loyaulte me lie ==

    The attacker must vanquish; the defender need only survive.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jean-Michel@21:1/5 to Harriet Bazley on Mon Apr 14 11:40:48 2025
    In message <56b9040d5c.harriet@bazleyfamily.co.uk>
    Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:

    On 12 Apr 2025 as I do recall,
    Alexander Ausserstorfer wrote:

    In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von Bruce
    Smith I'M missing the links to the ARM machine code. I want to see the
    commands in hex or binary values and want to be able to calculate it by
    myself.

    Is there another book or anything else you can recommend?

    StrongED can disassemble ARM code instructions for you in Dump mode, so technically speaking you can use the BBC BASIC built-in assembler (I
    assume the Bruce Smith book gives instructions for that?), save out the
    area of memory into which you have assembled your code, and inspect it
    in StrongED in order to see the hex values.

    If you look inside !Textseek.Resources you will find the file 'detoken',
    for example, which is just raw machine code that gets loaded and
    executed by the BASIC !RunImage. It doesn't have any kind of executable header or anything, so you can load that directly into Dump mode and
    select the ASM button to ask StrongED to interpret it as assembly
    language, which will display the assembler instructions in one column
    and the raw hex values (and ASCII equivalents) in another. The 0101
    button will do the same, but displaying the raw values as binary rather
    than hex.

    e.g.
    0000001C : E92D5FFE : ____ : STMDB R13!,{R1-R12,R14}
    00000020 : E24FC024 : ____ : ADR R12,&00000004 ; ADR -> &00000004 00000024 : E28E704C : ____ : ADD R7,R14,#&4C ; ="L"
    00000028 : E58C7010 : ____ : STR R7,[R12,#16]
    0000002C : E1A0E00C : ____ : MOV R14,R12
    00000030 : E59E0004 : ____ : LDR R0,[R14,#4]
    00000034 : E5900000 : ____ : LDR R0,[R0,#0]
    00000038 : E280C001 : ____ : ADD R12,R0,#1
    0000003C : E08CA002 : ____ : ADD R10,R12,R2
    00000040 : E59E0014 : ____ : LDR R0,[R14,#20]
    00000044 : E590B000 : ____ : LDR R11,[R0,#0]
    00000048 : E28BB001 : ____ : ADD R11,R11,#1
    0000004C : E1A0600B : ____ : MOV R6,R11

    (upper-bit-set characters in the third column blanked out in case it
    messes up the formatting)
    It's a good method!
    I have :
    Mike Ginns Archimedes Assembly Language (Dab Press) 1988.
    and Alex & Nic VAN SOMEREN Archimdes Operating System (Dab Press) 1991.

    If you use the BBC Basic Built-in assembly as mentioned above, you add
    lines to your program to see the content of the memory and using the
    Memory command obtain a code in assembler.
    For example after NEXT pass
    PRINT
    PRINT "PGM words content"
    size% = 40
    FOR i%= 0 TO size% STEP 4
    PRINT "adress% ";~(code% + i%) SPC(5)"content: " ~code%!i%
    NEXT
    PRINT
    PRINT "PGM words content an disassembled code"
    comd$ = "memoryi " + STR$~code% + " " + STR$~(code% + size%)
    OSCLI comd$
    To test...



    --
    Jean-Michel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to Alexander Ausserstorfer on Mon Apr 14 17:56:41 2025
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von Bruce Smith I'M missing the links to the ARM machine code. I want to see the commands in hex or binary values and want to be able to calculate it by myself.

    Is there another book or anything else you can recommend?

    Arm has documentation of the A32 instruction encoding, starting from the
    most significant bits and drilling your way down: https://developer.arm.com/documentation/ddi0597/2025-03/A32-Instructions-by-Encoding

    Going the other way, if you start at the top level of that manual and work
    down by instruction type: https://developer.arm.com/documentation/ddi0597/2025-03?lang=en

    each instruction shows its encoding. eg there are three entries for MOV, depending on what's on the right hand side:

    https://developer.arm.com/documentation/ddi0597/2025-03/Base-Instructions/MOV--MOVS--immediate---Move--immediate--?lang=en
    https://developer.arm.com/documentation/ddi0597/2025-03/Base-Instructions/MOV--MOVS--register---Move--register--?lang=en
    https://developer.arm.com/documentation/ddi0597/2025-03/Base-Instructions/MOV--MOVS--register-shifted-register---Move--register-shifted-register--?lang=en

    Not all instructions are available on all CPUs, of course.

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexander Ausserstorfer@21:1/5 to Theo on Sat Jun 7 17:08:01 2025
    In article <buh*s+0-z@news.chiark.greenend.org.uk>,
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von Bruce
    Smith I'M missing the links to the ARM machine code. I want to see the
    commands in hex or binary values and want to be able to calculate it by
    myself.

    Is there another book or anything else you can recommend?

    Arm has documentation of the A32 instruction encoding, starting from
    the most significant bits and drilling your way down:

    ...

    Not all instructions are available on all CPUs, of course.

    Many thanks! I was not able to see the pages at home, however. I
    downloaded a PDF (8 MB) now elsewhere.

    I begun to write an introduction

    http://home.chiemgau-net.de/ausserstorfer/Temp/2022-05-26/Skript.pdf (5
    kB)

    in German for me to learn and teach myself. May be that I include the
    new 8 bit home computer Mega65 from Trentz Elektronik there later as
    well.

    A.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian Barthel@21:1/5 to All on Mon Jun 9 13:04:50 2025
    An einem Sat, 07 Jun 2025 17:08:01 +0200 schrieb der Meister Alexander Ausserstorfer:

    In article <buh*s+0-z@news.chiark.greenend.org.uk>,
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von
    Bruce Smith I'M missing the links to the ARM machine code. I want to
    see the commands in hex or binary values and want to be able to
    calculate it by myself.

    Is there another book or anything else you can recommend?

    Arm has documentation of the A32 instruction encoding, starting from
    the most significant bits and drilling your way down:

    ...

    Not all instructions are available on all CPUs, of course.

    Many thanks! I was not able to see the pages at home, however. I
    downloaded a PDF (8 MB) now elsewhere.

    I begun to write an introduction

    http://home.chiemgau-net.de/ausserstorfer/Temp/2022-05-26/Skript.pdf (5
    kB)

    in German for me to learn and teach myself. May be that I include the
    new 8 bit home computer Mega65 from Trentz Elektronik there later as
    well.

    A.

    The link doesn't work.


    --
    holy miau is a snake

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to Sebastian Barthel on Mon Jun 9 17:36:00 2025
    Sebastian Barthel <naitsabes@freenet.de> wrote:
    An einem Sat, 07 Jun 2025 17:08:01 +0200 schrieb der Meister Alexander Ausserstorfer:

    I begun to write an introduction

    http://home.chiemgau-net.de/ausserstorfer/Temp/2022-05-26/Skript.pdf (5
    kB)

    in German for me to learn and teach myself. May be that I include the
    new 8 bit home computer Mega65 from Trentz Elektronik there later as
    well.

    A.

    The link doesn't work.

    It's 2025 already. This works for me: http://home.chiemgau-net.de/ausserstorfer/Temp/2025-05-26/Skript.pdf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexander Ausserstorfer@21:1/5 to Theo on Tue Jun 10 18:11:37 2025
    In article <iKm*CnCeA@news.chiark.greenend.org.uk>,
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    Sebastian Barthel <naitsabes@freenet.de> wrote:

    The link doesn't work.

    It's 2025 already. This works for me:

    http://home.chiemgau-net.de/ausserstorfer/Temp/2025-05-26/Skript.pdf

    Thanks, Theo. I will give it later another place on my web site.

    It is to understand, that this is a working process. This means that it
    may and may not include mistakes and errors. It is written down by
    something who wants to know the stuff in an logical order what he was also missing in the past.

    The first I will explore will be the PC (R15). I want to know the
    structures of programs at the beginning. So the first command will be
    MOV here. (On Mega65 it would be JMP I think).

    It may be that I will include the Mega65 besides the ARM, too, because
    you can learn a lot by comparing things.

    A.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian Barthel@21:1/5 to All on Tue Jun 10 18:37:26 2025
    An einem Mon, 09 Jun 2025 17:36:00 +0100 schrieb der Meister Theo:

    Sebastian Barthel <naitsabes@freenet.de> wrote:
    An einem Sat, 07 Jun 2025 17:08:01 +0200 schrieb der Meister Alexander
    Ausserstorfer:

    I begun to write an introduction

    http://home.chiemgau-net.de/ausserstorfer/Temp/2022-05-26/Skript.pdf
    (5 kB)

    in German for me to learn and teach myself. May be that I include the
    new 8 bit home computer Mega65 from Trentz Elektronik there later as
    well.

    A.

    The link doesn't work.

    It's 2025 already. This works for me: http://home.chiemgau-net.de/ausserstorfer/Temp/2025-05-26/Skript.pdf

    OK - Thanks.
    With the corrected year it was a full success.



    --
    holy miau is a snake

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Alexander Ausserstorfer on Sat Jun 14 17:54:20 2025
    In article <5c2cea6fccbavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    Is there a program with which I can see the memory of any RISC OS
    machine?

    There are commands *Memory, *MemoryA, and *MemoryI to display (and
    even modify) memory in different formats.

    StrongEd can only display files, can't it?

    No - it can also display memory.
    See Menu -> Create File -> Grab memory.
    Different named areas, and in different formats.

    --
    Martin Avison
    Note that unfortunately this email address will become invalid
    without notice if (when) any spam is received.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexander Ausserstorfer@21:1/5 to Alexander Ausserstorfer on Sat Jun 14 17:58:47 2025
    In article <5c2adc4465bavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    In article <iKm*CnCeA@news.chiark.greenend.org.uk>,
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    Sebastian Barthel <naitsabes@freenet.de> wrote:

    The link doesn't work.

    It's 2025 already. This works for me:

    http://home.chiemgau-net.de/ausserstorfer/Temp/2025-05-26/Skript.pdf

    Thanks, Theo. I will give it later another place on my web site.

    I put it now here:

    http://home.chiemgau-net.de/ausserstorfer/Computer/Kurs.pdf (27 kB)

    It is to understand, that this is a working process. This means that it
    may and may not include mistakes and errors. It is written down by
    something who wants to know the stuff in an logical order what he was also missing in the past.

    The first I will explore will be the PC (R15). I want to know the
    structures of programs at the beginning. So the first command will be
    MOV here. (On Mega65 it would be JMP I think).

    No, before all I begin now with the memory. This will become a huge
    part.

    It is a living process. It should be logical and not an enumeration of
    commands like I found in many books.

    I found something of the memory in the Programmer's Reference Manuals.
    Are there other sources as well? Is there a program with which I can see
    the memory of any RISC OS machine? StrongEd can only display files,
    can't it?

    A.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexander Ausserstorfer@21:1/5 to Martin on Thu Jun 19 06:31:28 2025
    In article <5c2cef85bdNews03@avisoft.f9.co.uk>,
    Martin <News03@avisoft.f9.co.uk> wrote:
    In article <5c2cea6fccbavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    Is there a program with which I can see the memory of any RISC OS
    machine?

    There are commands *Memory, *MemoryA, and *MemoryI to display (and
    even modify) memory in different formats.

    Thanks.

    StrongEd can only display files, can't it?

    No - it can also display memory.
    See Menu -> Create File -> Grab memory.
    Different named areas, and in different formats.

    I couldn't find the menu entry. When I click on iconbar -> !StrongEd ->
    Menu -> Create -> Dump StrongEd offers me a window with name Grab in the
    window title bar. Did you mean that?

    In !Zap I can grab a are of memory as I wish.

    A.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin@21:1/5 to Alexander Ausserstorfer on Thu Jun 19 10:09:12 2025
    In article <5c2f3eb0a5bavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    In article <5c2cef85bdNews03@avisoft.f9.co.uk>,
    Martin <News03@avisoft.f9.co.uk> wrote:
    In article <5c2cea6fccbavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    Is there a program with which I can see the memory of any RISC OS
    machine?

    There are commands *Memory, *MemoryA, and *MemoryI to display (and
    even modify) memory in different formats.

    Thanks.

    StrongEd can only display files, can't it?

    No - it can also display memory.
    See Menu -> Create File -> Grab memory.
    Different named areas, and in different formats.

    I couldn't find the menu entry.

    Which version of StrongEd are you using?
    Here I am using v4.70a17 (31 May 2025)

    When I click on iconbar ->
    !StrongEd -> Menu -> Create -> Dump StrongEd offers me a window
    with name Grab in the window title bar. Did you mean that?

    If the Grab Memory window shows menu icons for ROM Module, RAM Module, Application, ROM Workspace, RAM Workspace and Dynamic Area, then
    buttons for Zero Page, Empty Text, CMOS RAM, Close, then yes. If you
    are using another version of SE it may be slightly different.

    In !Zap I can grab a are of memory as I wish.

    I don't think there is an equivalent of !Zap -> Create -> Read Memory
    to specify addresses to dump, but that only reads from the specified
    task - which is what selecting an application in SE does for the whole application slot.

    --
    Martin Avison
    Note that unfortunately this email address will become invalid
    without notice if (when) any spam is received.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jean-Michel@21:1/5 to Martin on Thu Jun 19 11:32:03 2025
    In message <5c2f581e37News03@avisoft.f9.co.uk>
    Martin <News03@avisoft.f9.co.uk> wrote:

    In article <5c2f3eb0a5bavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    In article <5c2cef85bdNews03@avisoft.f9.co.uk>,
    Martin <News03@avisoft.f9.co.uk> wrote:
    In article <5c2cea6fccbavariasound@chiemgau-net.de>,
    Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
    Is there a program with which I can see the memory of any RISC OS
    machine?

    There are commands *Memory, *MemoryA, and *MemoryI to display (and
    even modify) memory in different formats.

    Thanks.

    StrongEd can only display files, can't it?

    No - it can also display memory.
    See Menu -> Create File -> Grab memory.
    Different named areas, and in different formats.

    I couldn't find the menu entry.

    Which version of StrongEd are you using?
    Here I am using v4.70a17 (31 May 2025)

    When I click on iconbar ->
    !StrongEd -> Menu -> Create -> Dump StrongEd offers me a window
    with name Grab in the window title bar. Did you mean that?

    If the Grab Memory window shows menu icons for ROM Module, RAM Module, Application, ROM Workspace, RAM Workspace and Dynamic Area, then
    buttons for Zero Page, Empty Text, CMOS RAM, Close, then yes. If you
    are using another version of SE it may be slightly different.

    In !Zap I can grab a are of memory as I wish.

    I don't think there is an equivalent of !Zap -> Create -> Read Memory
    to specify addresses to dump, but that only reads from the specified
    task - which is what selecting an application in SE does for the whole application slot.

    FIY, Stronged GrabMemory: Application drop -down menu, allows you to see
    that all applications start at 0x8000


    --
    Jean-Michel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)