Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 1.20 KB | None | 0 0
  1.  
  2. org 100h
  3.        
  4. wantedTemp db 60        
  5. jmp main  
  6.  
  7. main:
  8.   PRINTN
  9.    
  10.   mov ah, 06h
  11.   mov dl, 0FFh
  12.   int 21h
  13.  
  14.   jnz chngTrgTemp
  15.  
  16.   in al, 125
  17.  
  18.   cmp al, wantedTemp
  19.  
  20.  
  21.   jb therm_on
  22.   jae therm_off
  23.  
  24. chngTrgTemp:
  25.   cmp al, '+'
  26.   jne subToTemp
  27.   jmp addToTemp
  28.  
  29.   jmp main  
  30.  
  31. therm_on:
  32.   mov bl, al
  33.    
  34.   mov al, 1
  35.   out 127, al
  36.  
  37.   ;printing the current temp
  38.   mov ax, 0
  39.   mov al, bl
  40.   call print_num
  41.  
  42.   jmp main
  43.  
  44. therm_off:
  45.     mov bl, al
  46.    
  47.     mov al, 0
  48.     out 127, al
  49.    
  50.     ;printing the current temp
  51.     mov ax, 0
  52.     mov al, bl
  53.     call print_num
  54.      
  55.     jmp main      
  56.  
  57. addToTemp:
  58.     cmp wantedTemp, 120
  59.     jne addTemp
  60.    
  61.     jmp main
  62.    
  63.     addTemp:
  64.         add wantedTemp, 1
  65.        
  66.         ;Printing the dest temp
  67.         xor ax, ax
  68.         mov al, wantedTemp
  69.         call print_num
  70.         PRINTN
  71.        
  72.         jmp main
  73.    
  74.    
  75. subToTemp:
  76.     cmp wantedTemp, 1
  77.     jne subTemp
  78.    
  79.     jmp main
  80.    
  81.     subTemp:
  82.         sub wantedTemp, 1
  83.        
  84.         ;Printing the dest temp
  85.         xor ax, ax
  86.         mov al, wantedTemp
  87.         call print_num
  88.         PRINTN
  89.        
  90.         jmp main
  91.  
  92.  
  93. finish:  
  94.     mov ah, 0
  95.     int 16h
  96.  
  97.     ret
  98.    
  99. include magshimim.inc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement