2 Replies - 907 Views - Last Post: 02 October 2017 - 03:27 PM

#1 HasAC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 24-June 16

No Output for average

Posted 30 September 2017 - 09:35 PM

I am trying to test out masm on ubuntu 16.04 running with dosbox I found this code for averaging out 3 numbers and it assembles and links and executes fine with no errors, there's just no output, I have tried searching everything and tried to modify it many ways and finally I'm here so if anyone can help me I would greatly appreciate it.

.MODEL SMALL
.data
     NUM1 DB 5
     NUM2 DB 9
     NUM3 DB 7
     AVG  DB ?

.code
	
main PROC
      MOV AX,@DATA
      MOV DS,AX
     
      MOV AL,NUM1
      ADD AL,NUM2  
      ADD AL,NUM3
     
      MOV AH,0
     
      MOV DL,3
      DIV DL
     
      MOV AVG,AL
           
      MOV AH,4CH
      INT 21H
	
main ENDP
END main



Is This A Good Question/Topic? 0
  • +

Replies To: No Output for average

#2 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 2130
  • View blog
  • Posts: 4,196
  • Joined: 30-May 10

Re: No Output for average

Posted 01 October 2017 - 10:26 AM

I guess the first place would be knowing what the int 21 does.
http://www.ctyme.com/intr/rb-2974.htm

The answer isn't printed, it's in the exit status of the process.

So you need to examine %ERRORLEVEL% to see that.
https://blogs.msdn.m...926-00/?p=20743
Was This Post Helpful? 0
  • +
  • -

#3 HasAC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 24-June 16

Re: No Output for average

Posted 02 October 2017 - 03:27 PM

Thank you for your response and I have reviewed these link but I am still confused.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1