Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Self Modifying code

0 views
Skip to first unread message

R.D.C...@sysc.salford.ac.uk

unread,
Nov 15, 1989, 11:38:32 AM11/15/89
to
>Date: 13 Nov 89 01:12:27 GMT
>From: psuvm!sml...@psuvax1.cs.psu.edu
>Subject: Self-Modifying Code
>
>Hi, I am writing an assembly language routine which modifies its own code in
>a tight loop in order to avoid having to do a decision statement at every
>iteration. Unfortunately, whatever code I am inserting is screwing things up
>royally, and although I have checked it fairly throughly, I cannot figure out
>what is going on. Question: Is there something screwy about executable and
>object files that would disallow self modifying. The block that gets modified
>is this:
>
> lsr.w d3
> bne cont
> add.l #8,a0
> move.w #$8000,d3
> cont: nop
>
>Since branching is relative, one would think it would work, and a dump of
>the object file indicates this is so. HELP !!!!
>
>Scott Le Grand

I don't know if this has been answered, but could the 68000's instruction
prefetch be causing the problem (The 68010 has a bigger prefetch I believe
which would probably cause problems). Instruction prefetch on a 68000 or
68010 is one good reason NOT to write self modifying code.

Robert Chafer


=========================================================================
From: Robert Chafer

Computing Centre Telephone: +44 61 736 5843 x 672 or x7328,
University of Salford,
Salford M5 4WT
UK

E-mail:
JANET: chafer @ uk.ac.salford.sysc
ARPANET: chafer%uk.ac.salford.sysc @ nss.cs.ucl.ac.uk
BITNET: chafer%uk.ac.salford.sysc @ uk.ac
or chafer%uk.ac.salford.sysc%ukacrl.bitnet @ cunyvm.cuny.edu
0 new messages