macro/ex2a.mac
2022-03-10 20:40:38 +09:00

25 lines
640 B
Plaintext

TITLE G062 - TRIANGLE Example 2-A
SEARCH MONSYM
Comment $ Program to print a Triangle $
START: RESET
MOVEI 10,5 ;let register 10 be the line number.
;set it to 5.
;print each line
LINE: MOVE 11,10 ;copy the line number to register 11
;print the stars on each line
STARS: HRROI 1,ASTER ;Print one asterisk
PSOUT
SOJG 11,STARS ;decrement star count, loop if more
HRROI 1,NEWLIN ;print carriage return and line feed
PSOUT ; to prepare for the next line.
SOJG 10,LINE ;decrement the line numbe held in 10.
; If the result is positive, do another line
HALTF ;stop here
ASTER: ASCIZ /*/
NEWLIN: ASCIZ /
/
END START