Author Topic: Tips with assembly code  (Read 5437 times)

as3ii

  • Newbie
  • *
  • Posts: 2
    • View Profile
Tips with assembly code
« on: November 17, 2015, 11:41:15 pm »
Hello blackvoxel-team,
I'm a student and I'm studying assembly with freescale MCUs (MC9S08QG8). Can you change your language and use the real assembly? Your programming language is very different from the real assembly.
Thank you for your good work!

(P.S: Can you make a list of  address, names and Bit assignments of all registers? Can you add the lda (and ldx) and sta (and stx) assembly command? Thank you!)

Enigma

  • Administrator
  • Jr. Member
  • *****
  • Posts: 68
    • View Profile
Re: Tips with assembly code
« Reply #1 on: November 18, 2015, 11:44:26 pm »
Hi, as3ii... and welcome to the blackvoxel forum  :)

The problem about "the real assembly" is that there's not one, but a lot of very different "real" assembly languages.

Each different microprocessor or microcontroller type have it's own. And there's a lot of processors on the market...

The idea behind the virtual processor in the Blackvoxel assembly robot was to focus on basic principles and understanding the role of each different instructions categories.

Even if instructions can be named differently on different microprocessor, you'll find rougly the same principles and instruction categories.

The processor you are speaking about is significantly different. It's architecture is based on the old Motorola 6800 that got out in the market in 1974. Unfortunately, a lot of little microcontrollers on the market still use some old design.

In the other hand, more recent microprocessors(including the 68000 that was the successor of the 6800) made very different architectural choices. As an example, the single accumulator concept and the specialised (index) registers was replaced by a bunch of multi purpose registers. So you wont find the LDA or LDX instructions anymore on recent designs.

The choice on the Blackvoxel's robot processor was rather to make something simple and modern. That explain the differences with your microcontroller.

In theory, it is possible to implement the real instruction sets of a real microprocessors in the blackvoxel robot. But that would be an important work to implement the instructions sets of all real processors on the market.

As we have little ressources at this time, I'm afraid there is nearly no chance we add this in the todo list for now. But if someone want to contribute to write something on this, he is welcome. That could be a good exercice for a student.

About the list of address, there is some documentation here including description of registers and bits of the virtual circuits used. As I assume you have already seen these documents, I guess maybe you suggest something different, like a synthetic register list of all registers ?

But remember that we emulate a computer (and not a microcontroller). Unlike microcontrolers, registers in  simple computers are not always tightly packed in memory space (because chips address space are often decoded in a simple way there is some gaps betweed circuit memory spaces). That's why chip registers in computers are often listed on a circuit per circuit basis.

That said, we think that making a synthetic register map could be a good idea. We'll think about it.

The Blackvoxel Team

as3ii

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Tips with assembly code
« Reply #2 on: November 19, 2015, 08:01:52 am »
Ok, thank you for the explanation!