15 June 2017, 13:29 | #1 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
MC68000 series tutorial series
Hello everyone,
I have begun writing a series teaching 68k assembly from the basics and will eventually move onto Amiga specific coding. If you're a beginner then feel free to check out part 1 here and if you want to get updated to more parts feel free to follow me (you'll need a free account to follow me). And while you're there, you can all make money by simply making posts or even commenting on other people's posts. Every single up-vote you receive from a person gets you real money, even if its just a comment you made on someone else's post. This site is going to be bigger than Reddit! It's really exciting actually. You guys can also feel free to share your wisdom on there too if you want. https://steemit.com/programming/@sac...part-1-revised Last edited by Nightfox; 08 July 2017 at 00:53. Reason: Linked to revised article |
16 June 2017, 11:04 | #2 |
Registered User
Join Date: Jul 2016
Location: Sydney / London
Posts: 589
|
That was interesting indeed. Cheers.
|
16 June 2017, 14:06 | #3 |
Registered User
Join Date: Jan 2017
Location: Den Haag / Netherlands
Posts: 193
|
|
16 June 2017, 15:52 | #4 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
|
Thanks! I'm very interested but the link gives an error.
|
17 June 2017, 10:17 | #5 | ||
Fanatically Amiga.
Join Date: Apr 2002
Location: Melbourne, Victoria, Australia
Age: 54
Posts: 1,557
|
Hi Nightfox...
I posted here but not on that new forum.. I am in no way a coder, but I know enough about chips, in your first article, you are explaining about the instructions (Mips, Instructions per second) versus Mhz (Frequency of operation). Quote:
The 68000/8 (8Mhz) will in NO WAY IN HELL run at 8 MIPS, because you are limited by how many instructions you can execute, in any one given clock cycle. To say that the CPU is efficient to execute one instruction per cycle, is at a push optimistic. the 68000, you might be VERY LUCKY, if your code is optimized, to get away with an instruction every 4 cycles. the official documentation puts the 68000 at around 0.175 instructions per cycle, which gives you roughly 1.3 Mips at 8Mhz. Moving up to the 68030, which is an optimized 68020 core, you are pushing maybe 9Mips at 25mhz. (Official docs put it at about 0.36 instructions per cycle, notice its more efficient than the 68000). But then, this is where things get really bloody funky, the 68060, is rated at 1.33 instructions per cycle, more than 1:1, at about 110 Mips at 75Mhz. Fast forward from the 80's and 90's, CPU's are *VERY* efficient, with the I7 rated at 106:1 (10.6 Instructions per cycle) so.... 317,000 Mips at 3Ghz. Its all about the efficiency of instructions per cycle (Where on the cycle, and how many), and in the 68000 series, no where near 1:1. Quote:
The 68070 was never produced, but was licensed by, and used by Philips, in its CD/I, and because it was produced by Philips, it was never an official Motorola line. Motorola always released in Evens (000, 020, 040, 060), with odds (010, 030, 050) being revisions of the parent core. 68000 - 68010 (I had one, at 12Mhz with the only beneficial instruction used by WHDLOAD to execute the QUIT command back to DOS), 68020 - 68030, 68030 was MORE popular, it was majorly used in MAC's, as well as a lot of Cisco routers at the time, which is why, if you look for a 68030, try to get a hold of an Apple Mac (with the built in monitor), or a Cisco 2500 Series. Last edited by whiteb; 17 June 2017 at 10:50. |
||
29 June 2017, 22:26 | #6 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
Thanks for the info whiteb. It seems the link is indeed working.. it works for me. Part 2 is up and available here: https://steemit.com/programming/@sac...utorial-part-2
|
30 June 2017, 01:40 | #7 | |
Fanatically Amiga.
Join Date: Apr 2002
Location: Melbourne, Victoria, Australia
Age: 54
Posts: 1,557
|
Quote:
it also sort of backs up my argument about not getting 1:1 instruction per cycle on an MC68000. 2 lines, 16 cycles.. so an average of 8 cycles per instruction. (ouch). So we jump to the final example, of 7 instructions, at 56 cycles. See how we are not getting one instruction per cycle ?, so, yeah, no way in hell are you gonna get 1mips at 1Mhz out of an MC68000. again, an instruction per 8 cycles. also, move.b #5,d0 (moving a single byte in to d0) you are better off moveq #5,d0. 4 cycles faster. the full 7 instructions executes in 52 cycles, not 56. (See.............. You taught me something) Sorry for being picky Last edited by whiteb; 30 June 2017 at 03:08. |
|
30 June 2017, 02:49 | #8 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
|
|
30 June 2017, 10:08 | #9 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
This is how I always understood 68k clock timings (maybe I'm wrong but it made sense to me when I was learing about this stuff and it stick in my memory)...
You could say that it takes 1 minute to complete something, but you could also say it takes 60 seconds. It's the same amout of time but the numbers are very different, and the latter is more future proof (if your current cpu takes 1 cycle, does you nextgen cpu take 0.3333 cycles? sure it does, but all these timings written as fractions is annoying at the least). Now about 68k... Its internal clock is 2x external, right? So basically you multiply all cycles by 2. And since it has no pipelining, it does fetch/execute/fetch/execute/... So you could say fetch is (2x)1+ cycles, execute is another (2x)1+ cycles. So there you have your super simple instruction, taking 1 cycle on some other cpu, taking 4 'cycles' on 68k. |
30 June 2017, 16:00 | #10 | ||
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
Quote:
|
||
01 July 2017, 02:14 | #11 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
I will be sure to mention the point in part 3 in basic form. I don't want to overwhelm the learner with technical information
|
06 July 2017, 21:23 | #12 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
|
06 July 2017, 21:37 | #13 |
Registered User
Join Date: Nov 2014
Location: Norway
Posts: 387
|
Just noticed this tutorial. Very well made, thanks
|
06 July 2017, 21:49 | #14 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
|
07 July 2017, 15:23 | #15 |
EAB fan
Join Date: Apr 2013
Location: Slovenia
Posts: 29
|
Hello Nightfox,
just wanted to point out an error in Part 1 / Hexadecimal section where you convert $A4F5 to decimal and you get 1013 as a result (5 + 240 + 128 + 640 = 1013) - should be 42229 (1x5 + 16x15 + 256x4 + 4096x10). Other than that, thumbs up for the series, nicely done and very welcome to everyone that wants to start learning asm |
07 July 2017, 15:40 | #16 | |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
Quote:
|
|
07 July 2017, 23:27 | #17 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
I have put in a revised version here. https://steemit.com/programming/@sac...part-1-revised
Unfortunately it won't let me edit the original post... but I have posted the revised version and will link to that one from now on. Thank you everyone for correcting my stupidity. |
07 July 2017, 23:58 | #18 |
Registered User
Join Date: Aug 2007
Location: USA
Posts: 359
|
Thank you for taking the time to do this!
|
08 July 2017, 00:49 | #19 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Valhalla Series | BippyM | project.Maptapper | 20 | 28 June 2013 15:49 |
Wanted PD-series | RiSe | request.Other | 3 | 02 October 2012 14:29 |
slowdown in 1.4 series (and more) | DanielCordell9 | support.WinUAE | 7 | 01 September 2007 14:00 |
17-Bit Series | jasonver2.0 | project.TOSEC (amiga only) | 7 | 11 September 2006 13:53 |
Valhalla-series | Bamiga2002 | Games images which need to be WHDified | 10 | 03 March 2006 20:38 |
|
|