6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 18, 2024 12:12 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Jun 15, 2022 10:25 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
Dropping this here in case anyone is wondering about how the 65816 has no TAB or TBA instruction. I figured this was a good opportunity to learn how to create synthetic instructions/macros. This is what I came up with:

Code:
; TAB (13 cycles)
     ;nvmxdizc
SEP #%00100000
TAX
XBA
TXA
REP #%00100000

;Non index-clobbering TAB (16 cycles):
     ;nvmxdizc
SEP #%00100000
PHA
XBA
PLA
REP #%00100000

;TBA (16 cycles)
     ;nvmxdizc
SEP #%00100000
XBA
TAX
XBA
TXA
REP #%00100000

;Non index-clobbering TBA (19 cycles):
     ;nvmxdizc
SEP #%00100000
XBA
PHA
XBA
PLA
REP #%00100000


The index clobbering versions can easily be made to work with Y instead. Are these routines as fast as they can be?


Last edited by jeffythedragonslayer on Sat Jun 18, 2022 7:00 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 16, 2022 5:13 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8190
Location: Midwestern USA
What exactly do the mnemonics TAB and TBA mean, and what are you trying to accomplish?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 16, 2022 5:22 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 270
Location: Placerville, CA
Transfer A to B, I'd presume.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 16, 2022 6:28 am 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
I read a Visual Basic 6.0 book once that said unless your hardware drinks soda, it does not hiccup. I believe ghost/phantom interrupts are a counterexample to this, so my synthetic TAB instruction allows the 65816 to consume soda to generate more ghost/phantom interrupts.

*joke mode off* Yes, they transfer the low and high bytes of the accumulator to each other. I'm just having fun :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: