================================================ Assembly Program for Reading an Unsigned Integer [TOC] ================================================ The "hello, world!" program will later be used for as a building block for a function printing string. But we will need more input/output functionality, e.g. reading and printing integers. In this session we first implement an assembly program for reading an unsigned integer. ---- VIDEO ------------------------------ https://www.youtube.com/embed/xfCteJW8HTY ----------------------------------------- Instruction Set Used in the Video ================================= :import: session10/io/0_ulm_variants/io/isa.txt [fold] The `get_uint64.s` Program Shown in the Video ============================================= :import: session10/io/0_ulm_variants/io/get_uint64.s [fold] Translating the Assembly Program into an Executable =================================================== ---- SHELL (path=session10/io, hide) ------------------------------------------- make -------------------------------------------------------------------------------- With ---- SHELL (path=session10/io) ------------------------------------------------- 1_ulm_build/io/ulmas 0_ulm_variants/io/get_uint64.s -------------------------------------------------------------------------------- the following exectuable `a.out` (the default name for the assembler output) gets created: :import: session10/io/a.out Some Test Run ------------- Using file redirection we can also read an unsigned integer from a file like this: ---- CODE (file=session10/io/test.txt) ----------------------------------------- 123 -------------------------------------------------------------------------------- So we can check the program like that: ---- SHELL (path=session10/io) ------------------------------------------------- 1_ulm_build/io/ulm a.out < test.txt echo $? -------------------------------------------------------------------------------- Quiz 9 ====== Write an assembler program that reads an unsigned integer, computes the factorial for this integer and then halts the program with the computed value as exit code. Hand in your instruction set architecture `isa.txt` and your assembly program `factorial.s` with `submit hpc quiz09 isa.txt get_uint_factorial.s`.