
February 13th, 2004, 06:56 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Posts: 67
Time spent in forums: 6 h 33 m 52 sec
Reputation Power: 5
|
|
|
Help with processor coding
OK, I am taking a class about Intel Microprocessors. The teacher has a strong accent, so it is very hard to understand him. Right now I am trying to finish a program that will allow for the input of two single-digit numbers, followed by their summatiom displayed on a new line. I'm not even sure what it's called, I believe it's ASCII. Anyway, this is what I have so far:
PHP Code:
.model small
.code
MOV AH, 01h ; specify which DOS routine to call: display for the ASCII code
INT 21h ; call DOS routine
MOV AH, 01h ; specify which DOS routine to call: display for the ASCII code
INT 21h ; call DOS routine
MOV AH, 00h ;
AAA ; convert hex to ASCII code
ADD AX,3030h; answer to ASCII
MOV BL, CL ;
MOV BL, AL ; puts register AL into register BL
MOV DL, 0Ah ; put register AH into register DL
MOV AH, 02h ; specify which DOS routine to call: display the for the ASCII code in register DL
INT 21h ; call DOS routine
MOV DL, 0Dh ; put register BL into regsiter DL
MOV AH, 02h ; specify which DOS routine to call: display the for the ASCII code in register DL
INT 21h ; call DOS routine
MOV AH,4ch ; specify which DOC routine to call: display a carriage return
INT 21h ; call DOS routine
.stack 256
end
When I enter two digits, it's supposed to print out the sum on a new line. Something is wrong, and I can't seem to pinpoint what it is.
|