Advertisement
sciking

Programma 101 emulator

Mar 9th, 2015
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. #programma 101 emulatore funzionale. Versione 0.0.1
  2. print """Emulatore delle funzioni dei calcolatori
  3. Olivetti P101 e P103. Sviluppato da Sciking
  4. www.computerblog.ga - www.informatica-semplice.it"""
  5. #piu informazioni presso http://computerblog.ga/2015/03/un-motore-per-emulare-la-perottina/
  6. K = 0
  7. B = 0
  8. C = 0
  9. D = 0
  10. E = 0
  11. F = 0
  12. M = 0
  13. A = 0
  14. def reg(k,b,c,d,e,f):
  15.     global K
  16.     global B
  17.     global C
  18.     global D
  19.     global E
  20.     global F
  21.     K = k
  22.     B = b
  23.     C = c
  24.     D = d
  25.     E = e
  26.     F = f
  27.    
  28. def add(add1,add2):
  29.     global A
  30.     global M
  31.     A = add1+add2
  32.     print A
  33.     M = add2
  34. def sott(sott1,sott2):
  35.     global A
  36.     global M
  37.     A = sott1-sott2
  38.     print A
  39.     M = sott2
  40. def molt(molt1,molt2):
  41.     global A
  42.     global M
  43.     A = molt1*molt2
  44.     print A
  45.     M = molt2
  46. def div(div1,div2):
  47.     global A
  48.     global M
  49.     A = div1/div2
  50.     print A
  51.     M = div2
  52. def stampanumero(num):
  53.     print num
  54. def stampareg(reg):
  55.     print reg
  56. def tekne(stringa):
  57.     print stringa
  58. def ass(numero):
  59.     global A
  60.     A = abs(numero)
  61.     print A
  62. def esci():
  63.     exit()
  64. def carmagn(name):
  65.     in_file = open(name,"r")
  66.     text = in_file.read()
  67.     in_file.close()
  68.     exec text
  69. def sqrt(reg)
  70.     global A
  71.     A = reg**0.5
  72.     print A
  73.  
  74. def menu():
  75.     input("Console P101/P203>>>  ")
  76.     menu()
  77.    
  78. menu()
  79. #see more at http://computerblog.ga/2015/03/un-motore-per-emulare-la-perottina/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement