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 > Small Code snippet Basic works, same in ml doesnt ?
2020-05-03 00:04
lA-sTYLe

Registered: Sep 2003
Posts: 63
Small Code snippet Basic works, same in ml doesnt ?

Hi all,

i am Playing around with a Ramdisk for Reu. When i poke addresses and call the ramdos init directly from Basic everything works just fine but the same code in asm crashes the sytem.

Somebody who can enlighten me what is the difference bewtween :

poke 780,10:poke781,194:sys 25350

and

lda #$0a
sta 780 ;$030c
lda #194 ;$c2
sta 781 ;$030d
jmp $6306 ; 25350
2020-05-03 00:27
iAN CooG

Registered: May 2002
Posts: 3136
780/781 are for loading A and X before calling a SYS in basic, from AAY64:
 $030C/780               Storage for 6510 Accumulator during SYS
 $030D/781               Storage for 6510 X-Register during SYS
 $030E/782               Storage for 6510 Y-Register during SYS

So all you have to do is
lda #$0a
ldx #$c2
jsr $6306 

Probably just by disassembling what the $6306 address does you could see if it stores A/X somewhere upon calling.
2020-05-03 00:35
lA-sTYLe

Registered: Sep 2003
Posts: 63
Damn, i am not that Basic experienced as You see :-)

Thanks a lot. That works like a charm.
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
Exploding Fi../Techn..
Alakran_64
DJ Gruby/TRiAD
Guests online: 82
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Graphicians
1 Sulevi  (9.9)
2 Mirage  (9.8)
3 Mikael  (9.7)
4 Lobo  (9.7)
5 Archmage  (9.7)

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