Path: utzoo!attcan!uunet!wuarchive!psuvax1!rutgers!rochester!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Forth Implementation Message-ID: <1888.UUL1.3#5129@willett.pgh.pa.us> Date: 21 Oct 90 01:58:41 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 41 Date: 10-13-90 (16:34) Number: 4054 (Echo) To: ALL Refer#: NONE From: JONAH THOMAS Read: (N/A) Subj: 8086 CODE Status: PUBLIC MESSAGE I've just recently started programming on an 8086 instead of a 68000, and I wasn't sure how much slower POPs and PUSHs were than direct register moves. So I tested it with the following code in Pygmy 1.3. ( looking at speed of different assembly commands) CODE TEST1 BX AX MOV, AX BX MOV, NXT, END-CODE CODE TEST2 AX POP, AX PUSH, NXT, END-CODE : TESTA -1 FOR TEST1 NEXT ; : TESTB -1 FOR TEST2 NEXT ; : TESTC 50 FOR TESTA NEXT ; : TESTD 50 FOR TESTB NEXT ; ( TESTC averaged 20.40 seconds, TESTD averaged 19.34 seconds apparently PUSH and POP are faster than register moves on this machine. What a surprise.) I figured that since the only difference between them was the two assembly instructions, that would be the only thing to make a difference in the speed. But the PUSH and POP combination actually came out faster. This is a memory operation where the other is just register to register! How could it possibly be faster? Is it 4 cycles where BX AX MOV, is 5? I'm running on an obsolescent 12Mh AT, it's just a standard 80286 processor. I don't think it does any fancy cache memory or anything like that. Can somebody recommend a good book? I don't remember mysteries like this on the 68000, but maybe I've just forgotten.... --- ~ NET/Mail : The MATRIX (5 Nodes/1.2 Gig) Birmingham, AL (205) 323-2016 ~ RNet 1.05M:* Metrolink - Front Porch BBS 404-695-1889 HST -Regional HUB NET/Mail : DC Information Exchange, MetroLink Int'l Hub. (202)433-6639 ----- This message came from GEnie via willett through a semi-automated process. Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp