6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 4:24 am

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: easy 6502 help im new
PostPosted: Fri Apr 08, 2022 4:04 pm 
Offline

Joined: Fri Apr 08, 2022 3:55 pm
Posts: 6
Hi, I'm new to programming in the 6502 and I currently use https://skilldrick.github.io/easy6502/ and I want to make a program where the number 1964 is displayed in the second column of the screen. I hope someone can help me it's quite simple I know but it cost me a lot and help would help me a lot


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 4:24 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
Welcome. The number 1964 is four columns wide, so your spec is a bit ambiguous. Are you interested in just programming for that specific hard-coded result, or do you want us to help you with a more general-purpose solution, which would allow easily changing the number value and screen location?

_________________
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: Fri Apr 08, 2022 4:27 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
[crossed in the post!]

Welcome! How much of the easy6502 tutorial have you followed? What have you managed to write so far?

easy6502's output is a colour bitmap, so I think to write any kind of number you will need to design a bitmap font - perhaps a very small one, if numbers is all you need. For example, you can write 4 digits in a 7 segment kind of font using only 5 rows of 15 pixels, I think.

Which, unfortunately, still means quite a bit of programming... and as ever, there's more than one way to do it.

In order of increasing sophistication:
- just write directly to the exact addresses, in one long program of absolute writes
- or write and use some subroutines to draw horizontal or vertical segments. I think you need to draw 18 segments.
- write and use subroutines to draw characters - you only need 4 subroutines as you only have 4 distinct characters
- write and use a general 4x6 pixel font output routine
- write and use a general 7 segment font output routine


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 4:37 pm 
Offline

Joined: Fri Apr 08, 2022 3:55 pm
Posts: 6
the only thing I have to do is that the numbers 1964 are displayed in column 2 and 1582 in column 3


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 4:44 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
ObiWan0910 wrote:
the only thing I have to do is that the numbers 1964 are displayed in column 2 and 1582 in column 3
Welcome! Do you perhaps mean row 2 and row 3?

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 4:48 pm 
Offline

Joined: Fri Apr 08, 2022 3:55 pm
Posts: 6
Dr Jefyll wrote:
ObiWan0910 wrote:
the only thing I have to do is that the numbers 1964 are displayed in column 2 and 1582 in column 3
Welcome! Do you perhaps mean row 2 and row 3?

-- Jeff


yes jeff row 2 (1964), row 3(1582)


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 4:53 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Umm, is this a homework assignment? If so, we may be able to help, but the idea is for you to learn, so we must not do the work for you.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 4:57 pm 
Offline

Joined: Fri Apr 08, 2022 3:55 pm
Posts: 6
BigEd wrote:
Umm, is this a homework assignment? If so, we may be able to help, but the idea is for you to learn, so we must not do the work for you.


I would like it to be homework, I want to learn this language on my own and I want to display these numbers since one is my mother's date of birth and the other is my lucky number hahaha


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 5:47 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Perhaps you could clarify what you mean by rows?

Could you sketch the output you intend in a paint tool?

Just for clarity - I don't think this changes the result much. To draw a 1, you need to place at least 5 pixels. There's no machinery in easy6502 to draw a 1 in a single operation. It's not a character mapped display.

Having said which, I did add a kind of character output to my own fork...
https://biged.github.io/6502js/
where a program like
lda #$45
wdm 0
will print an E into the messages box.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 6:02 pm 
Offline

Joined: Fri Apr 08, 2022 3:55 pm
Posts: 6
BigEd wrote:
Perhaps you could clarify what you mean by rows?

Could you sketch the output you intend in a paint tool?

Just for clarity - I don't think this changes the result much. To draw a 1, you need to place at least 5 pixels. There's no machinery in easy6502 to draw a 1 in a single operation. It's not a character mapped display.

Having said which, I did add a kind of character output to my own fork...
https://biged.github.io/6502js/
where a program like
lda #$45
wdm 0
will print an E into the messages box.


I think I didn't explain myself very well, sorry.

What I want to do is draw the numbers with the pixels I will send an example


Attachments:
EXAMPLE.jpeg
EXAMPLE.jpeg [ 309.04 KiB | Viewed 1478 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 6:49 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Thanks for the example - that makes it clearer to me.

What ideas do you have about tackling this? (How much programming experience do you have, generally?)

I've a suspicion you might not realise how much code will be needed.


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 7:32 pm 
Offline

Joined: Fri Apr 08, 2022 3:55 pm
Posts: 6
BigEd wrote:
Thanks for the example - that makes it clearer to me.

What ideas do you have about tackling this? (How much programming experience do you have, generally?)

I've a suspicion you might not realise how much code will be needed.


the truth would be lying to you if I told you that I have a lot of knowledge. I think I'm starting from scratch if you can help me with 1964 it would be great


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 8:12 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I'm just wondering if you need to start smaller... did you run through the tutorial at all?


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 08, 2022 8:21 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Since you are starting from scratch, and you wish to learn, can I suggest some more appropriate goals? (Start smaller, as Ed said. And following the tutorial is a good idea.)

As your first exercise, you could write some code that causes a certain number of dots (single pixels) to appear in a horizontal row on the screen. (These won't look like digits. But they are *much* easier to create. And you can visually count them to verify that your code is correct.)

After you're able to draw a single row, next you could try a program that...
  • ... draws 1 dot in the first row, then
  • ... draws 9 dots in the row below that, then
  • ... draws 6 dots in the row below that, then
  • ... draws 4 dots in the row below that...!

... thus crudely signifying the number '1964' :mrgreen:

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 12, 2022 3:38 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
After successfully passing Jeff's challenge, the next thing I would do is compose a general-purpose PLOT function, then test it out before using it to write a VLIN and an HLIN, similar to what Woz did for his Apple ][ 45 years ago, but easier because the emulator screen is mapped much simpler. You could then iterate through some data that has been carefully set up to draw all of the digits, and Bob's your uncle.

[Woz wrote those subroutines plus CLRSCR and COLOR in less than 120 bytes of code, but he's Woz, so ...]

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 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: