-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
define instruction from easy 6502 not working #7
Comments
Which assembler are you trying to use? Each assembler does have unique choices for how to express a program, and easy6502 is no exception! |
I tried downloading the 6502 JS Assembler, it would not recognize the
Define instruction as used in the tutorials.
…On Wed, Nov 22, 2017 at 8:12 AM, BigEd ***@***.***> wrote:
Which assembler are you trying to use? Each assembler does have unique
choices for how to express a program, and easy6502 is no exception!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZWIeJ0ZT07rFBPYSBXHaAJA9jMlNl3ks5s5B3MgaJpZM4Qmb5Q>
.
|
Do you mean http://www.6502asm.com/ ? If so, it has no define, so from the examples we see the tactic is to use a label:
|
Oops sorry I have just realised that I was confused between easy6502 and 6502js. Let me look into this. We do know the two assemblers have diverged. My own fork of 6502js is different again. |
OK Cool thank you, yeah I was hoping that there was one of these I could
download to practice assembly on my own, like building snake from scratch
with the embedded screen you guys had in easy 6502
if this is possible, plz lemme know, I know easy6502 had a define
instruction for their snake example
…On Sun, Nov 26, 2017 at 9:55 AM, BigEd ***@***.***> wrote:
Oops sorry I have just realised that I was confused between easy6502 and
6502js. Let me look into this. We do know the two assemblers have diverged.
My own fork of 6502js is different again.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZWIQqk8gIm7lsgTLIoDC7yWc39vo2Zks5s6XvlgaJpZM4Qmb5Q>
.
|
for example, trying to use the easy 6502 assembler downloaded from easy 6502
in the tutorial, they use (define) as a means of declaring
constants/variables. Upon downloading the Assembler though, the define
instruction stops working. How would I still define variables/constants?
…On Sun, Nov 26, 2017 at 4:11 PM, Raymond Liberto ***@***.***> wrote:
OK Cool thank you, yeah I was hoping that there was one of these I could
download to practice assembly on my own, like building snake from scratch
with the embedded screen you guys had in easy 6502
if this is possible, plz lemme know, I know easy6502 had a define
instruction for their snake example
On Sun, Nov 26, 2017 at 9:55 AM, BigEd ***@***.***> wrote:
> Oops sorry I have just realised that I was confused between easy6502 and
> 6502js. Let me look into this. We do know the two assemblers have diverged.
> My own fork of 6502js is different again.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#7 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AOZWIQqk8gIm7lsgTLIoDC7yWc39vo2Zks5s6XvlgaJpZM4Qmb5Q>
> .
>
|
Just started looking at this. I see you can use the same kind of workaround, abusing the label mechanism to define a symbol:
|
How would you use this technique in something like a constant? Lets say for
example I wanted to set sysRandom = $fe (the RNG on the mock 6502)
*=255 - is this setting mask to 255 decimal? I'm a little confused as to
how this example works in practice, thanks for the help
…On Mon, Nov 27, 2017 at 1:01 PM, BigEd ***@***.***> wrote:
Just started looking at this. I see you can use the same kind of
workaround, abusing the label mechanism to define a symbol:
* = 255
mask:
* = $600
start:
nop
lda mask
nop
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZWIY97nMZy4uBFvwi884n2isdjzom6ks5s6vj0gaJpZM4Qmb5Q>
.
|
Here's a slight expansion of the example:
and the disassembler says we got this:
So, it's a little ugly, and it takes two lines to make each define, but I think it works generally. |
(However, I notice the tactic fails for immediate values. I should have written |
Aghh that's unfortunate, was going to use this idea for costants related
to collision, if there's a workaround, kindly let me know, thx!
…On Nov 27, 2017 13:33, "BigEd" ***@***.***> wrote:
(However, I notice the tactic fails for immediate values. I should have
written
lda #mask
but that turns out not to work at all.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZWIZmu_RS1174kTfSBEKHzU4ZPjAEJks5s6wCIgaJpZM4Qmb5Q>
.
|
oh and just for context, I'm trying to build snake/pong in the assembler
without using the help of the tutorial, so i assume even if reformatted for
the above hack, that code still wouldnt assemble given the #immediatevalue
error.
…On Mon, Nov 27, 2017 at 1:35 PM, Raymond Liberto ***@***.***> wrote:
Aghh that's unfortunate, was going to use this idea for costants related
to collision, if there's a workaround, kindly let me know, thx!
On Nov 27, 2017 13:33, "BigEd" ***@***.***> wrote:
> (However, I notice the tactic fails for immediate values. I should have
> written
> lda #mask
> but that turns out not to work at all.)
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#7 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AOZWIZmu_RS1174kTfSBEKHzU4ZPjAEJks5s6wCIgaJpZM4Qmb5Q>
> .
>
|
I think we'd need to bring the whole 'define' mechanism in from easy6502 to 6502js. Meantime, could you work using a local copy of easy6502 instead of using 6502js? I tend to try out small snippets just using the first emulation window - the snake is way down the file and needn't distract you. |
Yes that would be perfect, could you link me to the appropriate place to
grab the easy 6502 engine? Tha k you so much
…On Nov 27, 2017 13:57, "BigEd" ***@***.***> wrote:
I think we'd need to bring the whole 'define' mechanism in from easy6502
to 6502js.
Meantime, could you work using a local copy of easy6502 instead of using
6502js? I tend to try out small snippets just using the first emulation
window - the snake is way down the file and needn't distract you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZWIW5Y1MDr5k0k7ZYvBDwur327LbNiks5s6wYAgaJpZM4Qmb5Q>
.
|
Oh wait I see what you mean, yeah that sounds good, please keep me posted
as to when you add in define. Also curious, how do I reserve bytes for
variables? For the nes, all I usually will do is (nesasm)
ballspeedx: .rs 1
…On Nov 27, 2017 13:57, "BigEd" ***@***.***> wrote:
I think we'd need to bring the whole 'define' mechanism in from easy6502
to 6502js.
Meantime, could you work using a local copy of easy6502 instead of using
6502js? I tend to try out small snippets just using the first emulation
window - the snake is way down the file and needn't distract you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOZWIW5Y1MDr5k0k7ZYvBDwur327LbNiks5s6wYAgaJpZM4Qmb5Q>
.
|
Reserving some bytes... I think the effect will be to set the label and then for the next label to take a slightly higher value. So perhaps just use dummy code sequences instead:
|
I made a fork of the emulator here and fixed the issue partially. the following would now work :
I haven't yet managed to make it work in indexing modes though, so
would not assemble, assuming value is a constant defined by the |
Assembler doesn't recognize the same instruction from the tutorial
The text was updated successfully, but these errors were encountered: