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 > start assemblycode with basic-commando, "run"
2013-07-15 17:16
Stirf
Account closed

Registered: May 2002
Posts: 26
start assemblycode with basic-commando, "run"

hej people a simple question..

i want to code a tool which saves as executable.
most of the code is already done.

but how do i save sothat RUN starts it?
i already copied a binary of the usual start SYS2059 into my code and i've let my actual code begin on that exact location (of sys 2059).
but it doesn't start properly.
also when i LIST there is also a lot of other garbage besides the usual basic to assembler start.

i am not a basic-fan or basic-expert, normally i only deal with asm, who can help me out??what am i doing wrong?

stirf/role
2013-07-15 17:19
tlr

Registered: Sep 2003
Posts: 1790
SYS2059 is a trick that only works if the second byte of the code at $080b is $00. This is because that $00 byte is the MSB of the last basic link address.

Use SYS2061 + the regular 3 * $00 termination and you'll be fine.
2013-07-15 23:01
Stirf
Account closed

Registered: May 2002
Posts: 26
thanks mate, it worked! i used 2013 sys 2062 which starts $080e with you mentioned 3x#$00, very helpful! respect!
2013-07-17 20:15
TheRyk

Registered: Mar 2009
Posts: 2246
since you will want to initialize the registers with zero value anyway rather sooner than later in almost any program, it's recommendable to do it like this:
*= $0801
!byte $0b,$08,$dd,$07,$9e,$32,$30,$35,$39;2013 SYS2059
*= $080b
lda #00
tax
tay
; some copy screen and/or color ram loop could follow, for example

It's not necessary to have $00 at $080b and the zero at $080C should have some use :)
2013-07-17 20:28
Zyron

Registered: Jan 2002
Posts: 2381
That's exactly what tlr said.
2013-07-17 21:07
Peiselulli

Registered: Oct 2006
Posts: 81
Or shorter ...

*= $0801
!byte $0b,$08,$dd,$07,$9e,$32,$30,$35,$39;2013 SYS2059
*= $080b
!byte $ab,$00
tay
2013-07-17 21:37
TheRyk

Registered: Mar 2009
Posts: 2246
nice ulli, another byte saved \o/!

but if I quote your own group's OpCode table annotations (highly appreciated btw)

Quoting 'LAX'
highly unstable (results are not predictable on some machines)


;)
2013-07-17 22:18
chatGPZ

Registered: Dec 2001
Posts: 11386
that only applies if the argument is not zero, LAX #$00 works fine always :)
2013-07-18 07:07
TheRyk

Registered: Mar 2009
Posts: 2246
Great, in that case thx to all of you, very useful lesson!
2013-07-18 07:10
enthusi

Registered: May 2004
Posts: 677
To complete it even further, why not use real code instead of bytes?
.word $0801

	*=$0801
	.word basend
	.word 0
	.byte $9e
	.asc "2061"
	.byte 0
basend
	.word 0

*=$080d ;obsolete
2013-07-18 07:18
Fungus

Registered: Sep 2002
Posts: 686
Or you could use exomizer to compress your code and start it =]
2013-07-18 07:26
TheRyk

Registered: Mar 2009
Posts: 2246
Killjoy :D
2013-07-18 07:54
Mr. SID

Registered: Jan 2003
Posts: 424
Fungus wanted to type "should" instead of "could".
2013-07-18 09:26
tlr

Registered: Sep 2003
Posts: 1790
From the OP:
Quoting Stirf
i want to code a tool which saves as executable.
most of the code is already done.

Stirf wants to make a tool that saves an executable. I assume it's a native tool. Then I wouldn't recommend exomizer as back end. ;)
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
Guests online: 104
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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