home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / decus / RB128 / ex1.txt < prev    next >
Text File  |  1995-06-04  |  602b  |  32 lines

  1. / Lets begin with a
  2. / simple program
  3. /
  4. / in 'pseudo-Pascal':
  5. /   result:=0;
  6. /   for ndx:=1 to 10 do
  7. /      result:=result+ndx;
  8. *20
  9. ndx, 0 /here are 'globals'
  10. result, 0
  11. *200
  12. / here is standard start
  13. / location for code
  14.          cla iac
  15.         dca ndx /set ndx to 1
  16.         dca result / & result to 0
  17. loop, tad ndx
  18.          tad result
  19.          dca result  /accumulate sum
  20.          iac
  21.          tad ndx
  22.          dca ndx   /increment count
  23.          tad ndx
  24.           cia
  25.          tad dec10 /test against limit
  26.          sma cla
  27.          jmp loop
  28.          hlt
  29. dec10, 0012
  30. $
  31.  
  32.