Migration from TFC3 to Relaunch64

JMP $FCE2
jrubin
Member
Member
Posts: 59
Joined: Sun Jun 29, 2014 8:00 pm
Location: Florida
Contact:

Migration from TFC3 to Relaunch64

Post by jrubin »

Hello all,

Allow me to appoligise now for the long winded post.

Ive decided to get back into the 6502 after a few decades of taking a brake. I was even to recover some of my old books from Bombjack64, my favorite being Jim Butterfields'
Machine language for the C64. I admit even in that time I was no great coder in assembly, but I had the book and TFC. I currently have, along with actual hardware, VICE and TFC3 running on Ubuntu.

With TFC3 (mon) I can insert code within exact memory locations and execute it with G and the memory address, as well as breaking and returning at a desired location. This concept is quite easy to understand. I was excited to find 'relaunch64' online and have configured it to run with kickasembler and 64tass.

I can see the benefit to writing code in this manner but I have already encountered hurdles that has left me frustrated.

1. I am used to writing the code at a memory loction and having it automaticlly incriment to the next location. This also gives me an understanding of where I will start my execution and where it will BRK. I do not grasp this under relaunch64.

2. There are several assembler and I dont know which would be best to start out with. I am currently using the two mention before.

even the simplest programs compiles but does not produce the desired output

lda #$48
jsr $ff2
brk

something like this produces the letter as expected in TFC3

I would like to learn this relaunch64 method of coding but ive hit a wall.


jrubin
Member
Member
Posts: 59
Joined: Sun Jun 29, 2014 8:00 pm
Location: Florida
Contact:

Re: Migration from TFC3 to Relaunch64

Post by jrubin »

Ok ive made some strides.


*='startaddress'



and sys 'startaddress'
dudz
Member
Member
Posts: 140
Joined: Tue Jun 17, 2014 5:40 am
Contact:

Re: Migration from TFC3 to Relaunch64

Post by dudz »

i would suggest to use ACME or 64TASS instead of kickass - simply because kickass works very different from a lot of other assemblers. both i think can be used with relaunch64 too.
jrubin
Member
Member
Posts: 59
Joined: Sun Jun 29, 2014 8:00 pm
Location: Florida
Contact:

Re: Migration from TFC3 to Relaunch64

Post by jrubin »

Is this a valid call to a subroutine. This is a snip from coe im working on. seems to get caught in loopand run out of memory

LINE
lda #$64
jsr $ffd2
inx ; X=X+1
cpx #$28 ; does X = hex 28
bne LINE ; branch to LINE of not 28

TSTLINE
ldy #$0 ; Y coordunate for cursor
ldx #$8 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0
jsr LINE
brk
User avatar
Melon
Site Admin
Site Admin
Posts: 297
Joined: Thu Apr 10, 2014 7:57 pm
Contact:

Re: Migration from TFC3 to Relaunch64

Post by Melon »

You need an RTS after your BNE
.oO( MELON64 - ONE SLiCE AiN'T ENOUGH! )Oo.
dudz
Member
Member
Posts: 140
Joined: Tue Jun 17, 2014 5:40 am
Contact:

Re: Migration from TFC3 to Relaunch64

Post by dudz »

also, you probably dont want to end your code with a BRK, but with RTS instead - then it will cleanly (more or less, depending what your code does =P) return to BASIC after SYS. this BRK thing only works when starting the code from a monitor that hooks the BRK vector
jrubin
Member
Member
Posts: 59
Joined: Sun Jun 29, 2014 8:00 pm
Location: Florida
Contact:

Re: Migration from TFC3 to Relaunch64

Post by jrubin »

why does rts drop me back to basic instead of returning from subroutine, am I implimenting it wrong?



some previous code.......

bla bla bla

BOTTOMLINE
ldy #$0 ; Y coordunate for cursor
ldx #$14 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0

LINE
lda #$64
jsr $ffd2
inx ; X=X+1
cpx #$28 ; does X = hex 28
bne LINE ; branch to LINE of not 28
rts

TSTLINE
ldy #$0 ; Y coordunate for cursor
ldx #$8 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0
jsr LINE


END
rts
User avatar
Melon
Site Admin
Site Admin
Posts: 297
Joined: Thu Apr 10, 2014 7:57 pm
Contact:

Re: Migration from TFC3 to Relaunch64

Post by Melon »

Code is executed in a specific order, from top to bottom. In your example below, your RTS and the end of your LINE routeing ReTurns from Subroutine and this is why your being dropped back to basic. TSTLINE is never reached as there are no JSR TSTLINE included in your code, Jump SubRoutine.
BOTTOMLINE
ldy #$0 ; Y coordunate for cursor
ldx #$14 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0

LINE
lda #$64
jsr $ffd2
inx ; X=X+1
cpx #$28 ; does X = hex 28
bne LINE ; branch to LINE of not 28
rts

TSTLINE
ldy #$0 ; Y coordunate for cursor
ldx #$8 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0
jsr LINE


END
rts
START
ldy #$00 ; Y coordunate for cursor
ldx #$14 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0
jsr line
ldy #$00 ; Y coordunate for cursor
ldx #$08 ; X coordinate for cursor
clc ; carry
jsr $fff0 ; move cursor
ldx #$00 ; let X=0
jsr LINE
rts

LINE
lda #$64
jsr $ffd2
inx ; X=X+1
cpx #$28 ; does X = hex 28
bne LINE ; branch to LINE of not 28
rts
.oO( MELON64 - ONE SLiCE AiN'T ENOUGH! )Oo.
dudz
Member
Member
Posts: 140
Joined: Tue Jun 17, 2014 5:40 am
Contact:

Re: Migration from TFC3 to Relaunch64

Post by dudz »

why does rts drop me back to basic instead of returning from subroutine, am I implimenting it wrong?
SYS from basic is equivalent to JSR in ml ... so this code:

Code: Select all

*=$1000
inc $d020
rts
will increment the border color, and then return to basic if it has been started by SYS4096

compare with this code

Code: Select all

*=$1000
inc $d020
brk
... which when started from basic by SYS4096 will increment a border color, and then do a basic warmstart (the equivalent of run/stop+restore), because that is where the BRK vector points to.
Testicle
Member
Member
Posts: 4
Joined: Sun Jun 08, 2014 9:39 pm
Contact:

Re: Migration from TFC3 to Relaunch64

Post by Testicle »

Hi jrubin,
first of all, Relaunch64 is "just" an IDE for C64-cross-development that copes with many different assemblers. Basically, it is a text editor with some extra functions. When it comes to specific assembler syntaxes, you're talking about assembler issues, i.e. the questions might be related to ACME, KickAss, 64tass etc., and not about Relaunch64 issues. You could write the same code in any other editor. I'm emphasizing this because then you're probably not disappointed when you don't get your questions answered by the Relaunch64-manuals. :-)

A good start for using Relaunch64 and its functions may be the C64-wiki: http://c64-wiki.com/index.php/Relaunch64

A good start for cross-development might be ACME or 64tass, as said above by dudz. In case you're using OS X, you can find compiled binaries of several assemblers and crunchers for download at http://www.popelganda.de/relaunch64.html

docs and manuals for assemblers are included in the zip-files from the project-homepages, I think.
Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 9 guests