; demo1.asm
.286
.model small
.stack
.data
demo db 'DEMO1 program Version 1.0 $'
copy db 'Copyright(c) 1994 by Brent Su.$'
ver db 'MASM Version 5.1$'
; Assembly Function
.code
clrscr proc
mov al,0
mov bh,07H
mov cx,0
mov dh,24
mov dl,79
mov ah,06H
int 10H
mov dx,0
mov bh,0
mov ah,02H
int 10H
ret
clrscr endp
printstr proc
mov ah,09H
int 21H
ret
printstr endp
printchar proc
mov ah,02H
int 21H
ret
printchar endp
printline proc
mov ah,09H
int 21H
mov dl,10
call printchar
mov dl,13
call printchar
ret
printline endp
; main program
.code
start:
mov ax,@data
mov ds,ax
call clrscr
lea dx,demo
call printstr
lea dx,copy
call printline
lea dx,ver
call printline
mov ax,4c00H
int 21H
end start
; demo2.asm
.286
.model small
.stack
.data
ibmpc dw 486
numstr db 80 dup(0)
; Assembly Function
.code
clrscr proc
mov al,0
mov bh,07H
mov cx,0
mov dh,24
mov dl,79
mov ah,06H
int 10H
mov dx,0
mov bh,0
mov ah,02H
int 10H
ret
clrscr endp
printstr proc
mov ah,09H
int 21H
ret
printstr endp
itoa proc
pusha
mov cx,0
mov bx,10
@@divide:
mov dx,0
div bx
push dx
inc cx
cmp ax,0
jnz @@divide
lea bx,numstr
@@output:
pop ax
add ax,48
mov [bx],al
inc bx
loop @@output
mov byte ptr [bx],'$'
popa
ret
itoa endp
printint proc
call itoa
lea dx,numstr
call printstr
ret
printint endp
; main program
.code
start:
mov ax,@data
mov ds,ax
call clrscr
mov ax,ibmpc
call printint
mov ax,4c00H
int 21H
end start
; demo3.asm
.286
.model small
.stack
.data
demo db 'DEMO3 program Version 1.0 Copyright(c) 1994 by Brent Su.$'
ver db 'MASM Version 5.1$'
ibmcpu dw 80
ibmpc dw 486
ibm db '-50 speed 167Mhz$'
numstr db 80 dup(0)
; Assembly Function
.code
clrscr proc
mov al,0
mov bh,07H
mov cx,0
mov dh,24
mov dl,79
mov ah,06H
int 10H
mov dx,0
mov bh,0
mov ah,02H
int 10H
ret
clrscr endp
printstr proc
mov ah,09H
int 21H
ret
printstr endp
printchar proc
mov ah,02H
int 21H
ret
printchar endp
printline proc
mov ah,09H
int 21H
mov dl,10
call printchar
mov dl,13
call printchar
ret
printline endp
itoa proc
pusha
mov cx,0
mov bx,10
@@divide:
mov dx,0
div bx
push dx
inc cx
cmp ax,0
jnz @@divide
lea bx,numstr
@@output:
pop ax
add al,48
mov [bx],al
inc bx
loop @@output
mov byte ptr [bx],'$'
popa
ret
itoa endp
printint proc
call itoa
lea dx,numstr
call printstr
ret
printint endp
; main program
.code
start:
mov ax,@data
mov ds,ax
call clrscr
lea dx,demo
call printline
mov ax,ibmcpu
call printint
mov ax,ibmpc
call printint
lea dx,ibm
call printline
mov ax,4c00H
int 21H
end start