14 January 2017, 17:33 | #21 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
MVZ would be one of the most useful addition to 68k. (I feel we're gonna derail to OT if going in this direction though...) |
|
14 January 2017, 17:37 | #22 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
It was actually my first choice, but had to settle for DateStamp. Seems fine for this purpose, though. This code times up to one day (more is easy enough): Code:
; ; get start time ; move.l #startTime,d1 jsr _LVODateStamp(a6) ; ; get end time ; move.l #endTime,d1 jsr _LVODateStamp(a6) ; ; calculate total time in seconds ; lea startTime,a0 move.l ds_Minute(a0),d0 mulu.l #60*TICKS_PER_SECOND,d0 add.l ds_Tick(a0),d0 ; ticks per day lea endTime,a0 move.l ds_Minute(a0),d1 mulu.l #60*TICKS_PER_SECOND,d1 add.l ds_Tick(a0),d1 ; ticks per day sub.l d1,d0 ; total ticks taken bgt .l2 neg.l d0 .l2 divul.l #TICKS_PER_SECOND,d1:d0 ; seconds add.l d1,d1 ; 1/100 seconds Last edited by Thorham; 14 January 2017 at 23:36. |
|||
14 January 2017, 17:54 | #23 |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
|
14 January 2017, 18:16 | #24 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
The resolution may not be sufficient for really fast systems if it's vertical blank based, because the resolution will only be 1/50 seconds. Same problem with the timer code I just posted.
Just checked to OS documentation, and you can still get seconds + microseconds from timer.device. It's just more annoying than on V36+. |
14 January 2017, 18:27 | #25 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Of course but then we can just return to 32-bit. There would be a small speed difference on 68030 because of data cache, but on 68020 it ought to be the same - just using more memory.
|
14 January 2017, 23:34 | #26 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Full program that accepts the number of digits as a command line argument (100 to 10000 digits) and prints the time it took in seconds with a resolution of 1/10000 seconds. Max running time that's timed correctly is around 4.5 days.
Benchmark for a 50 mhz 68030: 100 digits: 0.0523 seconds 1000 digits: 1.5863 seconds 3000 digits: 12.7265 seconds Edit: Cleanup code bug fix Code:
; ; PI spigot, 68020+ Kickstart 1.2+ ; incdir "asminc:" include "dos/dosextens.i" include "lvo/lvos.i" execBase equ 4 start ; ; save pointer to command line argument ; move.l a0,a2 ; ; add message port for timer device ; move.l execBase,a6 lea timerPort,a1 jsr _LVOAddPort(a6) ; ; parse argument ; clr.l d0 clr.l d1 .loop move.b (a2)+,d0 sub.l #"0",d0 blt .done cmp.l #9,d0 bgt .done mulu.l #10,d1 add.l d0,d1 bra .loop .done cmp.l #100,d1 blt exit cmp.l #10000,d1 bgt exit move.l d1,numDigits ; ; open dos library ; lea dosName,a1 jsr _LVOOldOpenLibrary(a6) move.l d0,dosBase beq exit ; ; open timer device ; lea timerName,a0 move.l #UNIT_MICROHZ,d0 lea timerIoRequest,a2 move.l a2,a1 clr.l d1 jsr _LVOOpenDevice(a6) tst.b d0 bne exit move.l IO_DEVICE(a2),timerBase ; ; handle number of digits ; move.l numDigits,d0 lsr.l #2,d0 mulu.w #14,d0 move.l d0,arraySize addq.l #1,d0 lsl.l #2,d0 add.l numDigits,d0 addq.l #2,d0 move.l d0,memSize ; ; allocate array and string memory ; move.l memSize,d0 clr.l d1 jsr _LVOAllocMem(a6) move.l d0,memBlock beq exit ; ; get output handle ; move.l dosBase,a6 jsr _LVOOutput(a6) move.l d0,stdOut ; ; setup array and string pointers ; move.l memBlock,d0 move.l d0,string add.l numDigits,d0 addq.l #2,d0 move.l d0,array ; ; get start time ; lea startTime,a2 bsr getTime ; ; fill array ; move.l array,a0 move.l #2000*10000,d0 clr.l (a0)+ move.l arraySize,d7 subq.l #1,d7 .loopa move.l d0,(a0)+ dbra d7,.loopa ; ; spigot loop ; lea decTable,a4 move.l string,a5 move.l array,a2 move.l #10000,d6 clr.l d4 move.l arraySize,d7 .loopb clr.l d0 move.l d7,d1 lea 4(a2,d1.w*4),a1 add.l d1,d1 subq.l #1,d1 bra .l1 .loopc sub.l d5,d0 sub.l d3,d0 lsr.l #1,d0 mulu.w d6,d3 move.l d3,(a1) .l1 add.l -(a1),d0 move.l d0,d5 divul.l d1,d3:d5 subq.l #2,d1 bgt .loopc mulu.w d6,d3 move.l d3,(a1) ; ; write digits to string ; divul.l d6,d3:d0 add.l d4,d0 divu.w #100,d0 move.w (a4,d0.w*2),(a5)+ swap d0 move.w (a4,d0.w*2),(a5)+ move.l d3,d4 sub.w #14,d7 bgt .loopb ; ; print PI digits ; move.w #$0a00,(a5)+ ; line feed and end of string move.l dosBase,a6 move.l stdOut,d1 move.l string,d2 move.l numDigits,d3 addq.l #2,d3 jsr _LVOWrite(a6) ; ; get end time ; lea endTime,a2 bsr getTime ; ; calculate total time in 1/10000 seconds ; this allows a run time of 4.5 days ; lea endTime,a0 move.l TV_SECS(a0),d0 move.l TV_MICRO(a0),d1 divul.l #400000,d4:d0 divu.l #100,d1 mulu.l #10000,d4 add.l d1,d4 lea startTime,a0 move.l TV_SECS(a0),d2 move.l TV_MICRO(a0),d3 divul.l #400000,d5:d2 divu.l #100,d3 mulu.l #10000,d5 add.l d3,d5 sub.l d5,d4 ; total number of 1/10000 seconds bge .l2 ; do abs to handle time looping back to neg.l d4 ; zero when max OS time has been reached .l2 ; ; print total time in seconds.1/10000 seconds ; lea timeStringEnd,a0 lea decTable,a1 move.w #$0a00,-(a0) ; line feed and end of string divul.l #100,d2:d4 move.w (a1,d2.w*2),-(a0) divul.l #100,d2:d4 move.w (a1,d2.w*2),-(a0) move.b #".",-(a0) ; decimal point .loope divul.l #10,d2:d4 add.b #"0",d2 move.b d2,-(a0) tst.l d4 bne .loope ; write "\ntime: " to string move.l #"me: ",-(a0) move.w #"ti",-(a0) move.b #10,-(a0) ; print string move.l stdOut,d1 move.l a0,d2 move.l #timeStringEnd,d3 sub.l a0,d3 subq.l #1,d3 jsr _LVOWrite(a6) ; ; cleanup and exit ; exit move.l execBase,a6 lea timerPort,a1 jsr _LVORemPort(a6) move.l dosBase,a1 tst.l a1 beq .l1 jsr _LVOCloseLibrary(a6) .l1 move.l memBlock,a1 tst.l a1 beq .l2 move.l memSize,d0 jsr _LVOFreeMem(a6) .l2 tst.l timerBase beq .l3 lea timerIoRequest,a1 jsr _LVOCloseDevice(a6) .l3 rts ; ; getTime ; ; in: ; ; a2 = time val structure ; getTime movem.l d0-a6,-(sp) move.l execBase,a6 lea timerIoRequest,a3 move.w #TR_GETSYSTIME,IO_COMMAND(a3) move.l #timerPort,MN_REPLYPORT(a3) move.l a3,a1 jsr _LVODoIO(a6) lea IOTV_TIME(a3),a3 move.l TV_SECS(a3),TV_SECS(a2) move.l TV_MICRO(a3),TV_MICRO(a2) movem.l (sp)+,d0-a6 rts ; ; data ; section data,data_p dosBase dc.l 0 timerBase dc.l 0 memBlock dc.l 0 timerIoRequest dcb.b IOTV_SIZE timerPort dcb.b MP_SIZE decTable dc.b "00010203040506070809" dc.b "10111213141516171819" dc.b "20212223242526272829" dc.b "30313233343536373839" dc.b "40414243444546474849" dc.b "50515253545556575859" dc.b "60616263646566676869" dc.b "70717273747576777879" dc.b "80818283848586878889" dc.b "90919293949596979899" dosName dc.b "dos.library",0 timerName dc.b "timer.device",0 ; ; bss ; section data2,bss_p stdOut ds.l 1 numDigits ds.l 1 arraySize ds.l 1 memSize ds.l 1 array ds.l 1 string ds.l 1 timeString ds.b 32 timeStringEnd startTime ds.b TV_SIZE endTime ds.b TV_SIZE Last edited by Thorham; 15 January 2017 at 10:25. |
14 January 2017, 23:42 | #27 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
http://www.apollo-core.com/knowledge.php?b=1¬e=1943 |
|
15 January 2017, 02:08 | #28 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
|
15 January 2017, 08:58 | #29 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
He doesn't care about code density, he doesn't care about programmability, and he even resurrected a bug that was fixed in 68010 (which wasn't needeed at all even for 68000 compatibility). His cpu can't work without rom patches. Not my definition of a 68k god. What he did appears great, but who do we have to compare him with ? |
|
15 January 2017, 09:35 | #30 | |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Quote:
4.5 days mean more than 500000 digits! However 32-bit values in the array will allow only about 60000 correct digits - it is less than 2 hours. Last edited by litwr; 15 January 2017 at 09:40. |
|
15 January 2017, 10:18 | #31 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
1000 digits: 2.12 seconds 3000 digits: 13.28 seconds Not a big difference. Probably caused by printing during the spigot loop. My program builds a string, then prints it when the spigot loop is done (included in the timing). Saves a bunch of syscalls, and writing to the console is slow. The multiply and division take up most of the time, so shaving a few instructions off isn't going to make much of a difference. It's a bit much, yes, but it just comes from the way the time is handled. 400000 seconds at a resolution of 1/10000 seconds = 4000000000, which fits nicely in 32 bits. |
|
15 January 2017, 12:26 | #32 |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Thank you very much again. Your results show that the Intel's engineers did their job a bit better than the Moto's. Only ARM could compete with Intel after 80286...
BTW. Old BBC Micro uses 5 bytes (40 bits) for its timer with the resolution of 1/100 sec. So it allows to keep time for more than 300 years! 6502 rules! IMHO Motorola got a kind of bad karma after it helped to destroy MOS Technology. Excuse me a bit lamer question but I had Amiga-500 only at 1989-90 and mostly for games. Is there a proper way to clear CLI screen? I'm using Ctrl-L, it works but makes irritating ": Unknown command" message. Last edited by litwr; 15 January 2017 at 19:36. |
15 January 2017, 21:46 | #33 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Re:clear console
There is an escape code aliased in shell-startup that can be invoked by the clear command, assuming you're using a shell rather than a CLI prompt. |
15 January 2017, 21:59 | #34 | |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Quote:
|
|
15 January 2017, 22:14 | #35 | |||
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
Quote:
The old x86 clone character mapped displays were certainly faster but it was bitmapped graphics displays which eventually won out. The Amiga in particular was slow to move to chunky graphics and update their custom chips and memory to be faster. The AmigaOS was not well optimized in those days either. There is a new layers.library for the newest version of AmigaOS which is some 20% faster and I have been able to optimize it for about another 10% for example. There are gfx cards and FPGA custom chips which remove the major gfx bottlenecks. C= didn't want to uncork the Amiga because they were too cheap and instead wanted another C64. The Amiga was in many ways ahead of its time and better than anything else out there but their management was clueless and did practically nothing with it. Quote:
Alias cls "echo *Ec" Oddly, typing "echo *Ec" still gives the ": Unknown command". You should be able to add the cls alias if it is not in the older AmigaOS anyway. What is the 2 instruction sequence for "MVZ.B D0" then? It looks to me like it would need 3 instructions, 2 registers and 6 byes of code to do the same thing as this 1 instruction, 1 register and 2 bytes of code. Last edited by matthey; 15 January 2017 at 22:21. |
|||
15 January 2017, 23:55 | #36 | |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Quote:
To answer your question, is that it is a trick question. Zero extension of a register in place was never supported by the Apollo core. I can do it in one opcode and no temporary register. ANDI.L #$FF,D0 still takes 6 bytes though. |
|
16 January 2017, 01:03 | #37 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
1) All 68k cores using this enhanced ISA had code fusion 2) Code fusion was possible 100% of the time 3) Compilers, especially superscalar schedulers, were programmed to handle fusion sequences correctly (Adds complexity to the compiler where MVS/MVZ simplifies compilers, especially with a shared 68k/CF backend which is common) 4) You really don't care about code density or you consider my "OP.L #<data>.W,Dn" addressing mode good enough (it can't handle every case and MVS/MVZ often gives better code density) IMO, it is a similar fallacy as trying to move most of the complexity out of the processor and into the compiler. That worked out great for RISC processors like PPC didn't it? |
|
16 January 2017, 03:05 | #38 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
|
16 January 2017, 04:53 | #39 | |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Quote:
|
|
16 January 2017, 09:24 | #40 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Yea, this is what they say. But it's not easy to debug and test something that's disabled... Quote:
Note : Gunnar has support for MVS fusing only unless i'm mistaken, and the case for MVZ is more common... No, the real reason is that he needed the encoding space for his 64-bit stuff (which can be made by fusing as well, but this is another story). Quote:
Quote:
8086 traces back to 1977 and was inspired by 8080 which is... well, more ancient. |
||||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Maniac Mansion Demo Disk - Onslaught releases the demo of a classic for C64! | Neil79 | Retrogaming General Discussion | 0 | 16 January 2015 10:40 |
Yet another "plz help me find a demo" thead! AGA demo w/ texturemapped building | ruinatokyo | request.Demos | 1 | 26 September 2013 16:29 |
Jason Lowe and The Mathematical Reflex Test | jedk | Retrogaming General Discussion | 5 | 30 January 2013 02:13 |
Old Amiga Demo Wanted -- Music Track "The last ninja demo" | scribbleuk | request.Demos | 13 | 23 April 2012 13:35 |
CU Amiga #75/Simon The Sorcerer Demo + CU Amiga #99/Amazon Queen Demo | MethodGit | request.Old Rare Games | 12 | 16 February 2004 17:16 |
|
|