;*********** WINDLX Ex.1: Greatest common measure ************* ;*********** (c) 1991 Günther Raidl ************* ;*********** Modified 1992 Maziar Khosravipour ************* ;------------------------------------------------------------------------ ; Program begins at symbol main ; requires module INPUT ; Read two positive integer numbers from stdin, calculate the gcm ; and write the result to stdout ;------------------------------------------------------------------------ .data ;*** Prompts for input Prompt1: .asciiz "First Number:" Prompt2: .asciiz "Second Number: " ;*** Data for printf-Trap PrintfFormat: .asciiz "gcM=%d\n\n" .align 2 PrintfPar: .word PrintfFormat PrintfValue: .space 4 SaveR3: .space 4 .text .global main main: addi r3, r0, 2 sw SaveR3, r3 lw r2, SaveR3 add r4, r2, r0 ;*** end trap 0