Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
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: 2821
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
JackAsser/Booze Design
SKR/ONS/sidD/STARZ
McMeatLoaf
sebalozlepsi
PAL/Offence
MightyAxle
Nith/TRIÉ…D
Moloch/TRIAD
Atte/Attentator
Guests online: 80
Top Demos
1 Coma Light 13  (9.6)
2 Uncensored  (9.6)
3 Memento Mori  (9.6)
4 Edge of Disgrace  (9.6)
5 Unboxed  (9.6)
6 Comaland 100%  (9.6)
7 Lunatico  (9.6)
8 The Shores of Reflec..  (9.5)
9 X Marks the Spot  (9.5)
10 Rivalry  (9.5)
Top onefile Demos
1 Copper Booze  (9.9)
2 Quadrants  (9.6)
3 Elite Code Mechanics  (9.6)
4 Square Booze  (9.6)
5 Dawnfall V1.1  (9.5)
6 Smile to the Sky  (9.5)
7 Daah, Those Acid Pil..  (9.5)
8 Crystal Gazer  (9.4)
9 Cuarentenauta  (9.4)
10 Listen to Your Eyes  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.4)
3 Oxyron  (9.3)
4 PriorArt  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 Irata  (9.8)
4 Taper  (9.8)
5 hedning  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.044 sec.