plese can you help me in this question
Given an array of two digits numbers with each digit is stored as a character, do the following:
a. Write a function FINDMIN that will find the smallest number among a set of numbers.
b. Write a function FINDMAX that will find the largest number among a set of numbers.
c. Given the following array X=12,23,14,16, write a program that will use findmax and findmin functions. Remember X is an array of two digits numbers which are stored as characters and not numbers. That is, 12 is stored in two bytes as:32H in the most byte and 31H in the most byte
i've written the code but my numbers are stored as a byte hex numbers how can it be stored as two bytes?
this was the code i wrote:
Code:DATA SEGMENT X db 12,23,14,16 siz db 4 min db ? max db ? DATA ENDS CODE SEGMENT ASSUME CS:CODE, DS: DATA START: MOV AX,DATA ;data seg. initialization MOV DS,AX MOV ES,AX ;---- Functions Calling ---- call FINDMIN call FINDMAX INT 3 ;----- FINDMAX function -------- FINDMax proc near lea SI,X mov cl,siz add cl,1 GR: mov al,[SI] dec cl cmp cl,0 jz HI NEXT:inc SI cmp [SI],al jg GR loop NEXT HI: mov max,al ret FINDMAX endp ;----- FINDMIN function -------- FINDMIN proc near lea SI,X mov cl,siz LEE: mov al,[SI] dec cl cmp cl,0 jz LO NEE: inc SI cmp [SI],al jl LEE loop NEE LO: mov min,al ret FINDMIN endp CODE ENDS END START



LinkBack URL
About LinkBacks


