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

Instructions on 68000

4 views
Skip to first unread message

Kurt Koleman Koller

unread,
Apr 11, 1991, 3:05:00 PM4/11/91
to

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?

Thanks,

--------------------------- _ _ _ _ ___ __ __ _ __ _
| Kurt "Koleman" Koller | ( )/ ) /,\ ( ) ( __)( \/ ) ( ) ( \ ( )
| P.O. Box 50656 | ( \ ( )( )__ ( __)( )\/( ) (_|_) ( )\\( )
| Mendota, MN 55150-0656 | (_)\_) \_/ (____)(___)(_) (_)(_) ( )(_) \__)
---------------------------
UUCP: {crash tcnet}!orbit!pnet51!koleman
INET: kol...@pnet51.orb.mn.org

Robert Faulkner

unread,
Apr 12, 1991, 5:43:49 PM4/12/91
to
>From: kol...@pnet51.orb.mn.org (Kurt "Koleman" Koller)

>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?

These are Set According to Condition commands in the form Scc <ea>
The specified condition code is Tested, if the condition is true, the
byte specified by the effective address is set to TRUE, (all ones),
otherwise that byte is set to False (all zeroes), "CC" may specify the
following conditions

CC Carry Clear LS Low or Same
CS Carry Set LT Less Than
EQ Equal MI Minus
F False NE Not Equal
GE Greater or Equal PI Plus
GT Greater Than T True
HI High VC Overflow Clear
LE Less or Equal VS OverFlow Set

This command is a good way to set a Boolean Flag byte in a return value
for a function. As far as I know it is supported on all of the 680x0
processors. Feel free to e-mail me with any other questions.

I got all of this information from the S68000 User's Guide, which only
costs about $0.65 at our University Book Store. You can also call
Signetics and they will send you one free, plus a bunch of other useful
information on the 68000.

The phone # is 408-739-7700, ask for publications department.

Thanks,

--

Robert Faulkner co...@ccwf.cc.utexas.edu
/// Recursion: Thinking
\\\/// University of Texas about
\\// Amiga Computers Thinking

Colin Plumb

unread,
Apr 12, 1991, 3:15:02 AM4/12/91
to
kol...@pnet51.orb.mn.org (Kurt "Koleman" Koller) wrote:
> 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

> 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?

These are the "set conditional" instructions, which are documented under
"Scc" like all the branches are collectively called "Bcc".
If the condition is true ("t" is always true, "f" never is), they
set the destination byte to all 1's, otherwise they clear it to
all 0's.

Obviously, their function can be emulated with other instruction
sequences (conditional branches are easiest), but that's true of
most 68000 instructions.
--
-Colin

Matthew Dillon

unread,
Apr 12, 1991, 4:58:32 PM4/12/91
to
In article <45...@orbit.cts.com> kol...@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 <ea>

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: kol...@pnet51.orb.mn.org

-Matt

--

Matthew Dillon dil...@Overload.Berkeley.CA.US
891 Regal Rd. uunet.uu.net!overload!dillon
Berkeley, Ca. 94708
USA

Stephan Schaem

unread,
Apr 14, 1991, 7:41:27 AM4/14/91
to
Speaking of Scc, a good way to use it is to set the bliter minterm with
it... For plane Set/Clear.
If you have a color value (x fliped:-) just do an add.b dx,dx and SCC
dy.
Could be use for seting byte flag (using Scc and Tst).
SF can be used instead of clr.b ...
(but same timing, but slower on a 68020)
Anyway, you sould get the Programer's Reference Manual.

Stephan.

Scott Karlin

unread,
Apr 12, 1991, 6:47:49 PM4/12/91
to
In article <45...@orbit.cts.com> kol...@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
These are examples of the Scc (Set According to Condition) instructions.
If the condition specified by "cc" is true then the byte operand is set
to all bits 1, otherwise all bits 0. The conditions specified by your
four examples are: always true, not equal, never true, & greater or
equal. This information can be found in the "8-/16-/32-Bit Microprocessors
User's Manual" ISBN: 0-13-567074-8.


-- Scott Karlin knu...@spf.trw.com
-- TRW Data Systems Center Phone: (213) 812-7335
-- One Space Park, O2-1761
-- Redondo Beach, CA 90278-1071

Urban Dominik Mueller

unread,
Apr 16, 1991, 8:58:20 AM4/16/91
to
To all programmers: This is a call for submissions to the WHO'S WHO OF
COMP.SYS.AMIGA. Whoever has published anything on the Amiga or has some
special knowledge others might be interested in should be mentioned. So if
you'd like yourself or someone else included, please submit the address in
the following format:

e-mail address name comment
-------------- ---- -------
71545...@compuserve.com Jeff Davis R:Manx technical support
anno...@iris.eecs.ucdavis.edu R:comp.sys.amiga.announce
dil...@Overload.Berkeley.CA.US Matt Dillon A:DICE, DMouse, DNet, UUCP
fishpond!f...@phx.mcd.mot.com Fred Fish R:Fish disks
je...@cbmvax.cbm.commodore.com Randell Jesup R:C= AmigaDOS
umue...@iiic.ethz.ch Urban Mueller A:csh, who's who K:Aztec C 5.0d

Remarks:
- A: means "Author of", U="User of", R="Responsible for", K="Knowledgable of"
- Please mention any special knowledge you have, e.g. if you are a C++
wizard. People who need help with C++ will no longer have to do c.s.a
postings like "HELP! Can't compile HelloWorld.cp" but can ask someone
from the who's who.
- If you submit other people's addresses (I hope you'll send me your whole
address list), please make sure they don't object to publishing them. If
someone posts articles on c.s.a, it's sure to be OK to include his address.
- Don't submit any unverified addresses.
- You can also include compuserve addresses, and if you know gateways,
BIX and GEnie addresses.
- Submit per email to umue...@iiic.ethz.ch, I'll post the list in two
weeks on comp.sys.amiga.misc
__
| Urban Mueller | / / | Urban Mueller |
| INTERNET:umue...@iiic.ethz.ch | __ / / | Schulhausstr. 83 |
| FIDONET: 2:302/906 (AUGL) | \ \/ / | CH-6312 Steinhausen |
| "Don't tell my employer" | \__/ | SWITZERLAND |

Kurt Koleman Koller

unread,
Apr 16, 1991, 8:05:02 PM4/16/91
to

Just to save face here...

The reason that I posted this inquiry is because I have 3 books here, one of
which is a Motorola reference on the 68000, none of which have any set
instructions under the heading Scc or any other similar heading.

That is why I asked here. I AM literate.

0 new messages