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: 11150
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 19:09
Frantic

Registered: Mar 2003
Posts: 1633
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: 11150
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: 16
So, let's publish that paper!
2014-11-11 07:53
Bitbreaker

Registered: Oct 2002
Posts: 501
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: 1633
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: 501
Implement a turing complete stack machine with those two opcodes :-P
2014-11-11 11:08
Cruzer

Registered: Dec 2001
Posts: 1048
Quoting Bitbreaker
Implement a turing complete stack machine with those two opcodes :-P
Can't be done since they can't branch.
2014-11-11 11:50
Perplex

Registered: Feb 2009
Posts: 254
Use TAS to store a branch opcode somewhere after the current program counter? :-)
2014-11-11 15:42
Cruzer

Registered: Dec 2001
Posts: 1048
Ok, if you're allowed to cheat like that. :)
2014-11-11 16:35
Mixer

Registered: Apr 2008
Posts: 422
Funny opcodes those LAS and TAS

TAS $fe00,y would let you insert any SP value on that page.
TAS $7e00,y would let you insert any SP value AND #$7f on that page, etc.

Sort of having an extra register.Except that SP gets replaced by A and X.

On the other hand perhaps this is a way to do 2 AND operations at the same time?

TAS ADDR,Y: ADDR=SP and ADDRHI+1, SP=A and X.

; perhaps when calculating and #$f8 and and #$07

ldy #$00
lda #$07
ldx ycoordinate,y
txs
tas $f700,y ; f700,y has Ycoord & F8 , SP has ycoord & 07
; perhaps use prepared stack, PLA here?
tas $fe00,y ; if this is correct, fe00,y now has ycoord & 07
;2+2+4+2+5+5

;$f700=y &f8, SP=Y &07

Same could be written without stackpointer like this.

ldy #$00
lax ycordinate,y
and #$f8
sta $f700,y
lda #$07
sax $fe00,y
;4+2+4+2+4+2

and with tables

ldy #$00
ldx yycoordinate,y
lda table1,x ; X and f8
sta $f700,y
lda table2,x ; X and 07
sta $fe00,y
;2+4+4+4+4+4
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
Inge/HVSC
iAN CooG/HVSC
Nova
CA$H/TRiAD
zscs
Razdee
christwoballs
St0rmfr0nt/Quantum
t0m3000/HF^BOOM!^IBX
Guests online: 131
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 No Bounds  (9.6)
7 Aliens in Wonderland  (9.6)
8 Comaland 100%  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 It's More Fun to Com..  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Veto  (9.6)
3 Facet  (9.6)
4 The Sarge  (9.6)
5 Carrion  (9.5)

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