Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

READING CODE – STACK

  • Posted
  • Authoradmin
  • Length189 words
  • Reading time1 min
Write My Assignment FREE

READING CODE – STACK

;list the output of the following program assuming the input is as follows:

101

232

48

17

include PCMAC.INC

NEWLINE EQU _PutCh 13, 10

.MODEL SMALL

.STACK 100h

.DATA

Message1 DB ‘Total sold today, $’

Message2 DB ‘ , is: $’

.CODE

EXTERN GetDec: NEAR, PutDec:NEAR

Main PROC

mov ax, @data

mov ds, ax

_GetDate

push cx

push dx

push dx

call SubInput ;send control to subprocedure

mov bx, ax

_PutStr Message1

pop dx

mov al, dh

mov ah, 0

call PutDec

_PutCh ‘/’

pop dx

mov al, dl

mov ah, 0

call PutDec

_PutCh ‘/’

pop cx

mov ax, cx

call PutDec

_PutStr Message2

mov ax, bx

call PutDec

NEWLINE

mov al, 0 ; Return code of 0

mov ah, 4ch ; Exit back to MSDOS

int 21h

Main ENDP

.Data ; re-enter the data segment for this procedure

MessageSub DB ‘Enter a number $’

Mystery DW ?

.CODE ; return to coding

SubInput PROC

mov cx, 4

myLoop:

_PutStr MessageSub

call GetDec

add Mystery, ax

dec cx

jnz myLoop

mov ax, Mystery

ret

SubInput ENDP

END Main ; Tells where to start execution

The post READING CODE – STACK appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order