Hi can anyone help me with this lab?? Variables .data You will define 1 variable
ID: 3888898 • Letter: H
Question
Hi can anyone help me with this lab??
Variables .data You will define 1 variable for each of these data types BYTE, SBYTE, WORD, SWORD, DWORD, SDWORD That makes 6 variables altogether. For each data type define a variable name of your choice and initialize to a valid value of your choice ( the value must be within range for the data type, but only 1 of them can be 0) For each of those variables, add a comment that gives the max and min value for that data type Examples ; largest value is 255 and its smallest is 0 ; largest value is 127 and its smallest is -128 chickenWingsEaten BYTE 14 temperatureChange SBYTE3 "main" method (pseudo code) .code Clear EAX, EBX, ECX, EDX registers (mov 0 into each) Load a 32-bit variable into a 32-bit "A" register Load a 16-bit variable into a16-bit "B" register Load a 8-bit variable into the high 8 bit "C" register Load one of the other variables into one of the "D" registers call dumpRegs Grading Rubric 6 declarations each initialized (24 points) comments for each of the 6 declarations stating min/max for the data type (12 points) clearing registers (5 points) loading 4 variables into the registers as directed (20 points) calling dumpRegs (5 points) Comments for: your name up top, and each command (or logical grouping) in.code (18 points) "meaningful variable names" following guidelines (8 points) Neat Indenting (variables flush left, body of main neatly indented) (8 points)Explanation / Answer
.DATA
age BYTE 15 ; defines a variable to represent age of a person. Smallest value is 0 and largest value is 255
ageDifference SBYTE -5 ; defines a variable to represent difference between ages of two persons. Smallest value ; is -128 and largest value is 127
salary WORD 30000 ; defines a variable to represent salary of a person. Smallest value is 0 and largest value is ; 65,535
salaryDifference SWORD -5000 ; defines a variable to represent difference between salaries of two persons. ; Smallest value is -32,768 and largest value is +32,767
totalYearlyIncome DWORD 1000000 ; defines a variable to represent total yearly income of a person. Smallest ; value is 0 and largest value is 4,294,967,295 (4 MegaBytes)
totalYearlyIncomeDifference SDWORD -500000 ; defines a variable to represent difference between total yearly ; income of two persons. Smallest value is -2,147,483,648 and ; largest value is +2,147,483,647
.CODE
main PROC
mov EAX, 0 ; Moving 0 to EAX register
mov EBX, 0 ; Moving 0 to EBX register
mov ECX, 0 ; Moving 0 to ECX register
mov EDX, 0 ; Moving 0 to EDX register
mov EAX, DWORD PTR totalYearlyIncome[2]
mov EBX, salary
mov ECX, age
mov EDX, SDWORD PTR totalYearlyIncomeDifference[2]
call DumpRegs ; display registers
exit ; halt program
main ENDP ; end procedure
END main ; end main
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.