GeorgRottensteiner / C64Studio

C64Studio is a .NET based IDE specializing in game development for the C64 in assembler and BASIC
Other
260 stars 38 forks source link

!basic directive only works with * = $0801 #61

Closed cdacunha71 closed 1 year ago

cdacunha71 commented 2 years ago

According to documentation it should be able to cope with other start addresses

This pseudo op adds a BASIC start line with a sys call to either the given jump address or the first statement after the pseudo op. If not provided otherwise the added BASIC line always has line number 10 and a 4 digit target address. This way the BASIC line will always require 12 bytes. If the jump address is 5 decimal digits the line will use 13 bytes.

GeorgRottensteiner commented 2 years ago

Can you show an example where it doesn't work?

I'm using it for other architectures (e.g Mega65, where it starts with $2001) and it works fine. Also just tested with a different address, the line pointers and the SYS address are correct.

cdacunha71 commented 2 years ago

Hi Georg,

I'm using to refresh my C64 assembler skills, so nothing fancy in combination with WinVice GTK3VICE-3.6.0-win64

Here the sample that doesn't work

HTML clipboard

lda #$FF sta $d40e sta $d40f lda #$80 sta $d412

loop lda $d41b ror a lda #205 adc #0 jsr $ffd2 jmp loop

Disassembly from prg file yields

Notice the $08 missing after $0B, the SYS line is correct

Same program other address, this one works when you do build and run

lda #$FF sta $d40e sta $d40f lda #$80 sta $d412

loop lda $d41b ror a lda #205 adc #0 jsr $ffd2 jmp loop

Disassembly from prg file yields

Maybe I forgot to mention the architecture somewhere ?

Wait, I'm not using a new solution, I'm just using new file - ASM file

Regards

Carlos

On Wed, Jan 26, 2022 at 4:52 PM Georg Rottensteiner < @.***> wrote:

Can you show an example where it doesn't work?

I'm using it for other architectures (e.g Mega65, where it starts with $2001) and it works fine. Also just tested with a different address, the line pointers and the SYS address are correct.

— Reply to this email directly, view it on GitHub https://github.com/GeorgRottensteiner/C64Studio/issues/61#issuecomment-1022333744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2PIINCFDZD7CYCWUDARW3UYAKDHANCNFSM5M26LLOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

GeorgRottensteiner commented 2 years ago

Ahh, you're using the in built disassembler? This one only assumes a BASIC start with $0801. That's where I should fix things.

The actual data is correct:

0B C0 0A 00 9E 34 39 31 36 35 00 00 00

$C000: 0B C0                  = Pointer to next BASIC line
$C002: 0A 00                  = line number 10
$C004: 9E                     = SYS
$C005: 34 39 31 36 35         = 49165  ($C00D)
$C00A: 00                     = end of line
$C00B: 00 00                  = pointer to next BASIC line (00 00 marks the end of the listing)

I'm not sure C64 will work with a BASIC listing at $c000. Never tried that actually. I guess that could work if you change all pointers for the heap, etc.

cdacunha71 commented 2 years ago

Hi Georg,

I don't think it will, the basic listing needs to sit a $0801. No worries I'll continue using it as the start address for the things I'm doing. Thanks for sharing this great tool.

Regards

On Wed, Jan 26, 2022 at 6:09 PM Georg Rottensteiner < @.***> wrote:

Ahh, you're using the in built disassembler? This one only assumes a BASIC start with $0801. That's where I should fix things.

The actual data is correct:

0B C0 0A 00 9E 34 39 31 36 35 00 00 00

$C000: 0B C0 = Pointer to next BASIC line $C002: 0A 00 = line number 10 $C004: 9E = SYS $C005: 34 39 31 36 35 = 49165 ($C00D) $C00A: 00 = end of line $C00B: 00 00 = pointer to next BASIC line (00 00 marks the end of the listing)

I'm not sure C64 will work with a BASIC listing at $c000. Never tried that actually. I guess that could work if you change all pointers for the heap, etc.

— Reply to this email directly, view it on GitHub https://github.com/GeorgRottensteiner/C64Studio/issues/61#issuecomment-1022407021, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2PIINCQP67G3NT64LFRVTUYATDTANCNFSM5M26LLOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>