6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 12:45 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Dec 28, 2023 6:50 am 
Offline

Joined: Thu Apr 26, 2012 4:54 pm
Posts: 7
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 28, 2023 8:27 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1926
Location: Sacramento, CA, USA
I use the interactive help Kowalski provides in the right pane. For example, if I cursor near a .BYTE directive in my source:
Attachment:
Capture2.PNG
Capture2.PNG [ 15.37 KiB | Viewed 1134 times ]

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] and [/code] 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)


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 28, 2023 12:58 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1681
Location: Sacramento, CA
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:
   *= $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.
Attachment:
Capture.JPG
Capture.JPG [ 22.67 KiB | Viewed 1117 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/


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 28, 2023 5:19 pm 
Offline

Joined: Thu Apr 26, 2012 4:54 pm
Posts: 7
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: