Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 Network Masking An Internet Protocol version 4 ( IPv 4 ) address is represented in dotted decimal notation. Here is an example of
Problem Network Masking
An Internet Protocol version IPv address is represented in dotted decimal notation. Here is an example of an IPv address for an endpoint:
The IPv addressing scheme also requires a mask associated with each subnet. The mask is used to find the network address. The network address is essentially the base address of the network and is used for routing and switching. For example, suppose the mask for the above address is The mask indicates that the two rightmost octets are masked, since those bits are all turned off. So our network address is An IPv address conveniently fits into a DWORD. Lets look at all this in hex:
IP Address: xCA
Subnet Mask: xFFFF
Network Address: xCA
As you can see, an IP address can be represented in hex by simply concatenating the hex byte representation for each octet.
Write a complete, yet simple, x assembly program that can mask an IP address to produce the network address. I recommend using a console template. Develop a procedure that can mask an IP address to produce the network address. Create the function with the following prototype:
DWORD getNetAddressDWORD ipAddress, DWORD subnetMask;
The function consumes two DWORD parameters: the IP address and the subnet mask. The function returns the network address as a DWORD. Your program simply needs to define and call the procedure. Check your functions return value in EAX and provide screenshots of your registers to verify the accuracy of the functions return value.
the code i was provided earlier did not work. Im coding in VS win All of my code starts with
a samplpe partial code
MODEL FLAT
INCLUDE ioh ; header file for inputoutput
STACK
DATA
valueA DWORD
valueB DWORD
valueC DWORD
prompt BYTE "Value of a
prompt BYTE "Value of bnot zero
prompt BYTE "Value of c
string BYTE DUP
result BYTE DUP
resultLbl BYTE "Expression value",
CODE
MainProc PROC
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started