Вы находитесь на странице: 1из 8

New Text Document

org 100h
include emu8086.inc
PRINT 'My Name Is Nimesha Aggarwal'
int 60h
ret
END
INCLUDE emu8086.inc
ORG 100H
GOTOXY 2,1
PRINT 'ENTER THE CELCIUS:'
CALL SCAN_NUM
MOV AX,CX
MOV BH,9
MUL BH
MOV BH,5
DIV BH
MOV BH,AH
MOV AH,0
MOV BL,32
ADD AL,BL
GOTOXY 2,2
PRINT 'FAHRENHEIT IS :'
CALL PRINT_NUM
PRINT '.'
MOV AL,BH
CALL PRINT_NUM
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
RET
END
ORG 100h
include 'emu8086.inc'
LEA SI, msg1
CALL PRINT_STRING
CALL scan_num
Page 1
New Text Document
mov ax, cx
;putc 10
gotoxy 0,0
LEA SI, msg2
CALL PRINT_STRING
CALL scan_num
mov bx, cx
putc 10
MUL bx
Print "The mul is: "
CALL print_num
putc 10
putc 13
int 21h
msg1 DB 'Enter the first number: ',0
msg2 DB 'Enter the second number: ',0
DEFINE_SCAN_NUM
DEFINE_PRINT_STRING
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
include emu8086.inc
org 100h
GOTOXY 2,1
; print a welcome message:
lea si, msg1
call print_string
; get string to ds:di
lea di, buffer ; buffer offset.
mov dx, size ; buffer size.
call get_string
;putc 0Dh
;putc 10 ; next line.
GOTOXY 2,2,
; print using macro:
print "You've entered: "
; print string in ds:si using procedure:
mov si, di
call print_string
buffer db "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu"
Page 2
New Text Document
size = $ - offset buffer ; declare constant
msg1 db "Enter a string: ", 0
define_print_string
define_get_string
ret
end
include emu8086.inc
ORG 100h
GOTOXY 2,1
PRINT 'ENTER THE FIRST NO :'
CALL SCAN_NUM
MOV AL,CL
GOTOXY 2,2
PRINT 'ENTER THE SECOND NO :'
CALL SCAN_NUM
MOV BL,CL
CMP AL, BL ; compare AL - BL.
gotoxy 5,5
JE equal ; jump if AL = BL (ZF = 1).
PUTC 'N' ; if it gets here, then AL <> BL,
JMP stop ; so print 'N', and jump to stop.
equal: ; if gets here,
PUTC 'Y' ; then AL = BL, so print 'Y'.
stop:
ret
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM_UNS
DEFINE_PRINT_NUM
END
include "emu8086.inc"
org 100h
GOTOXY 2,1
CALL PTHIS
DB 'ENTER THE FRIST NUMBER :',0
CALL SCAN_NUM
mov aX, CX ; set al to 25.
GOTOXY 2,2
CALL PTHIS
DB 'ENTER THE SECOND NUMBER :',0
Page 3
New Text Document
CALL SCAN_NUM
mov bX, CX ; set bl to 10.
add ax,bx
gotoxy 2,3
call PTHIS
db 'sum is; ',0
CALL PRINT_NUM
MSG1 DB 'ENTER FRIST NUMBER :',0
MSG2 DB 'ENTER SECOND NUMBER :',0
DEFINE_SCAN_NUM
DEFINE_PRINT_STRING
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
DEFINE_PTHIS
ret
END
include emu8086.inc
org 100h
GOTOXY 2,1
PRINT 'ENTER A STRING: '
LEA DI,BUFFER
MOV DX,SIZE
CALL GET_STRING
GOTOXY 2,2
PRINT 'YOU HAVE ENTERED: '
MOV SI,DI
CALL PRINT_STRING
BUFFER DB 'UMEHMAJHIJJJJJ'
SIZE=$-OFFSET BUFFER
DEFINE_PRINT_STRING
DEFINE_GET_STRING
RET
END
Page 4
New Text Document
include emu8086.inc
ORG 100h
code segment
assume cs:code, ds:data, ss:stack
mov ah,02h
mov cx,26
mov dl,41h
lop:
int 21h
add dl,1h
loop lop
gotoxy 0,1
mov ah,02h
mov cx,26
mov dl,61h
lop1:
int 21h
add dl,1h
loop lop1
mov ah,4ch
int 21h
code ends
include emu8086.inc
ORG 100h
LEA SI,msg1
CALL PRINT_STRING
CALL SCAN_NUM
mov ax,cx
;putc 10
gotoxy 0,1
LEA SI,msg2
CALL PRINT_STRING
CALL SCAN_NUM
mov bx,cx
putc 10
gotoxy 0,2
Add ax,bx
Page 5
New Text Document
PRINT "The Add is::"
CALL PRINT_NUM
putc 10
putc 13
int 21h
msg1 DB 'Enter The First Number:',0
msg2 DB 'Enter The Second Number:',0
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM
DEFINE_PRINT_STRING
DEFINE_PRINT_NUM_UNS
INCLUDE emu8086.inc
ORG 100H
GOTOXY 2,1
PRINT 'ENTER THE FIRST NO :'
CALL SCAN_NUM
MOV AX,CX
GOTOXY 2,2
PRINT 'ENTER THE SECOND NO :'
CALL SCAN_NUM
MOV BX,CX
ADD AX,BX
GOTOXY 2,3
PRINT 'ENTER THE THRID NO. NO :'
CALL SCAN_NUM
MOV BX,CX
ADD AX,BX
MOV BH,3
DIV BH
MOV BL,AH
MOV AH,0
GOTOXY 2,4
PRINT 'AVERAGE IS :'
CALL PRINT_NUM
MOV AL,BL
PRINT '.'
CALL PRINT_NUM
Page 6
New Text Document
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM_UNS
DEFINE_PRINT_NUM
RET
END
include 'emu8086.inc'
ORG 100h
MOV CX, 10
mov ax, 0
label1:
mov bx, 2
xchg bx,ax
div ax
add ax,bx
call print_num
LOOP label1
RET
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
include emu8086.inc
org 100h
GOTOXY 2,1
call PTHIS
DB 'ENTER THE FIRST NO :',0
CALL SCAN_NUM
MOV AX,CX
GOTOXY 2,2
call PTHIS
DB 'ENTER THE SECOND NO:',0
CALL SCAN_NUM
MOV BX,CX
ADD AX,BX
GOTOXY 2,3
PRINT 'THE ADDTION OF TWO NUMBER IS:'
Page 7
New Text Document
CALL PRINT_NUM
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
DEFINE_PTHIS
MOV AH,4CH,
INT 21H
Page 8

Вам также может понравиться