Write and run (using appropriate calling program) a near procedure in 8086-assembly language, which is passed a single parameter by the calling program. The procedure checks if the input parameter is divisible by 5 or not. If the input parameter is divisible by 5, then a value of 1 is returned to the calling program, else a value 0 is returned. The calling program based on the returned value prints “Divisible” or “NOT Divisible”. You may assume that the parameter value would always be greater than or equal to 1. Make and state suitable assumptions, if any.
code for the procedure in 8086 assembly language:
DivBy5 PROC NEAR
MOV AX, [BP + 4] ; Load the input parameter into AX
CMP AX, 0 ; Check if the input is zero or not
JE Exit ; If zero, jump to exit
MOV DX, 0 ; Clear DX register
DIV 5 ; Divide the input parameter by 5
CMP DX, 0 ; Check if there is any remainder
JNE NotDivisible ; If there is a remainder, jump to NotDivisible
MOV AX, 1 ; If the input parameter is divisible by 5, load 1 into ____ _______ ________ _______ ______ ________.
____ __________ ___ _______ _____ ___ _________ ___ _____.
_____ ________ _____ _________ ________.
______ ___ _______ _________ ______ _____ _____ _________ ___ ___ _______ _______.
____ ___ _______ ____ ___.
_______ ____ ________ _______ ____ __________ _____ _____ ______ _______ ____.
______ _____ _______ ________ ______ ___ _________.
_______ ____ ____ _______ ___ ___ ____ ____ ______ _______ _____.
___ _______ ______ ___ ______ _______ _____ _________ _____.
_________ _____ _____ ______ ____ ________ ________.
______ __________ __________ ___ ____ _____ ________ ______.
_______ _________ _______ _______ ___.
_______ ___ _____ ___ __________ _______.
__________ _________ _____ _____ ___ __________ _____.
__________ ____ ______ _______ ___ __________ ________.
________ ________ ___ _____ __________ ___ _________ ______ _______.
________ _______ ______ _________ _______ _____ ___ _________ __________ _____.
____ _________ __________ ___ ________.
___ ___ _______ ________ _____ ______ __________ ___ ________.
________ ____ _____ ________ _________ ________ ____ ______ _____ _________ _______.
_______ ______ ____ ______ ________ ____ _______.
_____ ______ _____ _______ _______ _____ _______ __________ _____ ___ ____ ___.
__________ _____ _____ __________ ___ ___.
_____ __________ ____ ___ ______ ___ __________ _________ _____ _________ __________ ______.
_________ ___ _____ ________ ________ _________.
_____ ____ ______ _________ _________ ___ _____ _____ _____ ____ ___.
_______ _______ ____ _______ _______ _________.
___ ____ _____ ______ __________ ______ _____ ___ _____.
_________ __________ ________ ________ __________ ________ ____ ____ ___ _________.
_______ ________ _________ _________ _____ _________ ______.
_____ __________ ____ __________ ________ _________ ______ ______ __________.
_______ ____ ____ ______ _________ _______ ______.
____ ___ _____ ______ _______ _________ ___ ___ ________ __________ ______ _________.
_________ _______ ___ ___ ____ __________ _________.
__________ __________ _____ ________ __________.
___ _______ __________.
Get Full Answer on WhatsApp