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 > CSDb Entries > Event id #2417 : First CSDb "Unintended OpCode coding challenge"
2015-10-11 07:18
Monte Carlos

Registered: Jun 2004
Posts: 351
Event id #2417 : First CSDb "Unintended OpCode coding challenge"

So here it is. The First CSDb "Unintended OpCode coding challenge" starts over.

First CSDb "Unintended OpCode Coding Challenge"

Please give some feedback about your interest in this compo.
For those who have been part of the discussion
http://csdb.dk/forums/?roomid=12&topicid=112819#112927
please let me know if you are in better agreement with the reworked rules than before.
However, there will not be a rule change anymore.
 
... 44 posts hidden. Click here to view all posts....
 
2015-10-14 14:29
Bitbreaker

Registered: Oct 2002
Posts: 501
SRE and SLO and others can take up to 8 cycles (indirect y indexed) and are thus not necessarily faster, also i have not come across any good use for an effect for the RRA and RLA opcodes so far, though they of course would save cycles if used properly.

         lda #$00
         slo $xxxx

can also be expressed as:

         asl label+1
label    lda #$00
2015-10-15 12:01
Rastah Bar

Registered: Oct 2012
Posts: 336
Quoting Bitbreaker


         lda #$00
         slo $xxxx

can also be expressed as:

         asl label+1
label    lda #$00


Not always.
2015-10-17 10:38
Monte Carlos

Registered: Jun 2004
Posts: 351
Thats what i tried recently:
ldx #60
fsprite lda #0
sta sprite+2,x
lda #$f0
sta sprite+1,x
lda #$ff
sta sprite+2,x
sbx #3 ; or axs #3
bpl fsprite
rts
----------------------------------
ldy # 24
ldx #0
setscreen:
lda #'*'
hi = *+2
sta screen,x
txa
sbx #$d8
bcc j
inc hi
j dey
bpl setscreen
rts
-------------------------------------
loop:
jsr waitretrace

lda #7
ldx $d016
sbx #$f9
stx $d016
jmp loop
---------------------------------------
2015-10-18 09:58
Rastah Bar

Registered: Oct 2012
Posts: 336
Is there any concensus on the names given to the various extra instructions?

There are at least three references on codebase64:

http://codebase64.org/doku.php?id=base:extra_instructions_of_th..

http://unusedino.de/ec64/technical/aay/c64/ibmain.htm

http://www.oxyron.de/html/opcodes02.html

Which one is the most complete / commonly used?

A document by Groepaz was mentioned. Where can I find that?



I once used:
sta label+1
txa
label sbx #$00


To get X --> A and X-A --> A
2015-10-18 10:03
Monte Carlos

Registered: Jun 2004
Posts: 351
just search for "no more secrets" and reveal:

No More Secrets

Think this and grahams reference are the most advanced docus.
2015-10-18 20:52
Rastah Bar

Registered: Oct 2012
Posts: 336
Thanks!

I constructed a 15 bit Maximum Length Sequence (MLS) generator, using RLA. This is what I have got now:

lda #seed1
sta zp1
lda #seed2
sta zp2
start:
clc
lda #$60 ;MSB of zp2 is output of the MLS, bits 6+5 are EORed (according to primitive polynomial for m=15)
rol zp1 
rla zp2 ;actually the Carry flag contains the most recent output of the MLS at this point, while the MSB of zp2 is the output of the previous cycle.
beq start ; shift a zero bit in
;now we must distinguish between 01 or 10 versus 11 for bits 6 and 5 of A
eor #$60
beq start ; shift a zero bit in
sec ; shift a one bit in
jmp start+1


Reference for MLS: http://www.kempacoustics.com/thesis/node83.html

I don't know if this can be done more efficiently (probably).
2015-10-19 16:04
Monte Carlos

Registered: Jun 2004
Posts: 351
Is this related to generation of random numbers which also are maximum length sequences or is this something on it's own?
2015-10-19 16:31
Rastah Bar

Registered: Oct 2012
Posts: 336
Yes, this is related. I dont know the details, but the reference explains more. I remembered something about random number generation with MLS, looked up the reference and saw a connection with RLA.
2015-10-19 19:02
Monte Carlos

Registered: Jun 2004
Posts: 351
Interesting idea. I only know bout these eor randomizers.
2015-10-19 19:15
Bitbreaker

Registered: Oct 2002
Posts: 501
Nice! A optimization that comes to my mind at a chort glance:

eor #$60
beq start ; shift a zero bit in
sec ; shift a one bit in
jmp start+1

;isn't that the same as:

eor #$60
cmp #$01         ;sets carry on $20 $40 $60 and clears carry on $00
bne start+1      ;branch always


The lda #$60 + eor #$60 gives me the feeling that it can be optimized too, twice the same value :-D Also it would help to get a negated carry, hmm
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
Doc Snyder/ONS
Exile/Anubis
Walt/Bonzai
REBEL 1
Scrap/Genesis Project
Rock/Finnish Gold
Guests online: 89
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Uncensored  (9.6)
7 Comaland 100%  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Morph  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.5)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

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