Friday, November 26, 2021

Write a program that reads length of a side of a square and prints its perimeter.

 Include irvine32.inc

;AddTwo.asm-adds two 32-bit integer.

;chapter3 example

.386

.data

v byte "Square is : ",0

v1 byte "Perameter is : ",0

lenth DWORD 5

primeter DWORD ?

.stack 4096

ExitProcess proto,dwExitCode:dword

.code

main proc

mov eax,lenth

mul eax

mov  edx ,offset v

call writestring

call writeint

mov eax,0

mov eax,lenth

mov ebx,4

mul ebx

mov  edx ,offset v1

call crlf

call writestring

call writeint

  invoke ExitProcess,0

  main endp

  end main

No comments:

Post a Comment