6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Jul 12, 2024 6:53 am

All times are UTC




Post new topic Reply to topic  [ 94 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 8:43 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10842
Location: England
sepseel wrote:
Ok, so I managed to get the bash prompt in windows 10 to work.
Now you say i should install cc65 using the apt-get install command, however when I input: sudo apt-get install cc65,
I get an error saying: unable to locate package cc65.
Should i manually download cc65, and if so, what command get's it installed then ?

It might be that you need to do the apt-get update, but it's easy enough to build cc65 from source: I did that earlier today. I downloaded and unpacked the zip file from https://github.com/cc65/cc65, then ran 'make' on the top level directory.

Now, installing it is potentially another matter... we could go down a number of rabbit holes here. What I sometimes do is

$ env PATH=/path/to/tool/bin:$PATH command line

so for example

$ env PATH=/path/to/tool/bin:$PATH ca65

or

$ env PATH=/path/to/tool/bin:$PATH make

and that should work. It doesn't matter where your tool is, so long as you know where it is.

I don't know if it's easy to download and unpack a zip file in such a way that bash can see the results. You might do it from the command line:

$ wget http://example.com/path/to/file.zip
$ unzip file.zip


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 9:20 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
So, thusfar i managed to locate the right folder, however when i try to run make on the top level diretroy, it gives me an error (ill just post everything it outputs)

GIT_SHA: N/A
ar65/add.c
make[1]: gcc: Command not found
make[1]: *** [../wrk/ar65/add.o] Error 127
make: *** [all] Error 2

then it ends.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 9:21 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10842
Location: England
Ah - you have no compilation tools! There must be a suitable apt-get to sort that out.

Try
sudo apt-get update
sudo apt-get install build-essential


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 9:56 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Yes, that worked. Now the make command has succesfully run.
Wat's next ?

Btw, i really appreciate your help!


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 9:58 pm 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 136
The Windows Snapshot mentioned at http://cc65.github.io/cc65/ under links contains prebuilt Windows executables.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 10:02 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
leepivonka wrote:
The Windows Snapshot mentioned at http://cc65.github.io/cc65/ under links contains prebuilt Windows executables.


I see, but how would i use those then ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 10:13 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10842
Location: England
Hmm, I may have led you astray with Jeff's EhBasic port. Although it is the right syntax for cc65, and we do get a binary from it, it may assume something about the machine it will run on - specifically, the presence of a monitor program.

Perhaps we need to a look ahead a bit. When you get EhBasic on board, how do you intend to interact with it? Presumably over the serial port? We need some minimum amount of code in the EEPROM to drive the serial port.

Is it worth reading more about Jeff's monitor? Or does your SBC design come with a machine monitor story?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 10:30 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Yes, i was planning on using serial to interact witch my system. I have this board: http://geoffg.net/terminal.html to output to a monitor over VGA. It also handles the keyboard, and outputs it as ASCII over serial.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 10:35 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10842
Location: England
It's probably a good idea to write a little Hello program - or to take someone's monitor code and convert that. At minimum, you need to know the address of the UART so your code can access it. You will probably need to write to a control register to initialise it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Sun Mar 05, 2017 10:39 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Sadly I don't know how to do any of those things, could you point me to a good source on how to do one of those things ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Mon Mar 06, 2017 3:00 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
floobydust and 8-BIT might be among the most qualified members to answer questions about using the 6551. I was going to link you to Garth's pages (heck, I will anyway), but he seems to be (for the most part) a 6522 kind of guy. Please correct me if I'm wrong, Garth ...

Mike B.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Mon Mar 06, 2017 3:32 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8465
Location: Southern California
barrym95838 wrote:
floobydust and 8-BIT might be among the most qualified members to answer questions about using the 6551. I was going to link you to Garth's pages (heck, I will anyway), but he seems to be (for the most part) a 6522 kind of guy. Please correct me if I'm wrong, Garth ...

I have a lot of material on the '22 simply because it's very versatile for so many uses. The '51 is of course more of a dedicated-purpose IC. However, I have the 6502-oriented RS-232 primer, although someone who's already familiar with RS-232 will be able to skim through most of it; and near the end of my interrupts primer, under the section title "Interrupt support for RS-232 receive" there's some example 6502 code for running an RS-232 receive buffer using a 6551, and on setting up the 6551 for the job.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Mon Mar 06, 2017 7:34 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10842
Location: England
sepseel wrote:
Sadly I don't know how to do any of those things, could you point me to a good source on how to do one of those things ?

OK, sounds like we need to slow down, backtrack, and do some reading. Jeff's projects contain a number of monitors. What you have is a serial port, so ideally we need to
- find a monitor program which uses a serial port
- read that code and start to understand what's going on
- modify the code to suit your hardware (which is to say, port the monitor to your machine)
- run the code on your hardware

In the meantime, I would suggest running something on Kowalski's simulator to get a feel for computing at this low level - it sounds like this might be new territory for you. But it's a lot of fun - I recommend exploring.

First thing I found, still in Jeff T's projects, is a tiny program which sprays characters out of a serial device (sometimes called ACIA, sometimes UART)
https://github.com/jefftranter/6502/blo ... et/demo1.s

It would not be a bad idea to get something like this to run. It's much like a Hello World.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Mon Mar 06, 2017 7:17 pm 
Offline

Joined: Sun Mar 05, 2017 4:31 pm
Posts: 36
Ok, so quick update:

I have been playing around with the emulator, as you sugested. And I managed to get ehBASIC running, and executing a hello world program.
Doing this has made me a litle bit more understanding of the software aspect of 6502.

However, when i try to assemble the code from: https://github.com/jefftranter/6502/blob/master/asm/SpeakJet/demo1.s
I get an error telling me this: ERROR E017: Missing constant value (number, label, function or '*'). ROW 18
What is this telling me ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Help using cc65
PostPosted: Mon Mar 06, 2017 7:43 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10842
Location: England
The input on line 18 is
lda #%00011110 ; 2 stop bits, 8 data bits, internal clock, 9600 baud
and that's being rejected by your assembler. Most likely, the assembler doesn't understand the % syntax for binary. So, convert to hex: %00011110 is $1E and see if that works:
lda #$1E ; 2 stop bits, 8 data bits, internal clock, 9600 baud

Sooner or later it's going to be worth getting to grips with hex and binary. Indeed it's a common source of error to use one when you mean the other:
lda #20
and
lda #$20
are going to behave differently! Most of us here will use hex almost all the time. One or two have a strong preference for decimal. They are, I believe, missing out on a crucial technique...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 94 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 8 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: