Hey guys, just came across this site by goggling. I'm in a grade 12 computer engineering course and i've been out of class with a stomach flu for almost 2 weeks. I've come back and I'm way behind but the marks for midterms are submitted friday. I really want to try getting the bulk of this done so it doesn't make my mark look so bad on my mid term report card. I was wondering if anyone on here could help me with it.
neway, so you have something to help with once you read this
Right now im writing a program that will take three seperate hex numbers as input and and then output the average of those numbers in hex.
So far what im going through in my head is this.
Converting ASCII to HEX
It take in my input
I subtract 30 from my input
If my input it greater then nine, then i subtract 7 more
if not then i jump to the next step
add up my values, (store them?) into cl or something
divide them by 3
convert to decimal
this is what i have so far.
mov ah, 01 ;Preparing for input
int 21
mov al, dl ;moving input
SUB dl,30 ;subtract 30 from dl
CMP al,09 ;compare al
JLE 0110 ;if it less then or equal to 9 then jump to 0110
SUB dl,07 ;subtract 7 from dl
I am subtracting the 7 because in hex it goes 1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,10,11,12 and I dont want letters included.
So far if i am correct, this will take my input and convert it into a usable hex #. Now i want to know how to store them in the same registry so i can divide by the number of inputs to find the average.