Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-06T10:13:30.607Z
Answers.LastActivityDate: 2017-06-06T10:13:30.607Z
Answers.UserDisplayName: Gypsy Spellweaver
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T17:20:04.910Z
Answers.LastActivityDate: 2018-01-22T17:20:04.910Z
Answers.UserDisplayName: diaa
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T18:27:00.470Z
Comments.Text: would the language choice tag fit here?
Comments.UserDisplayName: ItamarG3
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T19:19:50.440Z
Comments.Text: Good point, added.
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T19:43:24.740Z
Comments.Text: Just curious, is this all for HS students? I'm quite impressed.
Comments.UserDisplayName: xuq01
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T20:06:28.160Z
Comments.Text: 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?
Comments.UserDisplayName: Sean Houlihane
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T20:13:18.430Z
Comments.Text: @xuq01 Yes, all for HS. We have an unusually advanced program for the states, with 4-year CS majors in HS.
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T20:17:11.043Z
Comments.Text: @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.
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T20:30:35.983Z
Comments.Text: @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).
Comments.UserDisplayName: xuq01
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-05T23:38:50.067Z
Comments.Text: 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.
Comments.UserDisplayName: Peter
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-23T04:50:06.167Z
Comments.Text: 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.
Comments.UserDisplayName: pojo-guy
Tags: <language-choice><assembly>
Title: Good beginning assembly language for teaching about stack function calls
ThreadText: # 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**: @username_3 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 @username_6 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>
  
  
  ---
  
  