Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hp-pcd.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!akgua!psuvax!burdvax!presby!seismo!hao!hplabs!hp-pcd!hpfcla!hp-dcde!jack From: jack@hp-dcde.UUCP Newsgroups: net.flame Subject: Godless 68000 instruction set - (nf) Message-ID: <2546@hp-pcd.UUCP> Date: Thu, 24-Nov-83 03:25:54 EST Article-I.D.: hp-pcd.2546 Posted: Thu Nov 24 03:25:54 1983 Date-Received: Sat, 26-Nov-83 06:15:00 EST Sender: notes_gateway@hp-pcd.UUCP Organization: Hewlett-Packard, Fort Collins, CO Lines: 46 #N:hp-dcde:32700001:000:1326 hp-dcde!jack Nov 22 17:46:00 1983 Let's chat about the Motorola 68000 instruction set, shall we? How to clear things: data register memory address register ------------- ------ ---------------- clr.l d0 clr.l addr move.l #0,a0 or moveq #0,d0 or move.l #0,addr or move.w #0,a0 You see, moveq (move quick) is faster that a clr. How strange. One would think the a clear operation would be fast. Now, you just *can't* use clr on an address register. You have to move a zero into it. However, you can do a *word* move of zero into an address register, because the word zero will sign extend into a long zero. Also, you'd better not use clr on a memory-mapped I/O location, since CLR READS BEFORE IT WRITES!!! AARRGGHH! How to see if something is zero: data register memory address register ------------- ------ ---------------- tst.l d0 tst.l addr cmp.l #0,a0 or move.l a0,d0 We can't use tst.l on an address register. You can set the condition codes by moving it into a data register, if you happen to have one lying around. If not, you must use the big, slow, compare immediate. Why can't I just use tst on anything?!? And they wonder why I constantly mutter to myself... -Jack Applin optimizing himself to death at: Hewlett-Packard Ft. Collins, CO (hplabs!hp-dcd!jack)