<p>Go with the 6502. Its market penetration and popularity has generated a lot of resources over the years, giving you more to work with. Looking into the "home-brew CPU" realm should supply significant material to make reproducing the 6502 in Ligisim fairly easy. It already has a small instruction set (around 150 operations) that includes stack operations. There are also several assemblers available that will allow you to cross-assemble the code on a PC and load it into the 6502.</p>

<p>As a bonus for the students, because of its popularity, there should be a few programs in the wild that you can get for the architecture students to run after they build the processor. Of course, that means they'd have to implement the whole processor, but it also gives them the boost of making the processor that will run a "real" program off the Internet.</p>

<p>As a bonus for you, since you've already been using it for the assembly class, you already have the materials, lessons, and experience for the assembly class and can concentrate on building lessons for the design class.</p>

CC BY-SA 3.0
2017-06-06T10:13:30.607Z
2017-06-06T10:13:30.607Z
Gypsy Spellweaver
<p>Have you considered using a microcontroller assembly?</p>

<p>My first CPU design and assembly course, which also combined both courses, was based on the PIC microcontroller. We studied the 8-bit variant, which has a relatively simple architecture.</p>

<p>It has slightly more registers than the 6502; you can say 8 registers with the 16-bit registers like PC spilt into two 8-bit registers. However, it also has embedded RAM and ROM so you can teach them about memory access if you find that useful. It also has fewer instructions (33). In addition, it is still used a lot in the real world, so they can possibly buy a cheap development kit and play around with it.</p>

<p>Here's a guide to the PIC assembler:
<a href="http://ww1.microchip.com/downloads/en/DeviceDoc/33014K.pdf" rel="nofollow noreferrer">http://ww1.microchip.com/downloads/en/DeviceDoc/33014K.pdf</a></p>

CC BY-SA 3.0
2018-01-22T17:20:04.910Z
2018-01-22T17:20:04.910Z
diaa
<p>We are considering integrating our processors design and architecture course with our assembly programming course by using the same processor for both. The processor class (which does its work in Logisim) does not have to necessarily implement the entire processor used by the assembly class.  A usable subset would be fine.</p>

<p>The assembly class focuses on stack operations, function calls, and PC operations, so any assembly language that we move to would have to support these as well.</p>

<p>Currently, our assembly class uses 6502, which has 6 registers (including flags), and a very limited number of commands.  This might end up being our best choice for integrating into processors, as I have not found anything simpler yet.</p>

<p>As far as the processor design class is concerned, 8-bit machines are about twice as good as 16-bit machines, and about 4x as good as 32-bit machines, and I'd like to keep the number of registers down to a manageable number.  6502's 6 registers is pretty reasonable.</p>

<p>The only assembly language for beginners that I have found is ACSL assembly, but it lacks a memory bus entirely (so no stack).  Are there other languages that I am overlooking?</p>

CC BY-SA 3.0
2017-06-05T18:27:00.470Z
would the language choice tag fit here?
ItamarG3
CC BY-SA 3.0
2017-06-05T19:19:50.440Z
Good point, added.
Ben I.
CC BY-SA 3.0
2017-06-05T19:43:24.740Z
Just curious, is this all for HS students? I'm quite impressed.
xuq01
CC BY-SA 3.0
2017-06-05T20:06:28.160Z
What would be wrong with using this RISC version of LMC http://www.peterhigginson.co.uk/RISC/ - or at least a subset thereof? What's the processor course implementation target?
Sean Houlihane
CC BY-SA 3.0
2017-06-05T20:13:18.430Z
@xuq01 Yes, all for HS. We have an unusually advanced program for the states, with 4-year CS majors in HS.
Ben I.
CC BY-SA 3.0
2017-06-05T20:17:11.043Z
@SeanHoulihane The processor class should be building a turing complete processor that they can do *some* coding on. The assembly class will do (obviously) much more coding, and zero wiring.
Ben I.
CC BY-SA 3.0
2017-06-05T20:30:35.983Z
@BenI. Looks to me that your graduates could totally go right into graduate CS classes when they get to college. I wish I could have attended such a HS program. That being said, it looks to me that MIPS is one way to go. Its calling conventions are very similar to that of x86-64, and its ISA is simple enough (just a handful of instructions).
xuq01
CC BY-SA 3.0
2017-06-05T23:38:50.067Z
Have you explored Nand2Tetris? That book/course could make for a rich, year-long course on the HS level and could lead to important discussions about processor design and assembly language.
Peter
CC BY-SA 3.0
2018-01-23T04:50:06.167Z
Back in the day,  we learned 6502 assembly, as @gypsyspellweaver siggests, because it was what was available. We then hand assembled it (ugh) and put it into memory with "poke" statements. Of course we did this all from spec sheets, since computing books didn't have enough circulation for economy of scale,  and teachers didn't have the interest or time to dig past the BASIC.
pojo-guy
<language-choice><assembly>
Good beginning assembly language for teaching about stack function calls
# Good beginning assembly language for teaching about stack function calls

