| |
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 |
|
| |
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. |
| |
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! |
| |
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 :) |
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
That's exactly what tlr said. |
| |
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
|
| |
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)
;) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
that only applies if the argument is not zero, LAX #$00 works fine always :) |
| |
TheRyk
Registered: Mar 2009 Posts: 2246 |
Great, in that case thx to all of you, very useful lesson! |
| |
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
|
| |
Fungus
Registered: Sep 2002 Posts: 686 |
Or you could use exomizer to compress your code and start it =] |
| |
TheRyk
Registered: Mar 2009 Posts: 2246 |
Killjoy :D |
| |
Mr. SID
Registered: Jan 2003 Posts: 424 |
Fungus wanted to type "should" instead of "could". |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
From the OP:
Quoting Stirfi 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. ;) |