NEWS: Total Picture Views: 147066 | Total Article Views: 155675 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. How to read a JSON and work with it | 3. PickUpThings with Becker Robot | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

Program Example Assembly

Description:

Small Code Example in Assembly

Code:

org 100h
include "emu8086.inc"

call cleanScreen                  
start proc

cmp clear,1h
je cleanScreen    
      
add i,1h    ;Increment i by 1    

cmp i,1h    ;Check if i = 1
je part1:

cmp i,2h    ;Check if i = 2
je part2:

cmp i,3h    ;Check if i = 3
je part3:

cmp i,4h    ;Check if i = 4
je part4:

part1:
   
printn "      ___"     
printn "     /\  \"    
printn "    /::\  \"   
printn "   /:/\ \  \"  
printn "  _\:\~\ \  \" 
printn " /\ \:\ \ \__\"
printn " \:\ \:\ \/__/"
printn "  \:\ \:\__\ " 
printn "   \:\/:/  /"  
printn "    \::/  /"   
printn "     \/__/"
printn "Welcome to Sheridan" 
printn "Press escape to display a message",0Dh,0Ah, "$"
mov clear,1h
call gettingInput   
 

part2:

     
printn "      ___"    
printn "     /\__\"    
printn "    /:/ _/_"   
printn "   /:/ /\  \"  
printn "  /:/ /::\  \" 
printn " /:/_/:/\:\__\"
printn " \:\/:/ /:/  /"
printn "  \::/ /:/  /" 
printn "   \/_/:/  /"  
printn "     /:/  /"   
printn "     \/__/" 
printn "Welcome to Sheridan"
printn "Press escape to display a message",0Dh,0Ah, "$"
mov clear,1h
call gettingInput  

part3:
                  
printn "      ___"     
printn "     /  /\"    
printn "    /  /:/_"   
printn "   /  /:/ /\"  
printn "  /  /:/ /::\" 
printn " /__/:/ /:/\:\"
printn " \  \:\/:/~/:/"
printn "  \  \::/ /:/" 
printn "   \__\/ /:/"  
printn "     /__/:/"   
printn "     \__\/"                       
printn "Welcome to Sheridan"
printn "Press escape to display a message",0Dh,0Ah, "$"
mov clear,1h
call gettingInput  

part4:
                   
printn "      ___"     
printn "     /  /\"    
printn "    /  /::\"   
printn "   /__/:/\:\"  
printn "  _\_ \:\ \:\" 
printn " /__/\ \:\ \:\"
printn " \  \:\ \:\_\/"
printn "  \  \:\_\:\" 
printn "   \  \:\/:/"  
printn "    \  \::/"   
printn "     \__\/"    
printn "Welcome to Sheridan"
printn "Press escape to display a message (12 Characters)",0Dh,0Ah, "$"
mov clear,1h 
call gettingInput  

jmp end
start endp  

cleanScreen proc
INT 10h
mov AH,0
mov clear,0h
jmp start
cleanScreen endp


gettingInput proc 
    mov ah,1
    int 21h
    cmp al,1Bh
    jne start  ;if ESC is press then get String and Print it 
gettingInput endp


enterText proc
mov dx,12      
call get_string 
printn
printn "You typed: "               
call print_string
jmp start 
enterText endp

end:
              
RET                       
i DB 0h;Variable for incrementation
clear DB 0h;                                   
hlt
define_print_string
define_get_string 

end


Attachments: None

Tags: Assembly

Total Views: 861

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 07/13/15 and updated on 07/13/15


affiliate_link

Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.