Subject: Re: [TI-99/4A] Opcode quiz result

From: Jeff White <[email-masked]>
Date: Sat, 5 May 2012 13:49:50 -0400

Wow!  I suppose getting the first 3 and last 2 correct says something about me.  

Jeff White

On 05 May 2012, at 11:18, "Michael Zapf" <[email-masked]> wrote:

> So as promised, here are the results of my statistics on opcode usage. This is the complete opcode set; the entries with * are not really meaningful since they also comprise a lot of non-opcode usage (e.g. the words >2020,>2020 may be decoded as COC @>2020,R0 although they may just be four space characters). Also, the appearances of the control operations (like RSET) may rather be due to words coincidentally matching the opcode.
> 
> I used the following programs as sources for these numbers:
> 
> Infocom interpreter
> TI-Invaders (ROM)
> Parsec (ROM)
> C99
> F9640
> TELCO
> SYSTEM/SYS
> FRACTALS! (my own program used to create Mandelbrot graphics)
> DSR of the TI DSSD controller
> DSR of the BwG floppy controller
> 
> The inclusion of SYSTEM/SYS accounted much for the XOP appearance, since MDOS makes use of XOP for OS traps. Also, the CRU operations were increased in frequency by the DSRs.
> 
> 17649 MOV
> 6550 DATA*
> 4638 LI
> 4226 BL
> 3813 S*
> 3769 SZC*
> 3206 C
> 3035 JEQ
> 2811 JNE
> 2441 JMP
> 2257 B
> 2077 CLR
> 2059 A
> 1710 BLWP
> 1659 COC*
> 1379 AI
> 1312 CI
> 1252 DEC
> 1163 INC
> 1082 SWPB
> 1001 SRL
> 940 ANDI
> 913 SLA
> 797 XOP
> 647 INCT
> 643 LDCR*
> 637 SOCB*
> 615 JL
> 608 MPY
> 511 SOC
> 475 STCR
> 456 SETO
> 443 JLT
> 398 DECT
> 395 JHE
> 360 JH
> 350 DIV
> 306 ORI
> 281 JOC
> 279 JGT
> 264 LIMI
> 256 ABS
> 246 CZC
> 241 RTWP
> 240 JLE
> 236 SRA
> 227 SBO
> 184 JNC
> 169 INV
> 164 NEG
> 162 X
> 144 SBZ
> 136 LWPI
> 134 SRC
> 106 TB
> 98 LST
> 45 JOP
> 43 STWP
> 31 STST
> 28 JNO
> 8 DIVS*
> 3 RSET*
> 2 LREX*
> 2 IDLE*
> 1 MPYS*
> 1 CKON*
> 1 CKOF*
> 0 LWP
> 0 XOR
> 
> So the correct order of the selected opcodes was:
> 
> MOV - used for all memory accesses
> JNE - used in loops
> CLR - initializing values; also shorter than LI Rx,0
> BLWP - Subprogram call (very rare in the TI-99 ROM, though)
> CI - most popular compare operation
> DEC - used in loops 
> INC - obviously used in similar environments
> SLA - used for multiplying by powers of 2
> INCT - much rarer than INC
> SETO - much rarer than CLR
> JHE - not effective when comparing to 0 (always true)
> JOC - mostly for checking shifted out bits
> RTWP - much rarer than BLWP (which is not surprising)
> SRA - much rarer than SRL (being used for bit shifting mostly)
> SBO - used mainly in DSRs, and usually at few points
> STWP - rarely used; BLWP has a similar effect.
> 
> Michael
> 
>