// doubleprint.iml (c) 2000 Kari Laitinen // This program prints the text "I am IBM" as // "II aamm IIBBMM" on the screen. // The text is printed in two parts. The main program calls // a subroutine named "doubleprint_text" which in turn calls // a subroutine named "output_register_a_twice". // A subroutine that has been called by some program can // thus itself call another subroutine. // NOTE: The purpose of this program is not to make jokes // about the company "International Business Machines (IBM)" // or its products. Rather, with this program it is intended // to say that our Imaginary Computer is very simple and // powerless when compared to the large real computers that // are manufactured by IBM corporation. beginning_of_main_program: set_memory_pointer first_part_of_text call_subroutine doubleprint_text set_memory_pointer second_part_of_text call_subroutine doubleprint_text stop_processing first_part_of_text: STRING "I am " second_part_of_text: STRING "IBM" doubleprint_text: load_register_a_from_memory jump_if_register_a_zero end_of_doubleprint_text call_subroutine output_register_a_twice increment_memory_pointer jump_to_address doubleprint_text end_of_doubleprint_text: return_to_calling_program output_register_a_twice: output_byte_from_register_a output_byte_from_register_a return_to_calling_program