tgies: (Default)
[personal profile] tgies

Paging probably [livejournal.com profile] secretcow or [livejournal.com profile] korgmeister or I think maybe [livejournal.com profile] caladri I don't know


sei		; interrupt disable
cld		; disable stupid stupid decimal mode
ldx #%01000000	; a flag i'm about to stuff somewhere for my particular application
nop		; it doesn't matter what this is -- we always halt immediately after
		; the last cycle of the ldx. Because the world hates me.

Why the hell does this halt right after the ldx on a 65C802? It works fine on a 6502 or a Ricoh 2A03. It always halts at the first ldx I try to do, unless I leave out the interrupt disable. However, if I do that, it jumps into damn nowhere a bit later, because there's no way for me to have the interrupt table set up yet (not without my registers!), and I get an unavoidable interrupt on a timer unless I disable them. Basically, it looks like the 65C802 won't let me ldanything when interrupts are off! What the hell! The documentation didn't warn me about this! Does anyone know what is going on here?

It is worth pointing out that X does indeed appear to contain what I loaded into it, but it doesn't matter, because the processor unceremoniously breaks immediately upon completion of this instruction. Weird. And the 'C802 is supposed to be a drop-in replacement for the stupid '02!

Also today I learned that 6502 programmers are the worst about premature optimization holy damn. (And they all think that inx inx is a faster way to get X from $FE to $00 than ldx #$00, which is hilarious)

i got more than two problems

Date: 2008-02-28 11:49 am (UTC)
From: [identity profile] caladri.livejournal.com
Alas, I am not clueful about the 6502. It is one of my great shames. (The others being 68k, 88k and i960.)

Date: 2008-02-28 11:58 am (UTC)
From: [identity profile] tgies.livejournal.com
Does anything besides military avionics use the i960? I know the 68k and (to a lesser degree) the 88k, but I've been meaning to pick up the i960 at some point. I almost learned it when I switched my major to focus on avionics for about ten minutes, but then I switched back to CS for some stupid reason and never heard about it again.

ps the 88k is interesting because it's so damn weird and operates like something I designed when I was 8 years old but the 68k is actually a piece of trash and i hate it and i wind up using it all the time anyway

Remind me to tell the story about the time I tried to build a video game machine based on the 68k (it was actually basically a sega genesis/mega drive knockoff but don't tell anyone) and instead almost killed myself

Everyone should learn to use the stupid 6502 though. The fun way is to learn how to program the NES (6502 knockoff with no decimal mode) or the C64 (6510; actual differences minimal)
Edited Date: 2008-02-28 11:59 am (UTC)

Date: 2008-02-28 12:01 pm (UTC)
From: [identity profile] caladri.livejournal.com
I spent a while fucking around with GameBoy programming back in ye olden times (still have a rom burner somewhere, but who cares with as good as emulators are these days?) The 68k is useful in that so many people hold it up as the gold standard it never was (much like the ia64.) I really like how quirky the 88k is. There were some workstations built with the i960, and I think a lot of GSM base stations and the like, but I forget. I just thought it was amusing.

Date: 2008-02-28 12:10 pm (UTC)
From: [identity profile] tgies.livejournal.com
Workstations? Weird.

I messed around with the Game Boy a lot when I was like 14. I wrote one or two Game Boy Color games and a simple sound driver to play a compressed music format of my own design (I almost sold this code to some development studio under THQ, but it wound up not going through, though it looks to me like they used part of the damn code anyway). The hilarious thing is that I never actually had a dev cartridge setup, even though I always wanted one, because I was poor %D I wound up using emulators and being really careful to look for things in my code which would work on my emulator, but not on the real hardware.

Lately I have been playing around with the NES. I actually managed just tonight to discover a nifty graphics effect trick which I don't think anyone actually ever used in a commercial game. Hilarious.

When I used the 68k, it was usually to write stuff for the pre-ARM Palms, and I did so grudgingly. One of these days, though, I want to hack out a music program and MIDI interface for the 68k-based Sega Genesis. That thing has a damn DX7 in it.

Date: 2008-02-28 12:22 pm (UTC)
From: [identity profile] korgmeister.livejournal.com
I think it'll be at least a couple of years before I'm good enough to take something like this on, sorry.

Date: 2008-02-28 12:48 pm (UTC)
From: [identity profile] tgies.livejournal.com
crap

Have you guys worked with the 6502 at all or are you only using actual up-to-date hardware like AVRs or whatever

Date: 2008-02-28 03:24 pm (UTC)
From: [identity profile] korgmeister.livejournal.com
So far, exclusively been working with AVRs.
(deleted comment)

Date: 2008-03-04 09:41 am (UTC)
From: [identity profile] tgies.livejournal.com
The 65C802 was actually specifically designed to be a pin-for-pin drop-in replacement for the 6502, which makes this that much more hilarious. I did look into that, though, and I can do the same thing on the 65816 without anybody dying.

LOL COMPUTERS

Date: 2008-02-29 02:25 pm (UTC)
From: [identity profile] secretcow.livejournal.com
weird. Are you working directly with the chip or is it a simulator? Maybe switch sims?

I mainly work with the 68HC11, so i'm not TOOOO familiar with the 65C802 but i'll take a look around at the sources I have lying around (books lol)

Re: LOL COMPUTERS

Date: 2008-03-04 09:43 am (UTC)
From: [identity profile] tgies.livejournal.com
Sims handle it fine, except for this really old DOS sim made by some Taiwanese guy, which halts just like the real chip

I have exactly one 65C802 here so it's possible that both it and the DOS sim are broken I guess?!?!?!? but I can't think of how a real 65C802 could go south in that manner

Profile

tgies: (Default)
tgies

September 2016

S M T W T F S
    123
45 678910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 29th, 2026 09:27 pm
Powered by Dreamwidth Studios