(Asked by: username_0 on 2017-06-05)

We are considering integrating our processors design and architecture course with our assembly programming course by using the same processor for both. The processor class (which does its work in Logisim) does not have to necessarily implement the entire processor used by the assembly class. A usable subset would be fine.

The assembly class focuses on stack operations, function calls, and PC operations, so any assembly language that we move to would have to support these as well.

Currently, our assembly class uses 6502, which has 6 registers (including flags), and a very limited number of commands. This might end up being our best choice for integrating into processors, as I have not found anything simpler yet.

As far as the processor design class is concerned, 8-bit machines are about twice as good as 16-bit machines, and about 4x as good as 32-bit machines, and I'd like to keep the number of registers down to a manageable number. 6502's 6 registers is pretty reasonable.

The only assembly language for beginners that I have found is ACSL assembly, but it lacks a memory bus entirely (so no stack). Are there other languages that I am overlooking?

**Tags:** language-choice, assembly

> **Comments:**
> **username_1**: would the language choice tag fit here?  
> **username_0**: Good point, added.  
> **username_2**: Just curious, is this all for HS students? I'm quite impressed.  
> **username_3**: What would be wrong with using this RISC version of LMC http://www.peterhigginson.co.uk/RISC/ - or at least a subset thereof? What's the processor course implementation target?  
> **username_0**: @username_2 Yes, all for HS. We have an unusually advanced program for the states, with 4-year CS majors in HS.  
> **username_0**: @SeanHoulihane The processor class should be building a turing complete processor that they can do *some* coding on. The assembly class will do (obviously) much more coding, and zero wiring.  
> **username_2**: @BenI. Looks to me that your graduates could totally go right into graduate CS classes when they get to college. I wish I could have attended such a HS program. That being said, it looks to me that MIPS is one way to go. Its calling conventions are very similar to that of x86-64, and its ISA is simple enough (just a handful of instructions).  
> **username_4**: Have you explored Nand2Tetris? That book/course could make for a rich, year-long course on the HS level and could lead to important discussions about processor design and assembly language.  
> **username_5**: Back in the day,  we learned 6502 assembly, as @gypsyspellweaver siggests, because it was what was available. We then hand assembled it (ugh) and put it into memory with "poke" statements. Of course we did this all from spec sheets, since computing books didn't have enough circulation for economy of scale,  and teachers didn't have the interest or time to dig past the BASIC.  

---

## 2 answers

### Answer by username_6 on 2017-06-06. Score: 5

Go with the 6502. Its market penetration and popularity has generated a lot of resources over the years, giving you more to work with. Looking into the "home-brew CPU" realm should supply significant material to make reproducing the 6502 in Ligisim fairly easy. It already has a small instruction set (around 150 operations) that includes stack operations. There are also several assemblers available that will allow you to cross-assemble the code on a PC and load it into the 6502.

As a bonus for the students, because of its popularity, there should be a few programs in the wild that you can get for the architecture students to run after they build the processor. Of course, that means they'd have to implement the whole processor, but it also gives them the boost of making the processor that will run a "real" program off the Internet.

As a bonus for you, since you've already been using it for the assembly class, you already have the materials, lessons, and experience for the assembly class and can concentrate on building lessons for the design class.


---

### Answer by username_7 on 2018-01-22. Score: 4

Have you considered using a microcontroller assembly?

My first CPU design and assembly course, which also combined both courses, was based on the PIC microcontroller. We studied the 8-bit variant, which has a relatively simple architecture.

It has slightly more registers than the 6502; you can say 8 registers with the 16-bit registers like PC spilt into two 8-bit registers. However, it also has embedded RAM and ROM so you can teach them about memory access if you find that useful. It also has fewer instructions (33). In addition, it is still used a lot in the real world, so they can possibly buy a cheap development kit and play around with it.

Here's a guide to the PIC assembler:
<http://ww1.microchip.com/downloads/en/DeviceDoc/33014K.pdf>


---

