I want to know if there are exercises of RISC assembly programming language to do?I understand the assembly language but there is nothing to implement in assembly.So I want to know if there are some resources to implement programs in assembly?
Asked
Active
Viewed 379 times
0
-
2You can implement whatever you like. Maybe start reimplementing the C string handling functions (`strlen`, `strcpy`, `strstr`, ...). Do FizzBuzz, array min, max, sorting, prime filtering, etc. – Jester Apr 05 '16 at 13:01
-
1There is nothing to implement in assembly?? Seriously? You can implement anything in assembly!!! Pick a project and start writing. – David Hoelzer Apr 05 '16 at 15:53
-
Next time you see a small but interesting C function, and you wonder what it might look like in assembly, implement it yourself in asm. Or look at optimized compiler output (`-O3`) and understand how the compiler's choices get the job done. `-O3` output is a good choice for small functions. For x86, arm, and ppc, you can use the [godbolt compiler explorer](http://gcc.godbolt.org/). I wrote [some suggestions for learning asm for x86](http://stackoverflow.com/a/34918617/224132), some of which apply in general to any assembly language. (looking at compiler output and writing small functions) – Peter Cordes Apr 05 '16 at 19:04
-
1A lot of people seem to get bogged down in the system calls for input/output when writing whole programs in asm. Learning some system call API is a separate thing from understanding instructions, registers, and memory addresses, which is why I think it's a good idea to start with a small function you call from C. – Peter Cordes Apr 05 '16 at 19:06
-
Some math-fun tasks can be found here: https://projecteuler.net/ The easy ones will be very likely as easy to solve as in any high level language. Actually for most of them you don't even need output, as you may simply run it in debugger and pick results from memory. – Ped7g Apr 06 '16 at 09:30
-
I usually implment a few programs dealing with graphics (drawing shapes, ect...) and then string related programs (markov chain, ect...) when learning a new language to get the hang of it. You could try to implement Forth if you want a larger project. – SANK Apr 10 '16 at 21:50
3 Answers
1
Yes, it's one thing to understand each instructions from the manual and it's another thing to combine them to implement (efficiently) this or this functionality.
One thing I've done often is to compile some small functions (and indeed things like strlen()
and friends are a good start) and then to study the resulting assembly, understanding the interesting tricks and optimizations, exploring which instructions can be used for what.
After a short while you will begin to think like "hey, why is this done like this? It will be simpler/shorter/more efficient to do it this other way". You can then begin to try your new idea and you have now a very concrete objective for some code to write.

lucvoo
- 501
- 4
- 15
0
As a newbie I'll tell you what I am trying to do.
- learn algorithms specifically algorithms related to computer graphics
- implement them in mips and learn things like making a calculator, fibonacci sequence, etc
- eventually create a simple game in the language
- practice will be the best thing you can do to learn this

cjj20
- 60
- 9