Article View: comp.sys.atari.st
Article #31212Re: alcyon question
From: Allan Pratt
Date: Fri, 11 Mar 1988 18:32
Date: Fri, 11 Mar 1988 18:32
32 lines
1466 bytes
1466 bytes
From article <1374@alliant.Alliant.COM>,
by rosenkra@Alliant.COM (Bill Rosenkranz):
> does anyone know if it is possible to write inline assembler with
> alcyon? seems like i've tried all the ways i can think of but none
> seem to work. it's really not a big deal, just curious....
>
> -bill
Yes: say asm("foo") where foo is an as68-compatible line of assembly code.
For instance...
#include <osbind.h>
main()
{
long oldssp = Super(0L);
asm("move.l #$0,$420"); /* set _memvalid to 0 (invalid) */
asm("move.l $4f2,a0"); /* a0 -> system header */
asm("move.l 2(a0),a0"); /* 2(a0) is reset vector */
asm("jmp (a0)");
}
will cause a COLD system reset (as opposed to the normal warm one).
Equivalent C code is left as an exercise to the reader -- this is just
an example. (JMPing indirect through 4 would work, but JMPing directly
to FC0000 or FC0030 wouldn't be right because new STs might have ROM
starting at a different location.)
============================================
Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else. ...ames!atari!apratt
Technical Details
Message-ID:
<1014@atari.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!portal!atari!aprattReferences:
<1374@alliant.Alliant.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: alcyon question Message-ID: <1014@atari.UUCP> Date: 11 Mar 88 18:32:05 GMT References: <1374@alliant.Alliant.COM> Organization: Atari Corp., Sunnyvale CA Lines: 32