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 > Stupid Routines ....
2006-11-27 22:55
General Zoff
Account closed

Registered: Dec 2004
Posts: 7
Stupid Routines ....

Found this one on one of my old work disks ...
Let's collect the most stupid routines you have written on your old C64 ... ;-)

.C:6000 78 SEI
.C:6001 A2 00 LDX #$00
.C:6003 BD 11 60 LDA $6011,X
.C:6006 9D 00 00 STA $0000,X
.C:6009 E8 INX
.C:600a E0 40 CPX #$40
.C:600c D0 F5 BNE $6003
.C:600e 4C 00 00 JMP $0000
.C:6011 2F 34 A9 RLA $A934
.C:6014 A9 EA LDA #$EA
.C:6016 8D 34 A9 STA $A934
.C:6019 F0 24 BEQ $603F
.C:601b A2 00 LDX #$00
.C:601d A9 EA LDA #$EA
.C:601f 9D 40 00 STA $0040,X
.C:6022 E8 INX
.C:6023 D0 F8 BNE $601D
.C:6025 EE 10 00 INC $0010
.C:6028 AD 10 00 LDA $0010
.C:602b C9 00 CMP #$00
.C:602d F0 0B BEQ $603A
.C:602f C9 FF CMP #$FF
.C:6031 D0 E8 BNE $601B
.C:6033 A9 00 LDA #$00
.C:6035 8D 0F 00 STA $000F
.C:6038 F0 E1 BEQ $601B
.C:603a A9 D0 LDA #$D0
.C:603c 8D 08 00 STA $0008
.C:603f A9 37 LDA #$37
.C:6041 85 01 STA $01
.C:6043 EE 20 D0 INC $D020
.C:6046 A9 34 LDA #$34
.C:6048 85 01 STA $01
.C:604a EA NOP
.C:604b EA NOP
.C:604c EA NOP
.C:604d EA NOP
.C:604e EA NOP
.C:604f EA NOP
.C:6050 EA NOP




2006-11-27 23:16
Soren

Registered: Dec 2001
Posts: 547

Loop: inc $D418
dec $D012
lda #$01
tay
dey
tya
clc
adc #$00
tax
inx
txa
lda #$01
sta $0801
jmp Loop

2006-11-28 09:25
j0x

Registered: Mar 2004
Posts: 215
Jeff: Obfuscated flatulence-sound code?

Zoff: The most memory-wasteful way of changing the border colour at 7.5 Hz?

Good (insane) fun :)
2006-11-28 12:13
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Try this:

*=$1000

soundfx4
JSR fxloop
JMP soundfx4

fxloop
LDA #$0F
STA $D418 ; SID Filter mode/master volume.
LDX #$06
.re5 LDA data4,X
STA $D40E,X ; SID Voice 3 - frequency (LSB).
DEX
BPL .re5

LDA #$10
STA $D412 ; SID Envelope 3 - control register.
.re6 JSR subrout2
AND #$1F
CMP #$08
BCC .re6
STA $D40F ; SID Voice 3 - frequency (MSB).
LDA #$30
STA $D413 ; SID Envelope 3 - attack/decay levels.
LDA #$11
STA $D412 ; SID Envelope 3 - control register.
RTS

data4
!byte $32,$2f,$00,$00,$81,$19,$01

subrout2
LDA $DC04 ; CIA#1 Timer A (LSB).
EOR $DC05 ; CIA#1 Timer A (MSB).
EOR $DD04 ; CIA#2 Timer A (LSB).
ADC $DD05 ; CIA#2 Timer A (MSB).
EOR $DD06 ; CIA#2 Timer B (LSB).
EOR $DD07 ; CIA#2 Timer B (MSB).
RTS
2006-11-28 12:27
Scout

Registered: Dec 2002
Posts: 1568
*=$1000

		sei
		lda #$0b
		sta $d011
		ldy #$01
loop

		ldx #$01
		dex
		bne *-1
		nop
		sty $d020
		ldx #$01
		dex
		bne *-1
		nop
		stx $d020
		jmp loop

---
8Bit Mayhem - The C64 Scenemusic Podcast
http://8bitmayhem.untergrund.net
2006-11-28 14:14
Raf

Registered: Nov 2003
Posts: 343
* = $1000
jmp *

;-)

www.vulture.c64.org
2006-11-28 14:41
j0x

Registered: Mar 2004
Posts: 215
Routine 1:
loop1 inc $d020
bne loop1
rts

Routine 2:
loop2 dec $d020
bne loop2
rts

Spot the not-so-obvious difference

[hint: no, it's not that the colour order is reversed]
2006-11-29 10:57
Mace

Registered: May 2002
Posts: 1799
j0x: the first runs longer than the second, as it takes longer from any value <#$10 to reach #$00 again when you increase then when you decrease.
2006-11-29 11:17
j0x

Registered: Mar 2004
Posts: 215
Mace: Actually, Routine 2 runs longer.
2006-11-29 11:20
Oswald

Registered: Apr 2002
Posts: 5007
some c64s has random upper 4 bits...
2006-11-29 11:59
algorithm

Registered: May 2002
Posts: 702
Or that routine 2 is never run
 
... 42 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
McMeatLoaf
Enforcer/Deers
sailor/Triad
Laurent
Brittle/Dentifrice^(?)
Airwolf/F4CG
Malmix/Fatzone
encore
Guests online: 369
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.5)
2 Black Beard  (9.4)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Irata  (8.5)

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