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.
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.
Excuse me. I come from the Commodore 64 and do only know something about
the POKE and PEEK commands.
I don't understand the ! and ? commands. I found some PDFs online and
wonder because its about BBC BASIC but not for the Acorn Archimedes but
for a Z80 called Sinclair Spectrum and another for a Z88 system. So BBC
BASIC doesn't belong to RISC OS only?
? belongs to a byte ! belongs to a word.
With !(&9000) you can write into memory. But with the same command you
can read it!
I never have seen that before.
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.
So
[OPT pass%
FNmessage("Harriet")
MOV R15, R14 ;exit routine
]
will generate a scrap of code that simply prints the string "Harriet".
However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
In article <050c4e7c5c.harriet@bazleyfamily.co.uk>,
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:
[part snipped]
So
[OPT pass%
FNmessage("Harriet")
MOV R15, R14 ;exit routine
]
will generate a scrap of code that simply prints the string "Harriet".
Thank you! However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
into the memory and run it.
It shouldn't be added automatically by the Assembler because this is a bit
of spoon-feeding (the German word here would be 'Bevormundung', I don't
know the correct English expression). You are hide here something from the programmer.
This is not a good way to learn! He should be able to know what he's
doing!
Unix, ugh!
In article <5c87099f9bbavariasound@chiemgau-net.de>,
Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
That to my mind is MUCH harder, and would give you maintenance
nightmares, as it is impossible to read easily. The computer is MUCH
better translating plain text into hex and binary then we are.
I strongly suggest that is not the way to program these days.
It was bad enough 50 years ago, when that was the only option, but
certainly not now.
In article <5c87163b82News04@avisoft.f9.co.uk>,
Martin <News04@avisoft.f9.co.uk> wrote:
In article <5c87099f9bbavariasound@chiemgau-net.de>,
Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
That to my mind is MUCH harder, and would give you maintenance
nightmares, as it is impossible to read easily. The computer is
MUCH better translating plain text into hex and binary then we
are.
I strongly suggest that is not the way to program these days. It
was bad enough 50 years ago, when that was the only option, but
certainly not now.
I don't understand that. The values are much more clear to me.
Without I couldn't understand how computers are working.
In article <5c87099f9bbavariasound@chiemgau-net.de>,
Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
That to my mind is MUCH harder, and would give you maintenance
nightmares, as it is impossible to read easily. The computer is MUCH
better translating plain text into hex and binary then we are.
I strongly suggest that is not the way to program these days.
It was bad enough 50 years ago, when that was the only option, but
certainly not now.
Thank you! However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
into the memory and run it. It does the same as your example programme.
On 06/12/2025 15:57, Alexander Ausserstorfer wrote:
Thank you! However, you can do this much easier. Just write the
hex values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
into the memory and run it. It does the same as your example
programme.
I'm surprised you haven't gone for the even easier option of
toggling it in on the front panel switches, like a real programmer.
On 06/12/2025 15:57, Alexander Ausserstorfer wrote:
Thank you! However, you can do this much easier. Just write the
hex values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
into the memory and run it. It does the same as your example
programme.
I'm surprised you haven't gone for the even easier option of
toggling it in on the front panel switches, like a real programmer.
In article <5c87850775bavariasound@chiemgau-net.de>,
Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
In article <5c87163b82News04@avisoft.f9.co.uk>,
Martin <News04@avisoft.f9.co.uk> wrote:
In article <5c87099f9bbavariasound@chiemgau-net.de>,
Alexander Ausserstorfer <bavariasound@chiemgau-net.de> wrote:
However, you can do this much easier. Just write the hex
values
01 00 00 EF 48 61 72 72 69 65 74 00 0E F0 A0 E1
That to my mind is MUCH harder, and would give you maintenance
nightmares, as it is impossible to read easily. The computer is
MUCH better translating plain text into hex and binary then we
are.
I strongly suggest that is not the way to program these days. It
was bad enough 50 years ago, when that was the only option, but
certainly not now.
I don't understand that. The values are much more clear to me.
Without I couldn't understand how computers are working.
Good luck in understanding it in a year ... or two ...or many more.
Hex code I would not even try, stopping and improvment or development.
As Steve said, we may have to agree to differ!
May it be. For me, machine code is much more easy to understand. Because
you don't need a compiler it means that there is nothing between you and
the machine.
Now stop wasting everyone's time with this nonsense.
In article <10ic84f$3on78$1@druck.eternal-september.org>,
druck <news@druck.org.uk> wrote:
Now stop wasting everyone's time with this nonsense.
Now, now... Alex didn't waste my time. Although I will never touch machine code, it was pretty amusing to read that someone is so familiar with it.
In article <5c8f6b2891Paul@sprie.nl>,
Paul Sprangers <Paul@sprie.nl> wrote:
In article <10ic84f$3on78$1@druck.eternal-september.org>,
druck <news@druck.org.uk> wrote:
Now stop wasting everyone's time with this nonsense.
Now, now... Alex didn't waste my time. Although I will never touch
machine code, it was pretty amusing to read that someone is so familiar
with it.
I just try to understand and to learn. How can I do or learn coding when
I even don't understand any of the machine code, means _both_ sides of a compiler (or assembler)? I don't know what the program (compiler) is
doing. I don't say you should do it always like that. But you should be
able to do it! Without this knowledge, you aren't good. When you compare
the code (source) before the compiler and behind the compiler (machine
code), you'll learn and uncover a lot!
A.
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?
On 12 Apr 2025 as I do recall,It's a good method!
Alexander Ausserstorfer wrote:
In the book 'Raspberry Pi Assembly Language RISC OS Beginners' von BruceStrongED can disassemble ARM code instructions for you in Dump mode, so technically speaking you can use the BBC BASIC built-in assembler (I
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?
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)
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?
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.
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.
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.
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
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
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).
Is there a program with which I can see the memory of any RISC OS
machine?
StrongEd can only display files, can't it?
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.
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.
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.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 06:29:08 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
921 files (14,318M bytes) |
| Messages: | 264,702 |