Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) 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: 3132
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
csabanw
Alakran_64
hedning/G★P
LMan
Guests online: 90
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 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 Wafer Demo  (9.5)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Onscreen 5k  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

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