Search found 12 matches

by andrew
Tue Jul 28, 2020 8:05 pm
Forum: Newbies
Topic: 6502 tutorial series for beginners.
Replies: 3
Views: 1790

Re: 6502 tutorial series for beginners.

BigDumbDinosaur wrote:
However, I will introduce a pedantic matter.
That's totally ok! I totally agree with you about ambiguity and technical language. I am still able to edit my post on medium, when I get a chance I will go over what I wrote and take into account what you said. Thanks!
by andrew
Tue Jul 28, 2020 12:36 pm
Forum: Newbies
Topic: 6502 tutorial series for beginners.
Replies: 3
Views: 1790

6502 tutorial series for beginners.

Hey all,
After spending some time learning assembly I have tried to write some posts aimed at someone who has never seen any low-level programming language before. I posted it on r/learnprogramming last week and it got a good reaction from people, so I thought I'd try sharing it here too. I have a ...
by andrew
Wed Oct 23, 2019 9:50 pm
Forum: Newbies
Topic: Overflow confusion
Replies: 26
Views: 18266

Re: Overflow confusion

It's an interesting question -although an odd one

I think maybe I've got myself confused over something that maybe doesn't matter to much then haha I have been thinking of the Overflow flag as a way to "fix" the error - is that maybe not the best way to think of it? Is it just rather a way to ...
by andrew
Wed Oct 23, 2019 7:54 pm
Forum: Newbies
Topic: Overflow confusion
Replies: 26
Views: 18266

Re: Overflow confusion

Without specifically answering your question, allow me to direct you to the following excellent tutorials by 6502.org's own Bruce Clark. :)

The Overflow (V) Flag Explained

Beyond 8-bit Unsigned Comparisons


-- Jeff

Thanks for the response!
I've been reading through these just now and I ...
by andrew
Wed Oct 23, 2019 2:36 pm
Forum: Newbies
Topic: Overflow confusion
Replies: 26
Views: 18266

Overflow confusion

I am trying to really nail down how overflow works. If you add 2 signed numbers and the result should be >127 or <-128 this will cause an overflow (kinda like carry for an unsigned number more than 256).

I have been reading this: http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html ...
by andrew
Thu Sep 05, 2019 5:55 pm
Forum: Newbies
Topic: help understanding data transfer
Replies: 7
Views: 968

Re: help understanding data transfer

Back in those early days, I generally bought many of the books published by OSBORNE/McGraw-Hill. Computing books in general, the CRT controller handbook and some of the books from Lance Leventhal (6502 and Z80). One of my favorites is the 6502 Assembly Language Subroutines co-authored by Winthrop ...
by andrew
Sat Aug 31, 2019 8:51 am
Forum: Newbies
Topic: help understanding data transfer
Replies: 7
Views: 968

Re: help understanding data transfer

INC (POINTER) is not a valid 6502 instruction. Could that be a typo perchance?

Sorry, that was my fault. It is written as INC POINTER. I've double checked though, the rest is as it is in the book. I hadn't realised what you pointed out about the stack pointer wrapping, its something I'll keep in ...
by andrew
Fri Aug 30, 2019 5:10 pm
Forum: Newbies
Topic: help understanding data transfer
Replies: 7
Views: 968

help understanding data transfer

In Programming the 6502 there is a chapter on IO techniques. Zak's shows a piece of code like this:


LDX COUNT
WATCH LDA STATUS
BPL WATCH
LDA INPUT
PHA
DEX
BNE WATCH


I feel I understand this, it "watches" STATUS, then when bit 7 is one, it transfers INPUT to the stack, decreases X, then ...
by andrew
Thu Aug 29, 2019 5:29 pm
Forum: Newbies
Topic: Looking for some constructive criticism
Replies: 9
Views: 1273

Re: Looking for some constructive criticism


LDA #$05 ; these 4 lines put $0205 into p0
STA $01
LDA #$02
STA $02

LDY #05
lowList: ; deal with 5 to 1
TYA
STA ($01),Y
DEY
BNE lowList

LDX #15
LDY #05
highList: ; deal with 15 to 11
TXA
INY
STA ($01),Y
DEX
CPX #10
BCS highList ; if X > 10, loop

LDY #10 ; reload Y
LDA ($01),Y ...
by andrew
Tue Aug 27, 2019 7:52 pm
Forum: Newbies
Topic: Looking for some constructive criticism
Replies: 9
Views: 1273

Re: Looking for some constructive criticism

So, I've made some changes. I'm a little busy at work at the moment, so I haven't been able to implement everything.


LDX #05
LDY #00
lowList: ; deal with 5 to 1
TXA
INY
STA $0205, Y
DEX
BNE lowList
LDX #15
highList: ; deal with 15 to 11
TXA
INY
STA $0205, Y
DEX
CPX #10
BCS highList ...
by andrew
Mon Aug 26, 2019 3:14 pm
Forum: Newbies
Topic: Looking for some constructive criticism
Replies: 9
Views: 1273

Re: Looking for some constructive criticism

I notice you have one or two cases of branching over a jump: often you can swap those two instructions for a single branch, of the opposite sense.
That makes sense, I've changed the code to do that now.

So, if you have any register transfers like TYA or similar, there's a fair chance you can ...
by andrew
Mon Aug 26, 2019 2:18 pm
Forum: Newbies
Topic: Looking for some constructive criticism
Replies: 9
Views: 1273

Looking for some constructive criticism

Hey Everyone!
This is my first post here, hopefully this style of question is ok, if not I can post elsewhere or change it a bit.
I've been working through Rodney Zak's book Programming the 6502, and attempting the questions within in. One question asks the reader to write some code to find the ...