C64Studio icon indicating copy to clipboard operation
C64Studio copied to clipboard

!basic directive only works with * = $0801

Open cdacunha71 opened this issue 2 years ago • 4 comments

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.

cdacunha71 avatar Jan 26 '22 12:01 cdacunha71

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.

GeorgRottensteiner avatar Jan 26 '22 15:01 GeorgRottensteiner

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

  • = $c000 !basic

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

  • = $c000 $C000: 0B C0 anc #$c0 $C002: 0A asl $C003: 00 brk $C004: 9E 34 39 shx $3934, y $C007: 31 36 and ( $36 ), y $C009: 35 00 and $00, x $C00B: 00 brk $C00C: 00 brk $C00D: A9 FF lda #$ff $C00F: 8D 0E D4 sta $d40e $C012: 8D 0F D4 sta $d40f

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

  • = $0801 !basic

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

  • = $0801 $0801:!byte $0B,$08,$0A,$00,$9E,$32,$30,$36 $0809:!byte $31,$00,$00,$00 $080D: A9 FF lda #$ff $080F: 8D 0E D4 sta $d40e $0812: 8D 0F D4 sta $d40f $0815: A9 80 lda #$80 $0817: 8D 12 D4 sta $d412 $081A: $081A: label_081a $081A: AD 1B D4 lda $d41b $081D: 6A ror $081E: A9 CD lda #$cd $0820: 69 00 adc #$00 $0822: 20 D2 FF jsr $ffd2 $0825: 4C 1A 08 jmp label_081a

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: @.***>

cdacunha71 avatar Jan 26 '22 16:01 cdacunha71

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.

GeorgRottensteiner avatar Jan 26 '22 17:01 GeorgRottensteiner

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: @.***>

cdacunha71 avatar Jan 26 '22 17:01 cdacunha71