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 > read $dc0d
2008-03-31 18:28
Testa
Account closed

Registered: Oct 2004
Posts: 197
read $dc0d

when i set up a raster irq i always do lda #$7f sta $dc0d lda $dc0d.. no problem but there is one thing i dont get:
at $ea7e there is also a lda $dc0d.. can i savely skip the lda $dc0d in the irq set up and end the irq with a jmp $ea7e... or is there a diffirence???
 
... 7 posts hidden. Click here to view all posts....
 
2008-04-02 15:16
Ninja

Registered: Jan 2002
Posts: 411
school-book example? for HCL? :)
2008-04-02 15:25
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: school-book example? for HCL? :)

Well, the "BEST" alternative he came up with was right out lame. ;D Wouldn't wanna raise the bar too high.
2008-04-02 15:41
Ninja

Registered: Jan 2002
Posts: 411
*rotfl* :)
2008-04-02 16:47
Testa
Account closed

Registered: Oct 2004
Posts: 197
ok boys thanks for the info... very nice..
2008-04-02 22:14
CreaMD

Registered: Dec 2001
Posts: 3057
When I'm stumbling over debates like this I wonder if god gives me the signal that c64 scene is still kicking some major ass. I'm very thankful for that.
2008-04-03 06:39
HCL

Registered: Feb 2003
Posts: 728
Quote: JackAsser: You cycle waster; jump to $dc0c after setting it to $40! ;D

Hmm, that one beats me.. or did you mean setting it to $4c?! $40 is RTI on my hardware :).

Ok, thanx guys! Yeah, it must have been the BRK/IRQ i had in mind somewhere..

So.. in this case it seems like ASL $d019 and LSR $d019 gives the same result!?

TFM says ($d019):
Bit 7: 1 = IRQ has been generated.
Bit 0: Raster Compare IRQ Flag (see $D012).
2008-04-03 07:19
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Hmm, that one beats me.. or did you mean setting it to $4c?! $40 is RTI on my hardware :).

Ok, thanx guys! Yeah, it must have been the BRK/IRQ i had in mind somewhere..

So.. in this case it seems like ASL $d019 and LSR $d019 gives the same result!?

TFM says ($d019):
Bit 7: 1 = IRQ has been generated.
Bit 0: Raster Compare IRQ Flag (see $D012).


Ofcourse ASL and LSR is the same since either bit 7 or bit 0 can be used to check the state of the raster IRQ.

A software IRQ generated by a BRK opcode can indeed be polled by fetching the cpu status word using the PLP opcode.

Placing #$40 (RTI) on $dc0c is useful since the 6502 always fetches two consecutive bytes (and dismiss the last one in case of NOP, RTI etc.). Hence the CPU will actually read $dc0d (ack the timer irq) then you jump to $dc0c.

jmp $dc0c; rti = 3c+rti
bit $dc0c; rti = 4c+rti

One cycle saved!

2008-04-03 07:20
Oswald

Registered: Apr 2002
Posts: 5094
rti always reads the byte behind the rti aswell, so it will ack the interrupt.
2008-04-03 08:16
Oswald

Registered: Apr 2002
Posts: 5094
Quote: When I'm stumbling over debates like this I wonder if god gives me the signal that c64 scene is still kicking some major ass. I'm very thankful for that.

no it does not.
2008-04-03 13:34
HCL

Registered: Feb 2003
Posts: 728
Quote: no it does not.

Maybe you don't, bet we do ;). Weird shit in this thread, possibly i learnt something new, which is also totally unusable :). Thanx guys!
Previous - 1 | 2 - 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
LKP/CFN
St0rmfr0nt/Quantum
MWR/Visdom
Chesoner/House Designs
katon/Lepsi De
The Syndrom/TIA/Pret..
Youth
Mike
Lazycow
Alakran_64
TheRyk/MYD!
mutetus/Ald ^ Ons
megasoftargentina
Guests online: 134
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 No Listen  (9.6)
2 Layers  (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 Censor Design  (9.3)
5 Triad  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

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