Giter VIP home page Giter VIP logo

Comments (5)

hlorenzi avatar hlorenzi commented on May 14, 2024

Hi! I'm glad you're finding it useful!

Could you please post an example program, showing the problem and your workaround? I'd like to make sure I'm getting the problem right. I'm not sure how your program bank integrates with the data bank -- there are two address spaces?

from customasm.

p-rivero avatar p-rivero commented on May 14, 2024

In order to make the most out of 8 bit addresses, there are 4 address spaces: instruction low, instruction high, data and stack (the stack isn't important since you don't program it directly).
This means that even though addresses are technically 2 byte long, the PC ony gets increased by one when jumping to the next one.
example
Untitled-1
Note that the output position in the file (outp column) is correct. The only problem is the wrong address, that causes jumps to go to twice the correct position,

Using #bits 16 means that the data bank stops working completely, so I used #bits 8 and came up with this solution:
Instead of defining a jump like this: J {Addr8: u8} -> { 0xA0 @ Addr8[7:0] }
I define it like this: J {Addr8: u9} -> { 0xA0 @ Addr8[8:1] }, so the address gets divided by 2.
Also in bankdef for the program I have to set the #size as twice the actual size.
The ony drawback is that when you type the address instead of using a label it doesn't work (because the number you type will get divided by 2), but you shouldn't be doing that anyways.

Thank you for your time and hard work 👍

from customasm.

p-rivero avatar p-rivero commented on May 14, 2024

The issue seems to have been solved in v0.11 with the ability to set #bits for each bank. However, it looks like it doesn't work unless I type the directive every time I want to change banks:

#bank data
#bits 8
...

#bank program
#bits 16
...

Is this a bug or intended behaviour? I think the #bank directive should set the #bits automatically if you already specified it in the bankdef

from customasm.

hlorenzi avatar hlorenzi commented on May 14, 2024

Oops, sorry! I've fixed this in v0.11.1. Could you let me know if it's now working for you?

from customasm.

p-rivero avatar p-rivero commented on May 14, 2024

Yes, now it's working perfectly. Thank you!

from customasm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.