Live data from Hacker News

Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

gitlab.brokenpipe.de

11–20 of 21 posts

Re: Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

#11
post #8

I had quite some fun implementing this at a very lovely lake in Sweden, while my colleagues were attending GPCE.

That's absolutely hilarious, and a pretty fun hack. By the way, if I understood you correctly, this sentence > I'm still missing 5 opcodes (MULS, MULSU, FMUL, FMULS, FMULSU), but until now I did not encounter a C file, the AVR-GCC emits these opcodes. could be rewritten as > There are 5 opcodes that are not implemented (MULS, MULSU, FMUL, FMULS, FMULSU), as I have not yet encountered a C file for which AVR-GCC emits…

The classic AVR instruction set does not include multiplication, you have to be targeting a device that supports AVRe+, such as an ATmega rather than an ATtiny. Try adding -mmcu=avr5 and it will show up pretty quick. Example: https://godbolt.org/z/x951M8fn8

Edit: nice work author, I love it!

Re: Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

#14

I had quite some fun implementing this at a very lovely lake in Sweden, while my colleagues were attending GPCE.

> I had quite some fun implementing this at a very lovely lake in Sweden

Was there a wonderful telephone system and many interesting furry animals?

Re: Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

#16
post #8

Earlier quoted context omitted.

That's absolutely hilarious, and a pretty fun hack. By the way, if I understood you correctly, this sentence > I'm still missing 5 opcodes (MULS, MULSU, FMUL, FMULS, FMULSU), but until now I did not encounter a C file, the AVR-GCC emits these opcodes. could be rewritten as > There are 5 opcodes that are not implemented (MULS, MULSU, FMUL, FMULS, FMULSU), as I have not yet encountered a C file for which AVR-GCC emits…

The classic AVR instruction set does not include multiplication, you have to be targeting a device that supports AVRe+, such as an ATmega rather than an ATtiny. Try adding -mmcu=avr5 and it will show up pretty quick. Example: https://godbolt.org/z/x951M8fn8 Edit: nice work author, I love it!

> rather than an ATtiny

The new ATtiny 0/1/2-series parts are full AVRxt cores with a few instructions removed due to lack of need for large memory access. The classic terminology differentiating product lines isn't particularly useful anymore. ATtiny can multiply now.

Re: Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

#17
The fact that you can do stuff like this with a typesetting system has always amused me. Back when I was in grad school for mechanical engineering, some other people in my research group were doing computational mechanics. We would always joke about writing all their simulations in TeX, so that the TeX file for their paper would include all of the simulation code too, and rebuilding the document would run all the simulations and generate the plots.

Re: Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

#19

The fact that you can do stuff like this with a typesetting system has always amused me. Back when I was in grad school for mechanical engineering, some other people in my research group were doing computational mechanics. We would always joke about writing all their simulations in TeX, so that the TeX file for their paper would include all of the simulation code too, and rebuilding the document would run all the sim…

But that should be the way it is done rather than be a joke.

Re: Avremu: An 8-Bit AVR Microcontroller Simulator Written in LaTeX

#20
I've been thinking of perfecting my AVR-8 assembly by writing an AVR-8 emulator in AVR-8 assembly. This is less useless than it sounds because one could upload a small program into RAM and run it if you had such an emulator. AVR-8 has so many registers that it ought to be possible to dedicate only some of them to the emulator and let the rest be shared between the real and virtual environments,
Post reply on HN