Newsgroups: comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!cs.utexas.edu!convex!news.duke.edu!news-feed-1.peachnet.edu!umn.edu!gold.tc.umn.edu!roger034
From: roger034@gold.tc.umn.edu (Brynn Rogers)
Subject: V25+ bank switch and string mov
Message-ID: <CxBKoG.9E5@news.cis.umn.edu>
Sender: news@news.cis.umn.edu (Usenet News Administration)
Nntp-Posting-Host: gold.tc.umn.edu
Organization: University of Minnesota
Date: Fri, 7 Oct 1994 20:21:28 GMT
Lines: 57

Newsgroups: comp.robotics
Subject: V25+ bank switches and rep movs instruction
Expires: 
References: <1994Sep28.205323.24428@news.wrc.xerox.com> <Cx0FKH.B1E@csn.org> <Cx2yz5.HCn@news.cis.umn.edu> <36v8vm$7e1@mark.ucdavis.edu>
Sender: 
Followup-To: 
Distribution: 
Organization: University of Minnesota
Keywords: 
Cc: 

In article <36v8vm$7e1@mark.ucdavis.edu>,
Tawen Mei <ez007738@rocky.ucdavis.edu> wrote:

>Bankswitch on V25 is slow, probably done in micro code; so is the macro
>service. 

No, Bank switch is very fast. 15 clocks to do a BRKCS (context switch) 
instruction.  53 clocks to do a context switch interrupt.  A normal
interrupt (which only saves the code segment, program counter, and flags)
takes 72 clocks (at one wait state).   A pusha and popa combination 
(which don't save segment registers) takes 98+98=196 clocks.  Reti adds
49 clocks.  retrbi takes 15 clocks.  So:

Bank interrupt
latency   save_regs  restore_regs   return  total_overhead
   53                                 15     88 clks = 8.8 uS

Normal interrupt
latency   save_regs  restore_regs   return  total_overhead
   72        98           98          49      317 clks = 31.7 uS

Even if you don't save any registers (and you always need some)
the bank switch is faster.

>             Macro service sounds great, but is too tricky to get it to work. 
>Using internal ram would result in great performance penalty whenever you
>do a memory access. 

String movs are faster than Macro service anyway, so use the string mov
instead.

>                     Also, V25's string instruction is incompatible with
>8086's, maybe a bug in microcode? 

No, string mov works fine.   NEC added some extra prefix instructions that
are meant to be used with string movs, but no DOS compiler uses them
because they are not x86.


Compared to a Intel 80188, the V25 blows it out of the water in price 
and performance.

--
             Brynn Rogers                      roger034@gold.tc.umn.edu
----  Save the internet - keep the toll bridges out               
Autonomous robots get my interest.     Embedded systems pay my mortgage.
