Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > useless opcodes riddle - wtf is up with LAS and TAS?
2014-11-07 23:10
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....
 
2014-11-10 08:17
doynax
Account closed

Registered: Oct 2004
Posts: 212
Quoting Martin Piper
Maybe 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.
2014-11-10 09:53
lft

Registered: Jul 2007
Posts: 369
Quoting Martin Piper
Maybe 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.
2014-11-10 10:17
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 =)
2014-11-10 13:44
Peacemaker

Registered: Sep 2004
Posts: 275
i call for an bruteforce ill. opcode tool that creates billions of combinations of routines and its results ;)
2014-11-10 19:09
Frantic

Registered: Mar 2003
Posts: 1648
Although I've used quite a few of the illegals I can only confirm what others have said about failing to find a sensible use for LAS and TAS. :)
2014-11-10 21:09
chatGPZ

Registered: Dec 2001
Posts: 11386
one thing i could think of... a clever combination of LAS $0100,y and TAS $0100,y with some other illegal(s) involving a shift operation to build a very fast pseudo random sequence generator. perhaps :)
2014-11-10 22:11
metalux

Registered: Aug 2011
Posts: 17
So, let's publish that paper!
2014-11-11 07:53
Bitbreaker

Registered: Oct 2002
Posts: 508
Quote: one thing i could think of... a clever combination of LAS $0100,y and TAS $0100,y with some other illegal(s) involving a shift operation to build a very fast pseudo random sequence generator. perhaps :)

one can at least do an and operation on an index with TAS (SP that is) and read the table via PLA then. But SBX #$xx + LDA table,x would do just as well then. Interesting is the feedback possibility in that TAS command, as the resulting SP is can again fed back into the next call/lookup. Just as with LAX ($xx,x). Still i could not think of any realworld example, either for LAS/TAS as well as for the mentioned lax variant. I finally successfully used SAX $xx,y yesterday however.
2014-11-11 08:55
Frantic

Registered: Mar 2003
Posts: 1648
Would be a nice coding compo. Come up with the best uses for those two opcodes. (I wouldn't spend time on that myself though, but I'd like to see the result of such a compo. :D )
2014-11-11 10:17
Bitbreaker

Registered: Oct 2002
Posts: 508
Implement a turing complete stack machine with those two opcodes :-P
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
zscs
ΛΛdZ
Doc Snyder/ONS
Brataccas/HF
Nuckhead/Backbone So..
iAN CooG/HVSC
tlr
Freeze/Blazon
Dano/Padua
Chesser/Blazon
REBEL 1/HF
wil
HOL2001/Quantum
Walt/Bonzai
Guests online: 130
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.058 sec.