wa4.elucid - ; div cx ;ax/cx in this case input1/input2 ;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
TITLE Euclidean algorithm (main.asm) ( ; Description: ; INCLUDE Irvine32.inc I .data input1 WORD 15d input2 WORD 5d answ WORD ? .code main PROC m mov dx, 0 mov eax, 0 mov ax, input1 mov dx, input2 mov cx, input2 m euclid: cmp dx, 0 ; if dx/remainder = 0 jump to finish jz finish ; else continue working ; mov answ, ax ; Store potential answere. ; mov dx, 0 ; Clear it, we need it for the remainder.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; div cx ;ax/cx in this case input1/input2 ; mov ax, cx ; move old B value to A value. mov cx, dx ; Move to B value remainder. ; mov ax, dx m ;call WriteHex ;call Crlf mov ax, answ m loop euclid e finish: mov ax, answ m call WriteHex call Crlf c exit main ENDP m END main...
View Full Document

This note was uploaded on 12/30/2009 for the course COS 231 taught by Professor Jasonlitz during the Summer '09 term at Thomas Edison State.

Ask a homework question - tutors are online