Jump to content
IGNORED

6502 16 bit and 8 bit multiply by 16


Recommended Posts

I think it is a really bad idea to code anything with illegal OP codes. It won't be long before 65816s will be much more common than they are now and you are just killing yourself in that part of the market. If you need speed, the 65816 is your friend. Don't isolate yourself in the 6502C.

 

By the way: if you are doing things that wrap $0000, like LDA $FF30,X, consider that a 65816 with linear memory will access $100xx when you wrap, not $0FFxx like the 6502 does.

 

I have to agree. Remember the MyDOS fix we had to do, which cured the $0000 wraparound issue?

Link to comment
Share on other sites

I only run in emulation mode.

 

It acts that way in emulation mode. You only see it if you have the hardware to latch the upper byte (bits 16-23) of a 24-bit memeory access. (and, that it then selects a different address...) If you don't have the hardware for 24-bit addresses, then it appears to wrap back to $00000, but it isn't, really.

 

Linear memory and special 65816 OP codes are active in emulator mode.

 

Bob

 

 

 

By the way: if you are doing things that wrap $0000, like LDA $FF30,X, consider that a 65816 with linear memory will access $100xx when you wrap, not $0FFxx like the 6502 does.

 

I've seen conflicting info on this. Is this true only in native mode or also in emulation mode?

Link to comment
Share on other sites

I think it is a really bad idea to code anything with illegal OP codes. It won't be long before 65816s will be much more common than they are now and you are just killing yourself in that part of the market. If you need speed, the 65816 is your friend. Don't isolate yourself in the 6502C.

 

I think, that You should use all power of Atari. undocumented codes works on all atari xl/xe, prog works faster, use it... will not work on 65816 in emulation 6502 mode? so what? use better emulator ;) maybe 65816 is not good enough in emulation 6502C? maybe better to use core in fpga with perfect 6502C emulation plus extra capabilities way better than 16bit 65816 ? :)

  • Like 1
Link to comment
Share on other sites

I think you are confusing an emulator with emulation mode in the 65816. The 65816 is a chip that replaces a 6502 and powers up in 6502 emulation mode, which should run all the 6502 functions for you. If you like, you may put the 65816 chip in native mode where expanded features are available, but a stock Atari OS will crash right away.

 

I don't do emulators.

 

If you have the resources to develop an FPGA that is better than a 6502C, I will be first in line to order one. Until then, I'll continue to use the existing chip upgrade, the 65816.

 

Bob

 

 

 

I think it is a really bad idea to code anything with illegal OP codes. It won't be long before 65816s will be much more common than they are now and you are just killing yourself in that part of the market. If you need speed, the 65816 is your friend. Don't isolate yourself in the 6502C.

 

I think, that You should use all power of Atari. undocumented codes works on all atari xl/xe, prog works faster, use it... will not work on 65816 in emulation 6502 mode? so what? use better emulator ;) maybe 65816 is not good enough in emulation 6502C? maybe better to use core in fpga with perfect 6502C emulation plus extra capabilities way better than 16bit 65816 ? :)

Link to comment
Share on other sites

If you have the resources to develop an FPGA that is better than a 6502C

 

 

why better? precisely like 6502C in emulation mode but better than 65816 in native mode.

 

 

I think you are confusing an emulator with emulation mode in the 65816.

 

 

sorry, I am layman - I see no differences between turbo card with 16 bit 65816 and FPGA (or even super duper CPU on turbo card). both in emulation mode can run 6502 code, both in native mode have extra capabilities. if does not work exactly like 6502C then may be this is 100% compatible with 6502 but not Atari's 6502C.

 

but not use 100% atari powers just because of not altogether compatible turbo card for me is no excuse. that's all.

Link to comment
Share on other sites

Although examples given here perhaps seek to tell a different story, I've never seen the world exactly set alight by the cycle / space savings of undocumented 6502 instructions. Being able to "branch always" is mighty useful, for example, but nine times out of ten I find I can rely on the status of the Z, V or C flags to obtain the same effect.

 

What are considered to be the most useful undocumented instructions, in real-world situations (i.e. situations where their widespread use can have a perceivable impact on overall program size and efficiency)?

Edited by flashjazzcat
Link to comment
Share on other sites

let's copy font to the screen...

 

 ldy #7
 ldx #$e0
 sec
start
 lda fonts,y
 sta screen,x
 txa
 sbc #$20
 tax
 dey
 bpl start

 

with undocumented:

 

 ldy #7
 ldx #$e0
start
 lda fonts,y
 sta screen,x
 txa
 sbx #$20
 dey
 bpl start

 

shorter and 18 cycle faster...

Edited by xxl
Link to comment
Share on other sites

What are considered to be the most useful undocumented instructions, in real-world situations (i.e. situations where their widespread use can have a perceivable impact on overall program size and efficiency)?

 

I don't use them (yet), but here is a good place to look for "real world" applications:

http://www.codebase6...illegal_opcodes

 

(nothing bad is going to happen if you click that link :) )

Link to comment
Share on other sites

Are you willing to break a feature (65816s) that you haven't even seen yet?

 

Do you want to be grouped in with the folks who threw out the PBI code because it wasn't being used for anything?

 

We should try to maintain all the functions that our Ataris were built with - even stuff like cassette code.

 

Look at all the trouble it caused because people didn't follow the book on OS calls...

 

Bob

Link to comment
Share on other sites

Why not release two versions? One fully optimized for the 6502 and one written for compatibility? I mean, we're talking 8-bit programs here not 50GB PC installs. If you really want to be clever, test for illegal opcodes and use a different routine based on their availability.

Link to comment
Share on other sites

lowly 6502 can only shift by 1 bit...

At least shifting A is only 2 cycles. If you're doing serious bit manipulations then some LUT's might be in order.

I agree. One of the requirements should be that multiplying by larger numbers won't take any longer to complete!

Link to comment
Share on other sites

  • 5 weeks later...

Unless there is some reason to use illegal opcodes, like fitting your routine into the NTSC vblank or something, using them, while making one feelclever is not a great idea, imo. One day someone is going to release a great 65816 upgrade that will have some uptake by the community. It's not clever to break forward compatibility for no significant reason.

 

Of course, this is a hobby and if using illegal opcodes to shave off a couple of bytes or cycles makes you happy, go for it!

Link to comment
Share on other sites

better build clever upgrades eg new Pasiu's card works fine width undocumented codes, if you want more power and 65816 onboard there is software swith to turbo mode.

 

so - dont't break compatibility with upgrades ;-)

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...