;This program converts three ASCII decimal digits into a single
; byte 0-255.  That is, '0' '0' '0' thru '2' '5' '5'
;input is in  locations 400-401-402h, output is in  403h
        mov     al, byte ptr 400h       ;grab first (100s) digit
        sub     al, '0'                 ;strip it of its ascii-ness
        add     al, al                  ;al *2
        mov     bl, al                  ;set aside copy digit *2
        add     bl, bl                  ;create digit * 8
        add     bl, bl
        add     bl, al                  ;digit * 8 + digit * 2

        mov     al, byte ptr 401h       ;grab second (10s) digit
        sub     al, '0'                 ;off with the ascii
        add      al, bl                  ;10 * d1 + d2
        add     al, al                  ; * 2
        mov     bl, al
        add     bl, bl
        add     bl, bl                  
        add     bl, al                  ;100 * d1 + 10 * d2

        mov     al, byte ptr 402h       ;grab third (1s) digit
        sub     al, '0'                 ;ascii awaaaay!
        add     al, bl                  ; 100 * d1 + 10 * d2 + d3
        mov     byte ptr 403h, al       ;move out answer
        int     20h
        end