English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 16 November 2008, 15:02   #1
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
68k stats

Hi,

Quite interesting, you know now what instructions you've to learn first.
Would be nice to have that for Amiga too.

http://emu-docs.org/CPU%2068k/68kstat.txt

Kamelito
kamelito is offline  
Old 17 November 2008, 06:32   #2
girv
Mostly Harmless
 
girv's Avatar
 
Join Date: Aug 2004
Location: Northern Ireland
Posts: 1,114
That's a lot of TST - I don't think 18% of my code is TST instructions!
girv is offline  
Old 17 November 2008, 09:05   #3
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
I guess when Megadrive games are left in demo mode they keep TST-ing for a 'Start' press on the pad
musashi5150 is offline  
Old 18 November 2008, 05:18   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
The TST, BEQ and BNE in the top definitely look out of place, it would be interesting to know what causes this. Possibly the user mode runs in a tight loop of two instructions TSTing for some state, while all significant code runs in interrupt mode triggered by the raster.

Other than that it looks as you would expect, though I would like to see all various modes of conditional branches, compares, moves etc. summed up into their respective base instruction to give a better picture of what's being done.
Leffmann is offline  
Old 18 November 2008, 20:02   #5
thor
Registered User
 
thor's Avatar
 
Join Date: Mar 2006
Location: Germany
Posts: 899
I quickly hacked some code into WinUAE and let Sanity's Arte run (including system initialization). This is the result:
Code:
Total instructions: 193376231

Instruction           %              count

MOVE             33.36275482       64515633
ADD               9.95842648       19257230
MOVEA             6.13762522       11868708
OR                5.35070705       10346995
BNE               5.34497452       10335910
AND               4.80016994        9282387
CMP               3.52804542        6822401
BTST              3.36929226        6515410
DBF               3.09556007        5986077
SWAP              2.95850134        5721038
SUB               2.54589725        4923160
BEQ               2.51456881        4862578
ADDA              2.01160407        3889964
LEA               1.53621936        2970683
ADDX              1.47928274        2860581
BCS               1.22079074        2360719
LSR               1.19577420        2312343
RTS               0.91571081        1770767
JSR               0.74546236        1441547
MOVEM             0.72223771        1396636
BCC               0.70130491        1356157
JMP               0.62075317        1200389
TST               0.55914372        1081251
MULS              0.50198776         970725
DBCS              0.46323016         895777
BT                0.40186429         777110
LSL               0.37949184         733847
BLT               0.36287916         701722
CLR               0.31013688         599731
DBEQ              0.30240273         584775
ROR               0.28740555         555774
BGE               0.23476258         453975
EOR               0.22155568         428436
DIVS              0.19214462         371562
BLE               0.16397414         317087
BGT               0.15921089         307876
BSR               0.15347543         296785
MULU              0.14381810         278110
ROXR              0.13556165         262144
ASR               0.12479818         241330
CMPA              0.11052807         213735
SUBA              0.10720967         207318
BSET              0.08492719         164229
BPL               0.08202301         158613
NOT               0.07797804         150791
ASL               0.05314097         102762
BMI               0.04930958          95353
NEG               0.04362636          84363
ROL               0.04175125          80737
DIVU              0.03335674          64504
NOP               0.03117705          60289
EXG               0.01946671          37644
RTE               0.01499460          28996
EXT               0.01348718          26081
BLS               0.00419286           8108
BHI               0.00341355           6601
TRAP              0.00333598           6451
BCLR              0.00273198           5283
DBGE              0.00244653           4731
BCHG              0.00225571           4362
ST                0.00174685           3378
SF                0.00174634           3377
CMPM              0.00071829           1389
PEA               0.00039922            772
MV2SR             0.00019703            381
SLE               0.00005688            110
MVR2USP           0.00004499             87
MVUSP2R           0.00004396             85
LINK              0.00003930             76
ORSR              0.00003878             75
UNLK              0.00003878             75
STOP              0.00003516             68
SNE               0.00003465             67
SEQ               0.00000259              5
ILLEGAL           0.00000103              2
MVSR2             0.00000103              2
ANDSR             0.00000052              1
thor is offline  
Old 19 November 2008, 09:17   #6
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
Nice work thor
musashi5150 is offline  
Old 14 January 2009, 21:23   #7
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
Who would make statistics from how many times a loop is run!?

If a demo uses 10% of the available raster time, and the rest is spent check the left mousebutton, btst and bne would be 45% each. Insane.

There must be something wrong with the Megadrive code (or, more likely, the "profiling") if every third instruction executed is a branch. As in: too much time spent in polling loops.

A proper method would be to take any number of native asm sources and count the occurences of each instruction.
Photon is offline  
Old 14 January 2009, 22:50   #8
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 515
Quote:
There must be something wrong with the Megadrive code (or, more likely, the "profiling") if every third instruction executed is a branch. As in: too much time spent in polling loops.
Not necessary, remember that the hardware handled the sprites and tiles display (and the z80 the sound), they didn't have to waste time blitting gfx or anything so i guess most of the code was spent on managing the games logic and collisions, maybe that's also why the megadrive (and other consoles) arcade games were better & with more polished gameplay ?

Although having so many TST looks a bit odd as that was one of the few instructions that could be (and should have been) skipped due to the 68k flags settings, i wouldn't be surprised to learn that those games were in fact made in C (with a compiler that couldn't cope with that).

I believe the source code of Mr. Nutz included with the Turrican 3 one is for the MD (and it's in ASM).

Last edited by hitchhikr; 14 January 2009 at 22:55.
hitchhikr is offline  
Old 16 January 2009, 02:12   #9
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,780
With your knowlege of ASM disassembly how feasible is assembley of MD Source on Amiga?
Retro1234 is offline  
Old 16 January 2009, 18:09   #10
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 515
That's possible but not without a consequent amount of work, especially to convert the sprites and tiles.

Plus, the process would probably require the use of a modified emulator (like gens) able to record which part of the roms are gfx and which parts are code & misc. data and a specific disassembler which would use such recorded database in order to disassemble, parse & extract the content correctly, such tools would be very helpful.
hitchhikr is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
EAB User Stats DH project.EAB 21 01 November 2009 23:18
KOASI Kick off 2 Stats stainy Amiga scene 0 02 February 2008 09:20
Gridiron 88 stats disks oolong request.Old Rare Games 3 05 June 2002 03:13

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08552 seconds with 13 queries