;SAMP.MC ; simple SISC SAMPle program ;by Wen-Nung Tsai, tsaiwn@csie.nctu.edu.tw ;this is a sample Machine Code for the SISC ; that will print out the code of myself ; in decimal form 分號開始或空白行都會被忽略 2 1,01 ; R1=1 (00) 空白和逗號可出現於任何地方 2200 ; R2=0 (02) 233A ; R3 = length of this program 3209 ; store r2 into 9 (:AGAIN = 06) 16 00 ; LOAD r6 from ?? (:08 :09 ) 20 4d ; r0="M" d1 00 ; print "M" 20 28 ; "(" d100 ; print "(" (:10h) 40 2,0 ; move r2 to r0 (:12h) d300 ; print r0 as integer 20 29 ; ")" d100 203d;"=" d100 4060; move r6 to r0 d300 ; out content of mem[r2] (:20h) 200d; CR d100 20 0A ;LF d100 ; print Line Feed (:28h) 40 30 ; move r3 to r0 (program length) 5221 ; r2 := r2+1 (r1 contains 1) B232 ; jump to done if R2=R0=R3 b006 ; goto :AGAIN=06 (this line :30) 2007 ; bell (:done = 32) d100 ; beep the speaker c000 ; halt ffff ; for man check only