Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.programmer Subject: Re: Instructions on 68000 Message-ID: Date: 12 Apr 91 20:58:32 GMT References: <4577@orbit.cts.com> Organization: Not an Organization Lines: 63 In article <4577@orbit.cts.com> koleman@pnet51.orb.mn.org (Kurt "Koleman" Koller) writes: > >Ok, I was looking at some source in Assembly, and I saw some instructions that >I wasn't familiar with. My assembler (Macro 68) assembles them just fine, and >they ARE mentioned in the 68000 manual, but just MENTIONED. I have no idea >what they do. If anyone can help me, so be it. > > st (MemoryLocation) > sne d(n) > sf > sge > >etc... > > These are not "documented" instructions. What do they do, and why would >someone use them other than to save cycles or 10? Are they also used on the >020 030 040 etc? They're magik, of course! Actually, they are individual branch codes for the Scc instruction (set according to condition). The format is: Scc.b Scc is always a byte operation. If the specified condition is TRUE, the byte destination is set to all 1's (-1). If it is FALSE, the byte destination is set to all 0's. The 'cc' follows the DBcc branch codes which is the same as the Bcc branch codes except for the 't' and 'f' code (always true and always fast). st D0 (always true), sets lower byte of D0 to 1's sne D0 If not equal ... sf D0 (always false), clears lower byte of D0 sge D0 If greater or equal then.. You can get 0, 1 longword results by following the Scc with a NEG instruction, like this (for example): moveq.l #0,D0 . cmp ... . sne.b D0 neg.b D0 >Thanks, > >--------------------------- _ _ _ _ ___ __ __ _ __ _ >| Kurt "Koleman" Koller | ( )/ ) /,\ ( ) ( __)( \/ ) ( ) ( \ ( ) >| P.O. Box 50656 | ( \ ( )( )__ ( __)( )\/( ) (_|_) ( )\\( ) >| Mendota, MN 55150-0656 | (_)\_) \_/ (____)(___)(_) (_)(_) ( )(_) \__) >--------------------------- >UUCP: {crash tcnet}!orbit!pnet51!koleman >INET: koleman@pnet51.orb.mn.org -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA