03 November 2018, 18:49 | #641 | |||||||||
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Quote:
Quote:
Quote:
We can take several lines there. Code:
ARCHIMEDES ARM2 8 4.5 MOMENTUM 21096 68020 20 6 42/40 68030 33 8 AMS/5000 80486 25 15 QI PCi 80386 25 5 VX FTserver 80486 25 15 6386E/33 80386 33 7.7 6386/25 80386 25 6.9 Code:
ARM 12 6.8 80386 25 6.9 80386 33 7.7 68030 33 8 ARM 25 14 80486 25 15 Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Wow! And where is your 68020 pi-spigot implementation? |
|||||||||
03 November 2018, 19:26 | #642 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Then it's wrong. Because the 68000 has a prefetch queue. Some SMC code could even fail because of this.
True. But it does not make your program header trick more valid. Then let's continue until all of them are removed. This is the only way to really remove biases. Why ? It shows that good OSes can be written with 680x0, that support useful operations, hence show its superiority. Is it my fault that old DOS is so poor ? And it was just to compensate for the fact you removed the program headers, to make things more fair. Something you can't use is sheer trickery but something you can (and others can't) isn't ? Yes it's called cheating. If given the same amount of implementation efforts and resources, then yes. But don't tell it to anyone. (Anyway i was just speaking about code density and for this it does not need to be fast.) I think you have it already. Now where is your 180 bytes 386 version ? |
03 November 2018, 20:39 | #643 | ||
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Quote:
Is to use the standard OS features a trick?! Quote:
You mentioned Basic. Of course, it is rather obsolete but some features of ancient Basics are quite interesting. For example, it is possible to use multiple NEXT for one FOR - it is unimaginable for modern PL. RESUME statement looks more powerful than modern TRY/CATCH technique. I have written full screen editors for several retro-platforms with such Basics, for example, http://litwr2.atspace.eu/bk/np4bk.html or http://litwr2.atspace.eu/notepad+4.html Indeed I had to use some ML to get a proper speed. |
||
03 November 2018, 20:55 | #644 | ||||
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
Quote:
Quote:
For an Intel x86 CPU in 16-bit mode, the most straightforward way to construct relocatable code is to load code+data to an address that is evenly disible by 16, set CS and DS to the start of the chunk of memory, and then jump to cs:<start offset>. The code must be written with the assumption that CS/DS point to the start of the loaded chunk. For a 68000 CPU, the most straightforward way to construct relocatable code is to load code+data to any address in memory, and then jump to <start offset within the loaded chunk>. The loaded code will need to use base-relative operations. For reads, 16-bit displacement relative to PC will do. For writes, a separate register will need to be used as base pointer throughout the application (this can be set up by having a "lea 0(pc),a5" at the very beginning of the program), and the accesses will be 16-bit relative relative to A5. This means that creating a headerless executable format is feasible for both ISAs. No ISA is advantageous or disadvantageous when it comes to running relocatable code. What's more relevant then is, why does DOS support a headerless executable format whereas Atari TOS / Amiga OS / others do not? I think the answer here is in that DOS was originally designed for a much simpler execution model + it was explicitly designed to provide some CP/M compatibility. The Atari TOS & Amiga OS came later. They were more complex in nature. They did not strive to run CP/M software. Features like the OS being able to load a program section by section into different memory regions, automatically clearing the BSS sections, and programs being able to have debug information embedded into the executables, and good support for >64kB executables were important. Having support for a strictly headerless executable format, in addition to the regular executable format, was not worth it given that it would complicate the rest of the OS. And this means that... which OS happens to support a headerless executable format has little to do with the quality of the ISA. I suggest that if you want to debate relative merits of ISAs, then you leave the relative merits of OSes out of it. |
||||
03 November 2018, 21:31 | #645 |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
@Kalms Thank you very much for your very descriptive comment. However the keyword of it is the relocatable code. It is the DEC PDP-11 concept which proved not to be very useful. Headerless format for 68k has to use the relocatable code only. It puts a lot of limitations and makes code much larger. So it was never used with 68k.
|
03 November 2018, 21:31 | #646 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
You said it was "trickery" when i used them Quote:
You have headerless code ? Ok, so remove the 36-byte hunk data from my 236 bytes version and you get 200 - actually 198 as there are 2 padding bytes at the end. The code is fully position-independent so this is no loss. You have to open dos.library ? No, so remove "dos.library" string from my program and we're at 186. And i didn't count the code to open/close said lib... Of course you can still say you have a 180 byte version - which you didn't show - but then i could tell you that open/close library code easily removes more than 6 bytes and you're still beaten ). As you see, if we remove OS specific code - which we *have* to do to be really fair - you lose. |
||
03 November 2018, 22:29 | #647 | |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
Quote:
Relocatable code on 68k, where the addressing is within a 32kB memory area, is typically the same size, or smaller than, non-relocatable code. Where you would normally have a "move.l {location_of_global_variable},d0" with the relocatable code you would instead have a "move.l offset_of_global_variable(a5),d0". This saves opcode bytes and also executes quicker. The biggest limitation with relocatable code on 68k is that the relative addressing is 16-bit displacement. If you want to write relocatable code that addresses more than ~32kB then code size will increase significantly. This is very similar to the situation on DOS in 16-bit programs. I still don't see that the ISA would make a major difference here. I believe that the primary reason why headerless formats weren't implemented in Atari TOS / Amiga OS was because those OSes put the focus on supporting larger applications with more complex functionality. Last edited by Kalms; 03 November 2018 at 22:40. |
|
04 November 2018, 02:17 | #648 |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 372
|
Instruction prefetch on the 68k is hard coded. Each instruction, besides performing its primary operation, will prefetch the first word of the next instruction in the same way every time. This means that MULs and DIVs, despite having many idle cycles, will on only prefetch one word.
The 8086 has a more generic prefetch that operates whenever the data bus is idle. It's true that it isn't all that advantageous in some cases, but it fetches up to six bytes so the 8086 might prefetch anywhere from one to six instructions. Imagine how much faster 3d code might be if the 68k prefetched during MULs and DIVs. And that brings up one more advantage: instruction bandwidth. Single byte instructions are a huge win when memory access is relatively slow. |
04 November 2018, 09:23 | #649 | ||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,585
|
Quote:
DIVS on 68000 takes 120-156 cycles to complete. How many other instructions could realistically be queued up in that time? And they still have to be executed, which generally takes about the same time (or longer) as fetching. The only case where there might be a big speedup is when the bus is much slower than the CPU, but the 68000 was never so fast that a well designed memory subsystem couldn't keep up with it. Quote:
Problem is you can't encode much into a single byte, so you end up needing multiple bytes to do many operations that could be encoded in a single word, and instructions become split over word boundaries which requires a deeper prefetch queue and more complex control. To be effective the opcode lengths need to be carefully chosen to match usage frequency, and that can result in a messy non-orthogonal ISA. The Z80 is a 'good' example of messing this up. Its single byte opcode map is full of LD r,r instructions which aren't used that often and are not very powerful, while extended instructions that could do with a speedup are nobbled with prefix bytes. LD r,(IX+d) seems like a great idea until you realize that it takes 6 bytes and 10 memory cycles to load a 16 bit register, whereas the direct equivalent ld hl,(nnnn) only needs 3 bytes and 5 cycles. That kind of performance hit really takes the fun out of using index registers on the Z80! |
||
04 November 2018, 11:01 | #650 | |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Quote:
|
|
04 November 2018, 11:54 | #651 | |
Registered User
Join Date: Mar 2016
Location: Ozherele
Posts: 229
|
Quote:
Code:
MOVE.L #index,A0 MOVE.L table(A0),D0 |
|
04 November 2018, 12:51 | #652 | |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,001
|
Quote:
lea index(pc),a0 Your example isn't relocatable. |
|
04 November 2018, 19:53 | #653 |
Banned
Join Date: Sep 2016
Location: UK
Posts: 2,917
|
I just want to point something out that kinda irritates me with 68K. People have said that 68K assembler is 100% portable between assemblers.. but I find thats simply not true.
For example. If you grab the code for this driver. http://aminet.net/package/comm/misc/8n1 It has instructions that perform bit test and set operations on data registers which the coders assembler seems to have translated to different opcodes. For example Code:
bset.b #5,d1 BSET ~ (<bit number> of Destination) ? Z; 1 ? <bit number> of Destination BSET Dn,<ea> BSET # <data>,<ea> I am guessing it gets translated to or.b #(1<<5), d1 But like i say.. its not 100% between assemblers. This is the tip of the iceberg when using a strict assembler. |
04 November 2018, 20:01 | #654 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
|
Every 68k Amiga code stored fully in chip or fast memory can be fully relocatable.
|
04 November 2018, 20:04 | #655 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
|
Quote:
Some assemblers dont like extensions for bset.b, bset is correctly. Others examples unlk.w when unlk is ok, moveq.l when moveq is enough etc. |
|
04 November 2018, 20:52 | #656 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
04 November 2018, 20:58 | #657 |
Banned
Join Date: Sep 2016
Location: UK
Posts: 2,917
|
I think 68K is pretty much entirely relocatable except for long-jumps (and jsr)? Which is what the relocation table is for in AmigaOS. Everything else is trivial to make relocatable because you can load addresses relative to the PC. normal branches are all relative. Its the jumps to distant code that seem to screw up relocation. Although i bet there are ways round that i've just never bothered to use because hunk took care of it for me.
|
04 November 2018, 21:05 | #658 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Any and all Amiga code can be made 100% relocatable. It can lead to slightly larger code though when having to do relocatable code which accesses a different section for example as a bit of hunk trickery is required. |
04 November 2018, 21:14 | #659 | |
Banned
Join Date: Sep 2016
Location: UK
Posts: 2,917
|
Quote:
I'm not contesting it cant be done.. just cant see how. |
|
04 November 2018, 21:22 | #660 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
You can't jump directly so at least one helper instruction is needed. If dealing with different sections the segment list provides necessary info. |
|
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 |
|
|