32 lines
774 B
Plaintext
32 lines
774 B
Plaintext
TITLE TRI AGAIN - Example 2-B
|
|
SEARCH MONSYM
|
|
|
|
Comment $ A different triangle (Gorin p. 64) $
|
|
|
|
START: RESET ;begin execution here
|
|
MOVEI 12,0 ;initial line count
|
|
;here to print each line
|
|
LINE: MOVEI 13,0 ;initial character count
|
|
;print one character on a line
|
|
CHAR: CAML 13,12 ;skip if printing spaces
|
|
JRST PSTAR ;go print a star
|
|
HRROI 1,BLANK ;print a blank
|
|
PSOUT
|
|
JRST ELIN ;test for end of line
|
|
|
|
PSTAR: HRROI 1,ASTER ;print a star
|
|
PSOUT
|
|
ELIN: CAIGE 13,6 ;have we reached the end of line?
|
|
AOJA 13,CHAR ;print the next character
|
|
HRROI 1,NEWLIN ;print the carriage return & line feed
|
|
PSOUT
|
|
CAIGE 12,6 ;finished all lines yet?
|
|
AOJA 12,LINE ;no. do more.
|
|
HALTF ;all done
|
|
|
|
BLANK: ASCIZ / /
|
|
ASTER: ASCIZ /*/
|
|
NEWLIN: ASCIZ /
|
|
/
|
|
END START
|