Date : Thu, 18 Nov 2010 03:42:17 +0100
From : rick@... (Rick Murray)
Subject: Hints'n'Tips: Assembling non-ARM code on ARM BASIC
On 17/11/2010 16:39, Rob wrote:
>> P%=TOP:[NOP
> 0000C504 NOP
Try:
P%=TOP:[NOP:NOP:NOP:NOP]
And tell me if the address changes. ;-)
I think Acorn *had* to introduce a NOP instruction because the old
advice was:
MOVNV R0, R0
Acorn later thought "oh crap, we might need to deprecate this" and so it
became:
MOV R0, R0
And because of the amount of code using NV (including their own early
compilers), tweaks were devised to translate programs on-the-fly to a
"safe" form (the SA patch module, IIRC), luckily it is all word-aligned
so it is an easy fix.
A bit late though.
I use:
mov r0, r0
even though my tools support "nop". Habit, really. Don't tend to write
many NOPs, so it is for me more useful to know the code to poke into a
running program - E1A00000 which is remarkably similar to the 6502's NOP
(EA). Coincidence? :-)
Best wishes,
Rick.
--
Rick Murray, eeePC901 & ADSL WiFI'd into it, all ETLAs!
BBC B: DNFS, 2 x 5.25" floppies, EPROM prog, Acorn TTX
E01S FileStore, A3000/A5000/RiscPC/various PCs/blahblah...