Wednesday, June 23, 2010

Smallest

Buzz It
#make_COM#
; COM file is loaded at CS:0100h
ORG 100h
mov si,3000h
mov cx,05h
mov al,[3000h]
xx:cmp al,[si]
jle go
mov al,[si]
go:inc si
loop xx
mov [3009h],al
hlt

Input
[3000H]=01
[3002H]=02
[3003H]=03
[3004H]=04
[3005H]=05

Output
[3009H]=01

0 comments:

Post a Comment