If several people are interested, I can provide a list of optimizations.
The best code I disassembled while I was on Oric was the game Painter (I remember I was very happy to find a small optimization in the code).
I also spent a lot of time disassembling the Basic ROM (from Microsoft), and optimized it.
On the Apple 2, the best code I found was the ROM, with the impressive debugger (which was shamelessly stolen in OricMon).
On the C64, I didn't disassemble a lot of code, but I think demos had very good code.
Ok, the first optimisation:
suppose you have to unconditionally skip 2 bytes, like:
ldx #1
bne skip
ldx #2
skip:
the trick is to use byte $2C (opcode of BIT $xxxx):
ldx #1
byte $2C
ldx #2
If you have one byte to skip, you can use byte $24 (BIT $xx)
JC
Optimizations
-
- Flight Lieutenant
- Posts: 322
- Joined: Thu Sep 21, 2006 7:45 pm
- Location: 26000 Valence, FRANCE
- Contact:
I'm not sure all those opcodes apply to the 6502A in the ORIC, do they ?
There is a list of those around.
Btw, I started a da65 info file to disasm the atmos rom:
http://revolf.free.fr/oric/atmosrom.zip
There is a list of those around.
Btw, I started a da65 info file to disasm the atmos rom:
http://revolf.free.fr/oric/atmosrom.zip
Yes, I know these links.mmu_man wrote:cf. http://www.6502.org/source/ for optimized code.
and http://www.6502.org/tutorials/
2 algorithms exist for multiplying two 16 bits numbers.
One shifts to the right, and the other one shifts to the left.
The interesting fact is that one of these 2 methods allow a multiplication by 40 with fewer instructions than the other (of course, it's slower than a table).
BTW, I also worked on optimizing the Basic ROM, and submitted some of my optimizations to this Basic:
http://members.lycos.co.uk/leeedavison/6502/ehbasic/
If you are interested, I have Fabrice Broche's book about the Oric and Atmos ROMs. I also was one of the first to disassemble the ROM of the disk drive (I intended to publish a book with other people). I may have some documentations about it.
JC