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 > how reliable is illigal opcode: skip next byte.
2010-10-17 21:15
Testa
Account closed

Registered: Oct 2004
Posts: 197
how reliable is illigal opcode: skip next byte.

i have a guestion, when you have fpp graphics you always stretch rc0 or rc7 to do the fpp trick.. this means that in the charsetbuffer only one of each 8 bytes is used..
is it possible to put code in the 7 byte area en skip the graphics byte with the skb opcde and continue the code
in the next 7 bytes?

i tested it with vice and it works, but how is it on real
hardware..

and maybe a 'stopid question' is it possible to do this
skb byte trick with a sidplayer.. or will the skb execution time of 2 cycles fuck up the sid..
i never have coded a sid routine so i really don't know this...






2010-10-18 13:03
MagerValp

Registered: Dec 2001
Posts: 1056
By SKB do you mean a 2 byte 3 cycle NOP, such as $04, $44, or $64? Then sure, you can interleave code as long as you can fit it in chunks of 6 bytes and don't mind NOP:ing 3 cycles. I have a hard time seeing when that would be an optimal solution though.
2010-10-18 13:22
WVL

Registered: Mar 2002
Posts: 886
Ofcourse it works, but I guess you need either very repetitive code (and a code generator) OR some kind of special assembler for the job that inserts NOOP and NOOOP by itself..
2010-10-18 13:25
Oswald

Registered: Apr 2002
Posts: 5017
you could also use a bit $graphicsbyte, zp or absolute.
2010-10-18 13:28
WVL

Registered: Mar 2002
Posts: 886
No, because BIT sets N,V and Z flags. So it's not usable for generic code.

Oh! and you better be damn sure you dont have any tables inside that memory area! or anything else that you're trying to index.
2010-10-18 13:32
Oswald

Registered: Apr 2002
Posts: 5017
I didnt mean it for generic code. It's a nice problem tho. Coding such an assembler :) I have an idea which needs something similar, but the problem is way more simple.
2010-10-18 13:49
Testa
Account closed

Registered: Oct 2004
Posts: 197
i mean illigal opcode $80, $82, $c2 etc.. but now i think
about it a lda ($a9) will do the job too...

lda $1000 ;3 bytes ;$0a00
sta $2000 ;3 bytes ;$0a03
lda ;1 byte ;$0a06
.byte $?? ;the graphics byte ;$0a07 (rc7)

continue code here..

this will take 2 cycles too but it costs a register..
so SKB will be better. (but the flags must be untouched by the SKB opcode)

edit:WVL, why is a table with a index a problem
just use an extra index table for the x or y reg.
, but you already knew this.

infact you can store everything in al the free 7 bytes..
even packed or crunched data.. if you want you can
put the next cruched part of a spacabar demo in the free bytes..




2010-10-18 14:35
WVL

Registered: Mar 2002
Posts: 886
Ofcourse but you knew that too ;) But where are you going to put the _extra_ index table? ;)

x = index register

instead of
ldx #index
lda data,x
you would write :
ldx #index
ldy correctformissingbytes,x
lda data,y
but where in memory is the correctformissingbytes table? and how are you going to fix the indexing to this table? As you see, you've gained nothing and only used up the memory for the table twice, and lost extra lookup-cycles. -> don't put tables in this memory, except when they're <= 7 bytes long and aligned with the skipped bytes.

The only exception is when you're really starved for memory and have one fix-indexing-table outside the messed up memory area, and use that one for reading from all the tables inside the fpp-area. This does mean that you have to align all the tables in the fpp-area to the occupied bytes though. Another disadvantage : max table lenght is only 256-32 = 224 bytes.

NOP #imm and NOP $dead should be perfectly stable on real machines also (except on machines with scpu, but who cares about them).
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
Viti/Hokuto Force
Alakran_64
Beast/Crescent
CA$H/TRiAD
Didi/Laxity
Bacchus/FairLight
Guests online: 80
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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