TITLE "hello.a -- hello world program" ; this version repeats itself 5 times ; the code for the definite loop is not optimized USE "hawk.macs" USE "monitor.h" EXT UNUSED S START ; ------- application constants begin here HELLO: ASCII "Hello World! ",0 ; ------- application constants end here ALIGN 2 START: LIL R2,UNUSED ; initialize stack pointer LIL R1,DSPINI JSRS R1,R1 ; call monitor's dspini routine ; ------- application code begins here LIS R8,1 ; i = 1; LOOP: LIS R1,5 SUB R1,R8,R1 BGT QUIT ; while (i <= 5) do { LIL R3,HELLO ; parameter to display string LIL R1,DSPST JSRS R1,R1 ; call monitor's display string routine ADDSI R8,1 ; i = i + 1; BR LOOP QUIT: ; } ; ------- application code ends here LIL R1,EXIT JSRS R1,R1 ; call monitor's exit routine END