QuestionQuestion

The sample output should include leading 0's as follows:

0000000056 + 0000000003 = 0000000059
2147483647 * 0000000100 = ***multiplication overflow***
0000000023 % 0000000005 = 0000000003

In order to work with parameters directly on the stack in program 6 you may have to use "dword ptr".

For example: dword ptr [ebp + offset]

In some cases the system needs to know the size of the operand. ebp+offset is an address pointing to a location in memory but it does not say the size of what it is pointing to.

If you use [ebp + offset] and you get a compile error it may go away if you use dword ptr [ebp+offset].

The offset is either 8 or 12.

Just a heads-up: In doMult you should only use the single operand version of imul.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

.386      ;identifies minimum CPU for this program

.MODEL flat,stdcall    ;flat - protected mode program
                      ;stdcall - enables calling of MS_windows programs

;allocate memory for stack
;(default stack size for 32 bit implementation is 1MB without .STACK directive
; - default works for most situations)

.STACK 4096            ;allocate 4096 bytes (1000h) for stack

;Irvine32.lib contains the code for DumpRegs and many other Irvine
;functions
INCLUDELIB /Irvine/Irvine32.lib


;*******************MACROS********************************

;mPrtStr
;usage: mPrtStr nameOfString
;ie to display a 0 terminated string named message say:
;mPrtStr message

;Macro definition of mPrtStr. Wherever mPrtStr appears in the code
;it will be replaced with

mPrtStr MACRO arg1    ;arg1 is replaced by the name of string to be displayed
push edx ;save edx
         mov edx, offset arg1 ;address of str to display should be in edx
         call WriteString       ;display 0 terminated string
         pop edx ;restore edx
ENDM...

50% discount

Hours
Minutes
Seconds
$98.00 $49.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats