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: 64
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: 3236
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: 64
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
t0m3000/bo0M!^hf^ibex
Twilight/Excess/Arcade
JackAsser/Booze Design
Alakran_64
theK/ATL
E$G/HF ⭐ 7
Britelite/Dekadence
Guests online: 137
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.7)
4 LMan  (9.7)
5 Linus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.053 sec.