Need help with Kowalski assembler syntax

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
glockr
Posts: 7
Joined: 26 Apr 2012

Need help with Kowalski assembler syntax

Post 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.
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: Need help with Kowalski assembler syntax

Post 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.
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: Need help with Kowalski assembler syntax

Post 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 1553 times
This is on the latest version from my website -> https://sbc.rictor.org/kowalski.html

Cheers!
Daryl
Please visit my website -> https://sbc.rictor.org/
glockr
Posts: 7
Joined: 26 Apr 2012

Re: Need help with Kowalski assembler syntax

Post 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.
Post Reply