Assembly Language var01 is an SBYTE with magnitude 1 less that the maximum possi
ID: 3722272 • Letter: A
Question
Assembly Languagevar01 is an SBYTE with magnitude 1 less that the maximum possible positive SBYTE value. var02 is an SBYTE with a magniture 1 more than the minimum (most negative) SBYTE value. (This means +1 added to minimum SBYTE value). var03 is a WORD that is 5 less than the maximum possible WORD value. var04 is an SWORD with magnitude 5 more than the minimum possible (most negative) SWORD value. (This is +5 added to the minimum SWORD value). var05 is an SDWORD with magnitude 10016 more than the minimum (most negative) SDWORD value. (This means +10016 added to the minimum SDWORD value) var06 is an SDWORD with magnitude equal to the most negative SDWORD value. All magnitudes should be expressed as (possibly signed) base 10 numbers. The slides have a table that should be helpful. In the .code portion of the program do the following: zero out eax and ebx move var01 to al move var02 to ah add ah to al and put result in al move 10000000b to ah subtract ah from al and put result in al move var03 to ax move var04 to bx add ax to bx and put result in bx move var05 to eax subtract var06 from eax Assembly Language
var01 is an SBYTE with magnitude 1 less that the maximum possible positive SBYTE value. var02 is an SBYTE with a magniture 1 more than the minimum (most negative) SBYTE value. (This means +1 added to minimum SBYTE value). var03 is a WORD that is 5 less than the maximum possible WORD value. var04 is an SWORD with magnitude 5 more than the minimum possible (most negative) SWORD value. (This is +5 added to the minimum SWORD value). var05 is an SDWORD with magnitude 10016 more than the minimum (most negative) SDWORD value. (This means +10016 added to the minimum SDWORD value) var06 is an SDWORD with magnitude equal to the most negative SDWORD value. All magnitudes should be expressed as (possibly signed) base 10 numbers. The slides have a table that should be helpful. In the .code portion of the program do the following: zero out eax and ebx move var01 to al move var02 to ah add ah to al and put result in al move 10000000b to ah subtract ah from al and put result in al move var03 to ax move var04 to bx add ax to bx and put result in bx move var05 to eax subtract var06 from eax Assembly Language
var01 is an SBYTE with magnitude 1 less that the maximum possible positive SBYTE value. var02 is an SBYTE with a magniture 1 more than the minimum (most negative) SBYTE value. (This means +1 added to minimum SBYTE value). var03 is a WORD that is 5 less than the maximum possible WORD value. var04 is an SWORD with magnitude 5 more than the minimum possible (most negative) SWORD value. (This is +5 added to the minimum SWORD value). var05 is an SDWORD with magnitude 10016 more than the minimum (most negative) SDWORD value. (This means +10016 added to the minimum SDWORD value) var06 is an SDWORD with magnitude equal to the most negative SDWORD value. All magnitudes should be expressed as (possibly signed) base 10 numbers. The slides have a table that should be helpful. In the .code portion of the program do the following: zero out eax and ebx move var01 to al move var02 to ah add ah to al and put result in al move 10000000b to ah subtract ah from al and put result in al move var03 to ax move var04 to bx add ax to bx and put result in bx move var05 to eax subtract var06 from eax
Explanation / Answer
.386
.model flat, stdcall
.stack 4096
.data
var01 SBYTE 126 ;max value of sbyte is 127 so 1 less than that is 126
var02 SBYTE -127 ;minimum value of sbyte is -128 so 1 more than that is -127
var03 WORD 65531 ;maximum value of word is 65536 so 5 less than that is 65531
var04 SWORD -32763 ;minimum value of sword is -32768 so 5 more than that is -32763
var05 SDWORD 2147473632 ;minimum value of sdword is 2,147,483,648 so 10016 more than that is 2147473632
var06 SDWORD 2,147,483,648 ;minimum value of sdword is 2,147,483,648
.code
mov eax, 0 ;setting eax to zero
mov ebx, 0 ;setting ebx to zero
mov al,var01 ;moving value in var01 to al
mov ah,var02 ;moving value in var02 to ah
add al,ah ;adding ah to al and putting result to al
mov ah,10000000b ;moving 10000000 binary number to ah
sub [al],ah ;subtracting ah from al and storing the result in al
mov ax,var03 ;moving value in var03 to ax
mov bx,var04 ;moving value in var04 to bx
add bx,ax ;adding ax to bx and storing the result in bx
mov eax,var05 ;moving value in var05 to eax
sub [eax],var06 ;subtracting the value in var06 from eax
END
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.