Live data from Hacker News

Elite on the 6502: The original 6502 assembly source, heavily commented

elite.bbcelite.com

51–60 of 61 posts

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#51

I think Computer Architecture can be designed around legacy but fun hardwares. So instead of using some fantasy machines such as LC-3, students can directly get into the world of 6502. First semester: mostly concentrated on 6502 with a full 6502 CPU emulator as the final project. Second semester: concentrate on a real machine such as the NES. Students need to learn to improve their emulators to program in it (so, do…

The more I think about AI the more often I get back to what little time humans have. Besides a tad useless your course would be a ton of fun but when I looked in my agenda I couldn't find a few years to spend on it.

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#52
post #47

Earlier quoted context omitted.

I don't actually care one way or another about that particular subject, but if you start making judgements about academic fields of study are worthwhile to pay for on the basis of value to society, you allow other people -- more ignorant people, let's say -- with different concepts of societal value to make somewhat unfortunate decisions. You might end up without any new literature at all.

Your comment is bunk: should society also pay for people's hobbies? Should we spend 100% of our economic output on humanities?

I should be clearer. I believe in the value of hobbies - but perhaps because my childhood hobbies were geekily technical.

I also perhaps shouldn't use absurdity to argue against illogical statements.

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#53
post #7
post #3

If I were king of the forest, there would be a degree program in Comparative Coding (comparative lit for code). We don’t treat this as a creative discipline and thus we don’t spend time looking at masters, how they were successful and the ways they were just as human as anyone. Someone would get paid for writing stuff like this, same as people getting paid to write about Poe, Cummings, Hemingway, Thoreau. But I guess…

Should people get paid to write about Poe, Cummings, Hemingway, Thoreau? The original works themselves are pretty accessible. People can just read them and form their own interpretations. I'm skeptical that I really gained anything from reading literary criticism, at least it didn't make me appreciate the original works more or make me a better writer. I understand that there's a long tradition of scholarship in comp…

Python is pretty accessible, too... Should we pay people to write it?

I had some great comp lit courses in undergrad, which exposed me to some really fascinating work that I wouldn't have found otherwise.

Especially a course on literature of the Caribbean, which looked at a combination of contemporary work and older Western lot which are typical reference points: Robinson Crusoe and the Tempest. A good course brings together interesting world, and provides some structured discussion of both history and culture. You get more out of it through discussion with both the Prof and other students.

These courses at the undergrad level also create more writing practice on diverse topics, which is critical for developing writing skills generally.

I went on to get a PhD in mathematics, and now do machine learning for conservation, collaborating with folks all over the globe. Understanding the shape and impact of colonialism has been important for my subsequent work.

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#54

I think Computer Architecture can be designed around legacy but fun hardwares. So instead of using some fantasy machines such as LC-3, students can directly get into the world of 6502. First semester: mostly concentrated on 6502 with a full 6502 CPU emulator as the final project. Second semester: concentrate on a real machine such as the NES. Students need to learn to improve their emulators to program in it (so, do…

Kind of like your idea in real life. The Vectrex is used in a college in Germany. Very fun projects result.

https://itwww.hs-pforzheim.de/daten/mitarbeiter/johannsen/ve...

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#55
post #7
post #3

If I were king of the forest, there would be a degree program in Comparative Coding (comparative lit for code). We don’t treat this as a creative discipline and thus we don’t spend time looking at masters, how they were successful and the ways they were just as human as anyone. Someone would get paid for writing stuff like this, same as people getting paid to write about Poe, Cummings, Hemingway, Thoreau. But I guess…

Should people get paid to write about Poe, Cummings, Hemingway, Thoreau? The original works themselves are pretty accessible. People can just read them and form their own interpretations. I'm skeptical that I really gained anything from reading literary criticism, at least it didn't make me appreciate the original works more or make me a better writer. I understand that there's a long tradition of scholarship in comp…

[deleted]

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#56
post #3

If I were king of the forest, there would be a degree program in Comparative Coding (comparative lit for code). We don’t treat this as a creative discipline and thus we don’t spend time looking at masters, how they were successful and the ways they were just as human as anyone. Someone would get paid for writing stuff like this, same as people getting paid to write about Poe, Cummings, Hemingway, Thoreau. But I guess…

There's a famous annotated version of Unix V6 that falls into this category. I heard that it had copyright issues for years, though. It'd be interesting to see people write more of these about open source code.

https://cs3210.cc.gatech.edu/r/unix6.pdf

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#57
post #51

I think Computer Architecture can be designed around legacy but fun hardwares. So instead of using some fantasy machines such as LC-3, students can directly get into the world of 6502. First semester: mostly concentrated on 6502 with a full 6502 CPU emulator as the final project. Second semester: concentrate on a real machine such as the NES. Students need to learn to improve their emulators to program in it (so, do…

The more I think about AI the more often I get back to what little time humans have. Besides a tad useless your course would be a ton of fun but when I looked in my agenda I couldn't find a few years to spend on it.

I think it's going to be more useful once they get pass the first two courses when they go for more advanced courses. I'd argue 6502 or 8086 is still more useful than LC-3 which is frequently used in CompArch classes.

The thing about advanced courses are: all production material more or less went through 30-40 years of evolution so it's impossible to get students to jump into it directly. Few people can hack modern gcc or Linux kernals nowadays. We can only go back some 30 years and work on the machines then to get some ideas.

Yeah it takes a lot of time though, plus it's just a concept, not real courses -- I myself is a very mediocre programmer.

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#58

Earlier quoted context omitted.

6502 would give them a dose of reality, but I think teaching people by having them program an 8-bit CISC chip is cruel. There's so many asymmetries that get in the way. (Also, I don't think anyone actually likes NES games except for nostalgia, but this might just be because square waves make my ears hurt.)

This just isn't true. There are plenty of very good NES games that have great game loops and are a blast to play. Some of the good ones have quirks or unintuitive controls but are still quite enjoyable.

Sure, if you turn off the sound. Maybe a lowpass filter would do.

I guess dads with NES nostalgia have lost their high-pitched hearing anyway.

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#59
post #49

Earlier quoted context omitted.

> First semester: mostly concentrated on 6502 with a full 6502 CPU emulator as the final project. I like the principle, and the 6502 holds a special place in my heart as my introduction to machine code programming on an Apple ][ in late 1980 after I got bored with BASIC after two days .. self-taught from the ROM listing and 6502 reference in the back of the manual. But it's absolutely the wrong ISA today. RISC-V RV32…

Something with meaningful restrictions such as register count and RAM that you'll hit quickly when hand-coding assembler is a super IMHO useful teaching tool. 16 registers is luxurious!

The 16 registers in RV32EC [1] on the CH32V003 is not a lot using the standard ABI once you take out the zero register, return address, stack pointer, globals pointer, and thread pointer [2] you're left with 11 registers, allocated as 6 function argument / local variable registers (caller cave), 2 callee save registers, and 3 temporary registers.

Empirically you need up to 20% more instructions executed vs the 32 register RV2I, which is also similar to what Intel reports with their new "APX" x86 extension giving 32 GPRs.

The 2k RAM also concentrates the mind more so than a 6502 or Z80 with 64k RAM.

[1] you can ignore the "C" for simplicity if you want

[2] which arguably you're not going to use for that purpose so it's effectively available too, most usefully as a 3rd callee save register.

Re: Elite on the 6502: The original 6502 assembly source, heavily commented

#60
post #49

Earlier quoted context omitted.

> First semester: mostly concentrated on 6502 with a full 6502 CPU emulator as the final project. I like the principle, and the 6502 holds a special place in my heart as my introduction to machine code programming on an Apple ][ in late 1980 after I got bored with BASIC after two days .. self-taught from the ROM listing and 6502 reference in the back of the manual. But it's absolutely the wrong ISA today. RISC-V RV32…

Something with meaningful restrictions such as register count and RAM that you'll hit quickly when hand-coding assembler is a super IMHO useful teaching tool. 16 registers is luxurious!

For a teaching tool, you can get the best of both worlds by simply restricting RISC-V to fewer registers. Something like: "Write this in RISC-V assembly, but only use registers 0..3, and 31 for the return address."
Post reply on HN