Created
July 3, 2019 08:38
-
-
Save MaheKarim/2db8d216e1728478fd4053e4b9e02ed5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;WRITE AN CODE THAT DIPLAY "HELLO WORLD" IF USER PRESS 1 | |
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
PRINT "PRESS 1 FOR DISPLAY" | |
MOV AH, 1 | |
INT 21H | |
CMP AL, "1" | |
JE ABC | |
ABC: | |
PRINTN | |
PRINT "HELLO WORLD! " | |
JMP EXIT | |
JNE EXT | |
ext: | |
PRINTN | |
PRINT "WRONG!" | |
EXIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.MODEL SMALL | |
.STACK 100H | |
.DATA | |
.CODE | |
MAIN PROC | |
MOV CX, 26 | |
MOV DX, 65 | |
M1: | |
MOV AH,2 | |
INT 21H | |
INC DX | |
LOOP M1 | |
MOV AH, 4CH | |
INT 21H | |
MAIN ENDP | |
END MAIN | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" ; emu8086 helper added | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC ; main procedure start | |
PRINT "ENTER YOUR FIRST VALUE: " | |
MOV AH, 01H ; input a character | |
INT 21H ; " " " | |
MOV BH, AL ; first value store BH | |
PRINTN | |
PRINT "ENTER YOUR SECONED VALUE: " | |
INT 21H | |
MOV BL, AL ; seconed value store BL | |
PRINTN | |
PRINT "ENTER YOUR THIRD VALUE: " | |
INT 21H | |
MOV CH, AL ; third value store CH | |
ADD BH, BL ; add functionality | |
SUB BH, 30H ; sub assembler value when we do add | |
; now value store in BH | |
SUB BH, CH ; subtract functionality (BH - CH) | |
ADD BH, 30H ; add assembler value when we do sub | |
PRINTN ; new line printer | |
PRINT "THE RESULT OF (A+B)-C IS : " | |
MOV AH, 2 ; instruction for print out | |
MOV DL, BH ; our ans store on BH and dl use for print ans | |
INT 21H | |
MOV AH, 4CH ; DOS function: Exit program | |
INT 21H ; Call DOS: Terminate program | |
MAIN ENDP ;end of program | |
END MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" ; helper file added | |
.MODEL SMALL ; model decalre | |
.STACK 100H | |
.CODE ; code segment start | |
MAIN PROC | |
PRINT "ENTER YOUR FIRST VALUE: " ; if we declare emu8086 then we can use | |
MOV AH, 01H ; new chracter input | |
INT 21H ; after new chracter input we have to use | |
MOV BH, AL ; value store on BH destination | |
PRINTN ; new line help with emu8086 helper | |
PRINT "ENTER YOUR SECONED VALUE: " | |
INT 21H | |
MOV BL, AL ; seconed value store on BL | |
ADD BH, BL ; add those (BH + BL) | |
SUB BH, 30H ; sub assembler value | |
PRINTN | |
PRINT "THE RESULT IS: " | |
MOV AH, 2 ; instuctions for print | |
MOV DL, BH | |
INT 21H ; instruncion end | |
MOV AX, 4C00H ; DOS function: Exit program | |
INT 21H ; Call DOS: Terminate program | |
MAIN ENDP ;end of program | |
END MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Write a program that will "Check given values are equal or not" | |
include "emu8086.inc" | |
.model small | |
.stack 100h | |
.code | |
main proc | |
print "Enter a number: " | |
mov ah,1 | |
int 21h | |
mov bl,al | |
printn | |
print "Enter another number: " | |
mov ah,1 | |
int 21h | |
mov cl,al | |
cmp bl,cl | |
je check | |
jne check2 | |
jmp exit | |
check: | |
printn | |
print "Numbers are equal" | |
jmp exit | |
check2: | |
printn | |
print "Numbers are not equal" | |
jmp exit | |
exit: | |
main endp | |
end main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Write a program to read character,if it is an uppercase, then display it. | |
include "emu8086.inc" | |
.model small | |
.stack 100h | |
.code | |
main proc | |
print "Enter a char: " | |
mov ah,1h | |
int 21h | |
mov bl,al | |
cmp bl,64 | |
jg check1 | |
jmp exit1 | |
check1: | |
cmp bl,91 | |
jl check2 | |
jmp exit1 | |
check2: | |
printn | |
print "This is uppercase" | |
jmp exit | |
exit1: | |
printn | |
print "This is not uppercase" | |
exit: | |
main endp | |
end main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.MODEL SMALL | |
.STACK 100H | |
.DATA | |
.CODE | |
MAIN PROC | |
LOOP: | |
MOV CX, 3 | |
MOV AH, 2 | |
MOV DL, '*' | |
TOP: | |
INT 21H | |
LOOP TOP | |
EXIT: | |
MOV AH,4CH | |
INT 21H | |
MAIN ENDP | |
END MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
PRINT "INPUT A NEW CHARACTER: " | |
MOV AH, 1 | |
INT 21H | |
MOV BL, AL | |
CMP BL, "a" | |
JNGE EXIT | |
CMP BL, "z" | |
JNLE EXIT | |
PRINTN | |
PRINT "YOUR CASE : IS UPPER CASE!" | |
EXIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
PRINT "ENTER YOUR FIRST VALUE: " | |
MOV AH, 1 | |
INT 21H | |
MOV BH, AL | |
PRINTN | |
PRINT "ENTER YOUR SECONED VALUE: " | |
INT 21H | |
MOV BL, AL | |
SUB BH, BL | |
ADD BH, 30H | |
PRINTN | |
PRINT "THE RESULT IS: " | |
MOV AH, 2 | |
MOV DL, BH | |
INT 21H | |
MOV AX, 4C00H | |
INT 21H | |
MAIN ENDP | |
END MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;WRITE AN CODE THAT DIPLAY "HELLO WORLD" IF USER PRESS 1 | |
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
PRINT "PRESS 1 FOR DISPLAY" | |
MOV AH, 1 | |
INT 21H | |
CMP AL, "1" | |
JNE EXT | |
PRINTN | |
PRINT "HELLO WORLD! " | |
EXT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.DATA | |
.CODE | |
MAIN PROC | |
MOV AH, 1 | |
INT 21H | |
MOV BL, AL | |
UP: | |
PRINTN | |
PRINT "HELLO WORLD!" | |
DEC BL | |
CMP BL, '0' | |
JG UP | |
EXIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;WRITE AN CODE THAT WILL DISPLAY THE FIRST CHARACTER THAT IS CAME IN CHARACTER | |
;SEQUENCE THAT IS STORED IN AL AND BL REGISTER | |
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
PRINT "ENTER YOUR BL VALUE: " | |
MOV AH, 01H | |
INT 21H | |
MOV BL, AL | |
PRINTN | |
PRINT "ENTER YOUR AL VALUE: " | |
INT 21H | |
CMP BL,AL | |
JL EXT | |
PRINTN | |
MOV AH,2 | |
MOV DL, AL | |
INT 21H | |
JMP EXIT | |
EXT: | |
PRINTN | |
MOV AH, 2 | |
MOV DL, BL | |
INT 21H | |
EXIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Write a program taking a character and output in a new line. | |
INCLUDE "emu8086.inc" | |
.MODEL SMALL | |
.STACK 100h | |
.CODE | |
MAIN PROC | |
MOV AH,1H | |
INT 21H ; INPUT TAKING | |
MOV BL,AL | |
PRINTN ; print order | |
MOV AH,2H ; OUTPUT | |
MOV DL,BL ; STORE IN DL | |
INT 21h | |
MAIN ENDP | |
END MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
PRINT "INPUT A NEW CHARACTER: " | |
MOV AH, 1 | |
INT 21H | |
MOV BL, AL | |
CMP BL, "A" | |
JNGE NONE | |
CMP BL, "Z" | |
JNLE LOW | |
PRINTN | |
PRINT "YOUR CASE : IS UPPER CASE!" | |
JMP EXIT | |
LOW: | |
CMP BL, "a" | |
JNGE NONE | |
CMP BL, "z" | |
JNLE NONE | |
PRINTN | |
PRINT "YOUR CASE : IS LOWER CASE!" | |
JMP EXIT | |
NONE: | |
PRINTN | |
PRINT "NONE OF THEM!" | |
EXIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "EMU8086.INC" | |
.MODEL SMALL | |
.STACK 100H | |
.CODE | |
MAIN PROC | |
MOV CL, O | |
PRINT ""ENTER YPU MESSAHGE" | |
UP: | |
MOV AH, 1 | |
INT 21H | |
MOV BL,AL | |
CMP BL, 0DH | |
JE PNT | |
INC CL | |
JMP UP | |
PNT | |
PRINTN | |
ADD CL, 30H | |
MOV AH,2 | |
MOV DL, CL | |
INT 21H | |
EXIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAIN PROC | |
PRINT "INPUT A CHARACTER" | |
MOV AH,1 | |
INT 21H | |
CMP AL, 'Y' | |
JE PNT | |
CMP AL , 'y' | |
JNE EXIT | |
PNT: | |
PRINTN | |
PRINT 'HELLO WORLD!' | |
EXIT: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment