Search found 186 matches

by Garth
Sat Dec 17, 2016 6:43 pm
Forum: Newbie Help Center
Topic: IF/ELSE in assembly
Replies: 3
Views: 1891

Re: IF/ELSE in assembly

There are different ways to handle this. But to start, note that there's an automatic, implied, built-in compare-to-0 in every instructions that loads or affects A, X, or Y; so there's no need for CMP #0 after LDA. Also, if it's a chain of comparisons against successive numbers, you can increment or...
by Garth
Mon Dec 05, 2016 12:20 pm
Forum: Newbie Help Center
Topic: trouble with JMP and program counter.
Replies: 4
Views: 1644

Re: trouble with JMP and program counter.

I answered your PM before seeing this topic. Feel free to repeat it here if you like. I suppose some readers will be fascinated by the internal details as we figure it out, and others won't be until there's there's something finished and tested. Are you using the ams6 assembler? (I think that's what...
by Garth
Thu Dec 01, 2016 12:56 pm
Forum: Newbie Help Center
Topic: Question about smoothly handling multiple loops in asm.
Replies: 33
Views: 8510

Re: Question about smoothly handling multiple loops in asm.

I get up this morning and find a whole lot of new posts here. I'm glad this idea has quickly generated this level of interest here! It's refreshing, because what I've found in the past is that it's hard to get people past their preconceived notions and keep their attention long enough to clarify tha...
by Garth
Wed Nov 30, 2016 10:26 pm
Forum: Newbie Help Center
Topic: Question about smoothly handling multiple loops in asm.
Replies: 33
Views: 8510

Re: Question about smoothly handling multiple loops in asm.

Another option, that I personally find very useful, supported by ca65 (and possibly other assemblers), is to use scopes. Labels defined within one scope are only visible within that scope. The 2500AD assembler I used in the late 1980's used local variables to be ones followed by "$", and those were...
by Garth
Wed Nov 30, 2016 10:21 pm
Forum: Newbie Help Center
Topic: Question about smoothly handling multiple loops in asm.
Replies: 33
Views: 8510

Re: Question about smoothly handling multiple loops in asm.

Garth, welcome and thanks for moderating 6502.org, that side is a great learning resource. Using BASIC-like structure macros would help me a lot. I patterned mine mostly off of standard Forth structures, with a notable exception being FOR...NEXT, because I didn't think the Forth way, <to> <from> DO...
by Garth
Wed Nov 30, 2016 5:27 pm
Forum: Newbie Help Center
Topic: Question about smoothly handling multiple loops in asm.
Replies: 33
Views: 8510

Re: Question about smoothly handling multiple loops in asm.

This is my first post here. I'm the moderator on 6502.org. In my article at http://wilsonminesco.com/StructureMacros/, I show how to do structure macros in 6502 assembly. The inner details of how your particular assembler does macros may vary slightly. You can however do something like the following...