Page 1 of 1

Need help with Kowalski assembler syntax

Posted: Thu Dec 28, 2023 6:50 am
by glockr
I'm trying to have the assembler populate an 8-bit jump table and I can't figure out the correct syntax. I want it to put the low order address byte of a group of routines. This is what I'm trying:

< My routines >
routine_1 (first line of code) A0 00 ; assembles to $0420
(more lines of code) E6 00
D0 02
...
4C BF 0E ; last line at $0434

routine_2 (first line of code) A0 00 ; assembles to $0437
(more lines of code) 68
85 60
...
4C BF 0E ; last line at $0441

routine_2 (first line of code) A0 00 ; assembles to $0444
(more lines of code) B1 60
85 76
...

etc...

< My jump table >

.BYTE <routine_1 ; gets set to $5B
.BYTE <routine_2 ; gets set to $6F
.BYTE <routine_3 ; gets set to $70

etc...

The table "should" contain $20, $37, and $44 or maybe the contents of the address, but it contains neither. If I leave off the '<' I get
message saying something about not being able to fit a 16 bit value into an 8 bit BYTE. Also tried playing around with different combinations
of '#', '$', '>', and '<' but nothing I try gives the results I want. Is it even possible? If so, what is the correct syntax? Also, is there a good
user manual for the Kowalski assembler available online somewhere? I've been looking for the past 3 or 4 days and I can't find anything
that has a lot of detailed information. Thanks.

Re: Need help with Kowalski assembler syntax

Posted: Thu Dec 28, 2023 8:27 am
by barrym95838
I use the interactive help Kowalski provides in the right pane. For example, if I cursor near a .BYTE directive in my source:
Capture2.PNG
Could you share a bit more context? It looks like you're on the right track, but something's not clicking into place yet.

You can also help us out by surrounding your code with

Code: Select all

 and 
to provide a fixed-width font and unmolested white-space.

Re: Need help with Kowalski assembler syntax

Posted: Thu Dec 28, 2023 12:58 pm
by 8BIT
What version of the Kowalski assembler are you using?
Also, are you sure your ORG statement is $0400 vs 0400?

I created this source:

Code: Select all

	*= $0400
	
routine_1
	LDA #0
	STA $1
	JMP $0ebf
	
routine_2
	LDA #0
	STA $2
	JMP $0ebf

routine_3
	LDA #0
	STA $3
	JMP $0ebf
		
		
table
 .BYTE	<routine_1
 .BYTE	<routine_2
 .BYTE	<routine_3 
And the disassembly was correct.
Capture.JPG
Capture.JPG (22.67 KiB) Viewed 1556 times
This is on the latest version from my website -> https://sbc.rictor.org/kowalski.html

Cheers!
Daryl

Re: Need help with Kowalski assembler syntax

Posted: Thu Dec 28, 2023 5:19 pm
by glockr
Hi Daryl,
I'm using version 1.3.4.7 and... I found out the problem was my fault. Playing around with it some more after I posted, I found that
putting .BYTE <somefunction_ before the routines gave the expected result, but putting it after didn't. Then after sleeping on it, I "noticed"
that I had two jump tables set to the same address. Once I fixed that it started working. My fault. Sorry for posting before figuring out it
was my own bone-headed mistake.