jericotolentino,
Here's a good source of help:
http://heim.ifi.uio.no/~st
; Select 'normal' data/code architecture, i.e. max 64k of code + 64k of data.
.model small
.stack
.data
; Define names for some common values.
; lf = Line Feed code.
lf equ 0ah
; cr = Carriage Return code.
cr equ 0dh
; A couple of strings used in the code. '$' is used for string termination for many of the older DOS functions.
prompt db cr,lf,"Enter a number: ","$"
product db cr,lf,"The product is: ","$"
.code
main proc near
; Set up the DS register to point to our data segment.
; Note that you cannot directly load a segment register from memory.
mov ax,@data
mov ds,ax
; Get the address of the prompt string.
mov dx,offset prompt
; Select function 9. Print string to stdout. (See my 'helppc' link above).
mov ah,09h
; Perform the function.
int 21h
; Select function 1. Read one character from keyboard.
mov ah,01h
int 21h
; Set register BX to 10 decimal.
mov bx,10d
; Multiply AX by BX (10).
mul bx
; Display the prompt again.
mov dx,offset prompt
mov ah,09h
int 21h
; Pull the result of the multiply into lower half of BX register.
: NOTE: This may be a fault because int 21h often trashes some registers.
mov bl,al
; Select function 2 (Print one character)
mov ah,02h
int 21h
; Exit the program.
mov ax,4ch
int 21h
main endp
end main
Paul
Main Topics
Browse All Topics





by: PaulCaswellPosted on 2006-01-28 at 04:26:33ID: 15811880
jericotolentino,
Is it the multiplication itself you are having difficulty with or understanding the code you posted?
Paul