You don't need another syntax. You just need to make your assembler take the "#43->R0" syntax, split the constant up into bytes, and spit out the four-instruction sequence.
No one is going to be enthusiastic about punching your code into an assembler and posting the results when you can do that for yourself.
If you don't have a working Pi on which to run as, you can find and install a cross-assembler (such as CodeSourcery) on a PC.
This is posted to comp.sys.arm where some COLLABORATORS may have their assembler open. Others have already pasted 8 line listings.
It's like asking someone for the time. Buy your own watch!!
Besides if I've suceeded in explaining my idea, you'd know that the whole idea is to avoid opening another canOworms: assembler and just use the existing shell.
I don't have an assembler open, or am anywhere near a Pi at the moment. But here's a simple way to get an interactive ARM assembler:
Download the RISC OS SD card image for the Pi and write it to a spare SD card Boot it on your Pi Press Ctrl-F12 Type:
*BASIC P%=&9000
Then you have an interactive assembler - just precede each line with [ and it'll be assembled on the fly with code listing printed as you go. A random code example:
Thanks Roger. In re-reading your post, we see a demonstation of opening-a-can-O-worms. Which I deliberately wanted to avoid; but failed to -- partly. Noticing that my PC:slackware has `as` installed, I checked rPi, and found it has too. So:
1=check that slak:as is easy to use;
2=check that rPi:as is easy to use [my one rPi gives gcc-errors!!]
So I got the byte-sting-LISTINGS for: #N -> rR rR -> memoryM branch HERE
But the canOwrms opened when I noticed that the byteString for `#N -> rR` can't be simply for odd-numbered R. It's been OPTIMISED!!
My ideas was to build on the execellent CambUni tutorial, but allow users who don't need/want to know about asm, hex, registers, to just `dd` the bytes into a spare SD using the shell.
Collaboration is about not repeating work that others have done. OTOH education is about repeating what others have done.
I see nothing different about the r0 and r1 sequences that doesn't look like a likely difference due to changes in A) the register number and B) the distance to memoryM.
I don't understand how you expect folks to work at this level without needing/wanting to know about asm, hex, and registers. Typically, if you don't need/want to know about asm and registers you work at the C level.
Education is about pounding things into your own stupid head.
WoW! That seems quite amazing. The old RISC OS? Actually I found that my Slackware installation does something-like and gives a listing.
The whole point is to have a system to debug rPi with only about 6 pseudo-instructions:-- #N -> rR rR -> memoryM rR-#N -> rS I'm afraid you're going to have to learn the opcodes to get anywhere,
No. If I need to learn the opcodes, my project has failed. If the normal way is to fill-in a form and send it to a government department, and I claim a novel method of just reaching-out-and-touching it, and I still have to go via the government department, then I've failed.
From the various listings which I made, it seems that for r0, r2, r4 .. you can just slot-the-#N-byte-into the 4-byte-template for: #N -> rR. Apparently for optimising reasons, the ODD-number regs don't do that. But that's OK for my purpose.
Apparently I have'nt completely failed to explain how this will allow rPi to users debug their hardware with only the existing shell; by using the
6 simple pseudo-instructions, because your suggestion goes well towards that.
It's difficult to see how the simplicity isn't obvious:
1.CPU starts & runs from bytes in specific mem-locations;
2.the is given by the CambUniTutorial;
3.`dd` will write the bytes which are associated with the machine-instructions, to the file.
Is it not true that 'byte 28 A0 E3' does: byte -> r2 forAll 'byte'?
And 'byte R8 A0 E3' does: byte -> rR for even numbered R.
As *your own* listings show, it does 0x00byte0000 -> rR. It'll also work for odd R.
And here is where you get in trouble because you don't understand the ARM instruction set. In addition to supplying a byte constant, the instruction encodes how far to shift it. For this instruction, the assembler has found another way to express the byte and has used the alternate expression 0xbc == 0x2f
Also, another thing you (OP) don't seem to have realised is that *all* ARM instructions are exactly 32 bits wide, unlike other instructions sets where they could be 8, 16, 24, 32 etc bits wide. It's one of the things that make it so efficient.
This means that there is no way to just say "Load Rn with
32-bit-immediate-value", other than as a shifted 8-bit value. That is why the LDR "Load Rn from address-pointed-to-by-Rs+/-8-bit(with shift)optional-offset" instruction exists.
Exactly: Arm seems to have been designed as rock bottom cost hardware with no microcode.
Compared with a CISC architecture this means that certain things have to be done in different ways.
the 'load from offset of program counter' is one such way
--
Ineptocracy
(in-ep-toc?-ra-cy) ? a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
In the case of ARM the ex ARM people I have spoken to are adamant that cost was the overriding concern at the time: that it resulted in very low power consumption was actually a feature that happened as a serendipitous accident.
AS far as performance goes, that of course was always a design target, if it could be arranged via simple chip architectures.
--
Ineptocracy
(in-ep-toc?-ra-cy) ? a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
SD is not a memory-chip, which you can address-directly via a machine instruction. it's a complete file-system which FIRST needs the whole OS to be running before it can be accessed. So how could it possibly be used for code to debug at the lowest level: before the OS is running ?!
That's why I didn't want to look into the trivial details. First the basic idea must be valid.
--
I was misled/fooled by the CambUni Tutorials.
Altho' they do manipulate bytes to/from specific registers,
they do it via a fully functional OS.
And can't be used for debugging, 'cos they won't work
unless the system/OS is fully functional.
The Raspberry Pi is fundamentally a GPU with an ARM sidecar; the primary processor in the system is the GPU. When the system powers on, the GPU reads bootcode.bin and start.elf, using those to set up the hardware and load the kernel. They are not ARM code, they are code executed by the GPU.
Don't know. The GPU instruction set is proprietary.
We've shown you where to get documentation. The documentation talks about what happens at reset. The processor is an ARM1176JZFS. Section 2.12 of the manual for that processor talks about exceptions. Section 2.12.5 specifically talks about reset.
Engineers typically want to understand the system they are working with. That means reading and understanding the documentation.
You seem to be only interested in being a clerk; having a fixed recipe that a knowledgeable person handed you which just works when you wave the dead chicken the right way.
In the beginning was the GPU. And the GPU was proprietary, and without publically available documents. And the power supply said "Let there be reset!" and the GPU awoke.
And lo, the GPU reached out to the SD card and read bootcode.bin, and saw that it was good. And so bootcode.bin was executed.
And bootcode.bin reached out to the SD card and found start.elf, and saw that it was good. And so start.elf was executed.
And the start.elf configured the system. RAM was divided between the GPU and the ARM.
And the start.elf loaded the kernel into the ARM side of the RAM. And the ARM was reset.
And the reset most likely proceeded in the manner described in the technical reference manual for the ARM1176JZFS processor.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.