20 October 2018, 20:12 | #541 | ||
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Hi there
Thanks a lot for the comments. I meanwhile have published a 6502's part - https://litwr.livejournal.com/2773.html - I will be very happy if someone finds it interesting but beware it is emotional. @meynaf I have just spent several minutes and made my 386 code 386 bytes in size (it is uploaded to The Zone!). So don't try to beat this with 68020 code, it may be wrong for a programmer health. I can make PR0000 much smaller and get maybe even 286 bytes. You cannot directly execute headerless code with Amiga so it is out of contest. Quote:
IBM PC was not very good but it was with open architecture which allowed cheap clones. Motorola on other side tried to rely rather on military contracts and other close architectures. Quote:
x86 was the best in the proper time. It was the best when IBM needed a CPU. It was the best when time was come to use fast 6502-like hardware. Indeed, today x86 is among the best because of huge Intel's resources but it was being a long struggle for this position. x86 has been not perfect but well balanced between the current requests and future requirements. 68k was having the temporary leadership sometimes but the history knows the words of Chuck Peddle "And you know that the 6800 isn't the right one. It's too big." and the reply of Bill Mensch "Right, Chuck, I know it's too big." IMHO it is true for 68k as well. Last edited by litwr; 20 October 2018 at 20:42. |
||
21 October 2018, 02:17 | #542 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Quote:
Code:
'pi-imbpc.com' is not recognized as an internal or external command, operable program or batch file. Guess I will just have to boot with a DOS disk. Luckily I have an old MSDOS 6.2 boot disk (set up for PC-Task on the Amiga) and a bootable floppy drive in my PC. Oh damn, now it won't recognize my hard drive! Can't be bothered booting back into Windows just to get the file onto the floppy, so... Plan B - put MSDOS disk in Amiga 1200, copy file onto it, run PC-Task to emulate X86, boot off floppy, type 'pi-imbpc.com'. Success! 1000 digits of Pi calculated and displayed in only 4.65 seconds! And how many bytes of X86 code did my 'PC' need to do this? Code:
A:\>dir /a Volume in drive A is DOS622 Volume Serial Number is 1164-14E8 Directory of A:\ 31/05/1994 06:22 a.m. 40,774 IO.SYS 31/05/1994 06:22 a.m. 38,138 MSDOS.SYS 31/05/1994 06:22 a.m. 54,645 COMMAND.COM 31/05/1994 06:22 a.m. 66,294 DRVSPACE.BIN 21/10/2018 06:34 a.m. 386 PI-IBMPC.COM 5 File(s) 200,237 bytes 0 Dir(s) 527,360 bytes free |
|
21 October 2018, 03:45 | #543 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Quote:
But not for everyone. I bought my first Amiga (an A1000) in 1987. A short time later I bought my first PC, an IBM JX. A nice looking machine, but technically inferior to the Amiga in every way. From it I learned about PC architecture and X86 machine code, neither of which compared well to the Amiga. On real-world tasks the 8088 was even slower than the Z80 in my Amstrad CPC664, and its quirky machine code was difficult to work with. But hey, it was made by IBM so it must be the Best! If only IBM had waited a little longer until the 68000 was ready, the PC would have gotten a much better architecture (real 16/32 bit CPU, proper 16 bit bus, 16 Megabyte flat address range with no 640k limit, no need for EMM/XMS etc.) and Intel's kludgey little con job (yes, those are 8 bit opcodes and an 8 bit bus - but it really is a 16 bit CPU, honest!) would have remained a curiosity. |
|
21 October 2018, 10:31 | #544 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Remember, I got 408 bytes by doing the same. Remove the hunk data (36 bytes) and you get 372, smaller than your 386 bytes. And this is still counting the huge dos.library stuff ! For code density you have one single, biased example. It is biased because of OS differences. And on top of it, you use the "features" of ms-dos (headerless code, direct text output) but you refuse me to use those of AOS (vprintf). I gave two examples. One is direct code that you were unable to rewrite shorter. What did you say about it ? That it was a "special case" ? Why it's not your code that's the special case instead ? The other is a whole, big program that you can attempt to disassemble if you want. And from Don Adan's experience it's just one among many. Sorry, but you have to either accept reality or try to build another example... |
|
21 October 2018, 12:50 | #545 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Quote:
Can you manage 372 bytes (or less) under those conditions? Show us your code. Can litwr do better? |
|
21 October 2018, 15:38 | #546 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Bruce, STOP MAKING SENSE! Only mickey mouse logic is allowed in this benchmark.
|
21 October 2018, 17:16 | #547 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
|
|
21 October 2018, 17:45 | #548 | ||
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Quote:
Quote:
IBM did things in time, Intel and Acorn too, but superior Moto liked to be waited. However time is equal for everybody. I can think (excuse me if I am wrong) that according to your logic IBM should have waited for DEC V-11 chip which had very wide ISA or maybe NS 32016 - they are true 32-bit chips. @meynaf Where is your code? I suspect that it is not fair again. |
||
21 October 2018, 20:57 | #549 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Who's not fair here - and again ? Not me. Why would i give you any code now ? You cheated by just every possible mean, inventing rules that just arrange you.
First accept Bruce Abbott's challenge. Then we can talk. |
21 October 2018, 21:37 | #550 |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
@Bruce Abbott I am very confused that PI-IBMPC.COM doesn't work with your system. I have just checked it with my 32-bit Microsoft Windows XP under VirtualBox under 64-bit Linux (I have kept this XP since 2003) - it works perfectly. Then I tried to do the same with my native 64-bit Microsoft Windows 10 - it doesn't work because it is a 32-bit application. So COM-format is still quite relevant but, of course, rather obsolete.
Why not you? You haven't published your code and I have. I claimed the result and published the proof, but you only claimed something. |
21 October 2018, 22:50 | #551 |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
My experience from developing for 8088-80286 is that for smaller programs - that is, programs that fit into a single 64kB segment, and where data would fit into a few 64kB segments - such that each 64kB segment contained data for a distinct purpose - then the assembly was alright. You would be able to express what you wanted, most of the time. Code density was reasonable.
Operations would take somewhere around 2-2.5 bytes / instruction on average. I don't recall what the per-cycle performance of those processors ended up like, but based on some of the timings in litwr's example code it looks like operations on those processors started out at 2c for the simplest operations, going upward from there. Simple instructions on x86 would take fewer cycles than simple instructions on 68000. I don't remember how memory subsystem performance of a typical XT PC would affect these numbers. Where the 16-bit assembly model broke down was when general-purpose data didn't fit into a single 64kB block any more... or when the application needed more than 1MB working set. Once the data didn't fit into 64kB blocks any more, compiled languages didn't handle this well at all and this would usully result in lots more instructions for any pointer handling. Hand-crafted assembly could avoid most of the code bloat for a while, but eventually you would end up doing the same kind of treating all pointers as pairs of WORDs and always managing those. The increased work is twofold: both because of the lack of 32-bit loads/stores, but also because of the small number of segment registers, and the inability to specify literal 32-bit addresses. Addressing more than 1MB of memory, at least on PCs, was done via a cumbersome bank switching process. Using bank switched memory was really cumbersome - I never tried writing anything serious with it but moved straight to 32-bit 386 code instead. 386 code, in 32-bit mode, removed all the previously mentioned addressing problems. 386 code had a bit larger instructions than 8088-286 code. The 16bit/32bit prefix byte system inflated instruction sizes a bit. You would want to store any values you could in 16-bit format instead of 32-bit back then (to save on data cache bandwidth and overall memory usage) but do as much computations as possible in 32-bit format. Given that 32-bit assembly introduced more flexible EA calculations, and there was a decent instruction cache, you stopped trying to use AL/AX/EAX as one of the primary operands; this resulted in overall less convoluted code, but less use of the short forms of instructions. If I were to make a wild guess then I would guess that 386 code would end up somewhere at 2.5-3 bytes per instruction. This would make simple programs larger in 32-bit format, but large programs would not necessarily be larger for 386 because they would not need to do the "far pointer dance" all the time. 386 assembly code feels like it has roughly the same expressiveness as 68020 assembly code, just a couple fewer registers (which is not a huge problem in practice). I'm not sure what the PI calculation program is supposed to prove. It's a very small program so suitable both for 68000 and 8088. The calculation itself will be roughly the same set of operations for both processors. The executable header format, and how to invoke OS routines for I/O, has very little to do with the processors and more to do with the OSes. ...? Last edited by Kalms; 21 October 2018 at 23:00. |
22 October 2018, 00:22 | #552 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
Then, he claims that the differences he basically only managed to get due to OS specific features somehow mean that the ISA (not the OS & environment) is better for code density, because the 68k based example uses a different OS which conveniently doesn't support the features he uses to get the program to be so small. So yeah, it's a pretty meaningless comparison all things considered. |
|
22 October 2018, 01:45 | #553 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
Quote:
In order to make a real comparsion we would need a large number of examples of real world (not trivial) applications, each hand optimised (otherwise we could be comparing compiler optimisers rather than ISA efficency). And then if we do declare a winner, what then ? Nothing changes at all. |
|
22 October 2018, 02:01 | #554 | ||||||||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Quote:
Quote:
Quote:
Quote:
BTW I did have a hard drive on the A1000. It was 20MB Miniscribe 3.5" MFM drive with ST506 controller. I made an ISA bus adapter and wrote a device driver to make it work on the Amiga. No Autoconfig, but I patched the Kickstart disk so it could boot up from a reset-proof RAM disk (only had to boot from floppy at power-on). Quote:
Quote:
More recently I designed a multi-function expansion cart for the Mattel Aquarius. Code was cross-compiled on the PC and debugged in the Aquarius using the debugger ported from the Amstrad. For this project I wrote ~12,000 lines of Z80 assembly code. Quote:
From that time on the industry struggled with maintaining compatibility with the original PC while trying to work around all of its mistakes and limitations, because the one thing that guaranteed failure was not being 100% 'IBM' compatible. Was this because the PC architecture was better? No, just that once it gained a foothold in the marketplace nothing else could compete. The combination of 'nobody ever got fired for buying IBM' and a design that anyone could reproduce was unbeatable. Quote:
In truth the original PC was a dog - over-priced, under-powered, and lacking the features required for business applications (16-64k RAM, a cassette interface, BASIC in ROM, color video output to a TV - what were they thinking?). But IBM virtually open-sourced the design (again, what were they thinking?) and you could put anything in those slots. |
||||||||
22 October 2018, 02:48 | #555 | |||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Quote:
Quote:
Agreed on the compiler. 8 bit CPUs like the Z80 suffer badly, while PCs have the advantage of more mature compilers. Comparing hand-optimized assembly takes away that level of uncertainty. Quote:
|
|||
22 October 2018, 03:31 | #556 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
Quote:
Sure there are cases where you can have a useful tiny program with limited data, but that alone cannot be used as a test case to declare either ISA as having the overall best density. |
|
22 October 2018, 09:42 | #557 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
But ok, if you insist, i will redo it the old way. Perhaps better so it will be more humiliating for your beloved 386. Note that you may even take the 68k code yourself and do to it the same as what you did to your version... Anyway what you claimed is wrong. You did not in any manner document what features you have removed out of the program - actually you did not even say you removed anything ! Thus your claims suggests everything is there... So what did you do ? Remove time measurement code, remove the variable amount of digits, and pretend it's the same now ? Isn't that outright cheating ? However, why not instead do something better and remove all OS dependent code from the equation, as was suggested ? EDIT: done - spigot version in the zone, 236 bytes - outputs 1000 digits, does not use OS formatting routines. As you can see i can play your feature reduction game too. Last edited by meynaf; 22 October 2018 at 11:17. Reason: new spigot version done |
|
22 October 2018, 09:58 | #558 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
But compiler stuff isn't as meaningless as it looks. Knowing x86 compilers are usually somewhat better than 68k compilers, and that many x86 games have in average 1.5 times the code size (it's Don Adan's claim, not mine, but i have given a clear example previously), i think we already know the winner. Quote:
Quote:
Quote:
For the tiny, at least there is some competition and that alone makes it interesting. |
||||
22 October 2018, 14:15 | #559 | ||||
Registered User
Join Date: Jun 2015
Location: Germany
Posts: 1,918
|
Quote:
Quote:
Quote:
Quote:
|
||||
22 October 2018, 14:28 | #560 |
Banned
Join Date: Sep 2016
Location: UK
Posts: 2,917
|
x86 is not remotely close to RISC. Nor is 68K. Both are prime examples of CISC.
Why don’t you two just give up. This whole thread is pointless. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any software to see technical OS details? | necronom | support.Other | 3 | 02 April 2016 12:05 |
2-star rarity details? | stet | HOL suggestions and feedback | 0 | 14 December 2015 05:24 |
EAB's FTP details... | Basquemactee1 | project.Amiga File Server | 2 | 30 October 2013 22:54 |
req details for sdl | turrican3 | request.Other | 0 | 20 April 2008 22:06 |
Forum Details | BippyM | request.Other | 0 | 15 May 2006 00:56 |
|
|