| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
useless opcodes riddle - wtf is up with LAS and TAS?
Due to my emulator related activities in the last year(s) i digged more into the so called "illegal" opcodes, and the result is a nice (hopefully) PDF that i'll publish soonish (when some of you lazy bastards are done proofreading =D) - which includes complete state of the art reference to all of these, plus a bunch of real world examples on how to use these (sometimes very weird behaving) instructions... (in large part provided by bitbreaker, thumbs up!) Its about time for a comprehensive document on this topic that is suitable for normal people =)
however, two opcodes seem to be completely useless and so far i cant think of what to use them for in real world code:
- LAS abs,y ($BB) (A,X,SP = addr & SP)
- TAS abs,y ($9B) (SP = A & X ; addr = SP & addrhi+1)
if any of you have used these before, or for whatever reason have an idea on what to do with them - let me know please, this is your chance to earn some karma upgrade points :o)
(and as a sidenote, some not so obvious *short* snippets that are using SLO, RLA, RRA or ISC are welcome too)
let's bust some more myths! |
|
... 26 posts hidden. Click here to view all posts.... |
| |
doynax Account closed
Registered: Oct 2004 Posts: 212 |
Quoting lftAlthough it makes some assumptions about which vic bank is active, right? Yes, only banks 0 and 3 work and IRQ-safe switching eats 10 cycles over $dd02 fiddling.
Plus the 14-cycle response is pushing it, famously failing on the 1571DCR in 1 MHz mode. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
forgot: yes, only "real world" examples are useful, i HAVE used these opcodes in test programs (look in VICE repository) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
who would have though =) |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
The only thing I have used TAS for is for being impressed by how much stuff the CPU can do in 5 cycles. Too bad it's useless stuff. |
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
Maybe it's time for an optimising assembler that suggests replacement code by scanning for known instruction sequences. |
| |
doynax Account closed
Registered: Oct 2004 Posts: 212 |
Quoting Martin PiperMaybe it's time for an optimising assembler that suggests replacement code by scanning for known instruction sequences. I'm not convinced such a feature would be terribly useful unless the assembler had a fuller view of the semantics of the program, to separate side-effects from desired results.
Perhaps an emulator could be modified to report feedback on dead-stores/flags and the like. Plus with demo code coverage is largely a non-issue.
A super-optimizer would also be pretty neat, though the amount of complex immediates and tables in optimized 6502 code may put a damper on things. |
| |
lft
Registered: Jul 2007 Posts: 369 |
Quoting Martin PiperMaybe it's time for an optimising assembler that suggests replacement code by scanning for known instruction sequences.
Depends on the code. Often, the amount of cycles matters, and occasionally the amount of bytes.
But an optimising compiler for a high-level language should make use of illegal opcodes when it makes sense. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
i have played with both, super optimizer and pattern based optimizer some years ago... it didnt make a lot of sense for hand written asm code (ie, it almost never found something to optimize). for code generated by cc65 on the other hand it was somewhat useful =) |
| |
Peacemaker
Registered: Sep 2004 Posts: 275 |
i call for an bruteforce ill. opcode tool that creates billions of combinations of routines and its results ;) |
Previous - 1 | 2 | 3 | 4 - Next |