Answer to Question #277845 in Assembler for bhgb

Question #277845

Write and run an 8086 assembly language program to print a multiplication table by asking number from user.


1
Expert's answer
2021-12-09T17:34:16-0500

TITLE task.asm

; Description: The program  to print a

; multiplication table by asking number from user

INCLUDE Irvine32.inc

.data

msgN              BYTE   "Enter n: ", 0

msg_01           BYTE   " * ", 0

msg_02           BYTE   " = ", 0

.code

main PROC

   mov edx, OFFSET msgN

   call WriteString                              ; "Enter n: "

           call readDec

           call CrLf

   mov ecx,10

           mov ebx, 1

l1:

           push eax

           mov eax, ebx

           call writeDec  ; first factor

mov edx, OFFSET msg_01      ;" * "

call WriteString                                  

           pop eax

           call writeDec  ; second factor

           mov edx, OFFSET msg_02      ;" = "

call WriteString

           push eax

           mul ebx

           inc ebx

           call writeDec  ; multiplication result

           call CrLf

           pop eax

   loop l1

quit:

           call CrLf

           call CrLf

   Invoke ExitProcess, 0                      ; exit

main ENDP

END main



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS