;Finds the maximum unsigned byte in the memory range 500h-5ffh
;  also records the position the first occurance of that max
       mov      di,     0    ;point to first positioin
       mov      al,     0       ;minimum value
       mov      cx,     0h    ;position of that max value
       cmp      al,     byte ptr 500h [di]      ;new max??
       jae      nextbyte
       mov      al,     byte ptr 500h [di]      ;record new max
       mov      cx,     di                      ;record position of new max
;                                               (num bytes past 500h)
       inc      di
       cmp      di, 0ffh                ;is that byte above 05ffh??
       jbe      around
       add      cx, 500h
       int      20h