(1) INT 10H Function 00H: Function 01H: Function 02H: Function 03H: Function 05H: Function 06H: Function 07H: Function 08H: Function 09H: Function 0AH:
(2) Function 0BH: Function 0CH: (pixel, picture element) Function 0DH: Function 0FH: Function 13H:
* 00 25*40 B800 0-7 360*400 16 01 25*40 B800 0-7 360*400 16 02 25*80 B800 0-3 720*400 16 03 25*80 B800 0-3 720*400 16 07 25*80 B000 0 720*400 INT 10H Function 00H: INT AH,0 AL,mode 10H,, mode 7 1
INT 10H Function 01H: CH ( 5-0) CL INT AH,1 CH,5 CL,6 10H 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 INT INT 10H Function 03H: AH,3 BH,page# 10H CH:, CL: DH:,, DL:,
INT 10H Function 05H: INT AH,5 AL,page# 10H INT 10H Function 08H: INT AH,8 BH,page# 10H AH:, AL: ASCII
INT 10H Function 09H: INT AH,9 AL,character_code BH,page# BL,attribute CX,repeat_count 10H INT 10H Function 0AH: INT AH,0AH AL,character_code BH,page# CX,repeat_count 10H
INT 10H Function 0FH: INT AH,0FH 10H AL:, AH:, BH: INT 10H Function 13H AH,13H AL,subfunction BH,page# BL,attribute LEA BP,address CX,length DH,row DL,column INT 10H
INT 10H Function 13H Subfunctions 00: 01: 02: 03: 1: ASCII, 3, 16*16 256 ASCII
(1).model small.stack 64.data ctr db 0 ;counter for ascii characters col db 24 ;column of screen row db 4 ;row of screen mode db? ;video mode.286 ;-----------------------------------------------.code a10main proc near mov ax,@data ;initialize segment registers mov ds,ax mov es,ax call b10mode ;get/set video mode call c10clr ;clear screen
a20: (2) call d10set ;set cursor call e10disp ;display characters cmp ctr,0ffh ;last character displayed? je a30 ;yes, exit inc ctr ;increment char. counter add col,2 ;increment column cmp col,56 ;at end of column? jne a20 ; no, bypass inc row ; yes, increment row mov col,24 ; and reset column jmp a20 (3) a30: mov ah,10h ;request get character int 16h mov ah,0 ;request set mode mov al,mode mov ax,4c00h ;end int 21h ; processing a10main endp
, ; get and set video mode: ; ----------------------- b10mode proc near mov ah,0fh ;request get mode mov mode,al ;save mode mov ah,0 ;request set new mode mov al,3 ;standard color b10mode endp ; clear screen and create window: ; -------------------------------- c10clr proc near pusha ;preserve general registers mov ah,8 ;request get current ; attribute in ah mov bh,ah ;move it to bh mov ax,0600h ;scroll full screen mov cx,0 ;upper left location mov dx,184fh ;lower right location ;call bios mov ax,0610h ;create 16-line window mov bh,16h ;blue back, brown forgroubd mov cx,0418h ;upper left corner 04:24 mov dx,1336h ;lower right corner 19:54 popa ;restore general registers ;urn to caller c10clr endp
; set cursor to row and column: ; ----------------------------- d10set proc near pusha ;preserve general registers mov ah,2 ;request set cursor mov bh,0 ;page number 0 mov dh,row ;new row mov dl,col ;new column ;call bios popa ;restore general registers d10set endp ; display ASCII characters: ; ------------------------- e10disp proc near pusha ;preserve general registers mov ah,0ah ;request display mov al,ctr ;ascii character mov bh,0 ;page 0 mov cx,1 ;one character popa ;restore general registers ;urn to caller e10disp endp end a10main
2 ( ) Name? ( ) 70.model small.stack 1024 ;---------------------------------------.data parlist label byte ;name parameter list maxlen db 20 ; maximum length of name actlen db? ; no. of chars entered kbname db 20 dup(' ') ; name ; left_col equ 51 ;left column for display bott_scrn equ 23 ;bottom row for display attrib db 0 ;screen attribute col db 5 ;screen column row db 0 ; and row prompt db 'Name? ' ;prompt for input
(1).code ; main procedure: ; --------------- a10main proc far mov ax,@data ;initialize segment mov ds,ax ; registers mov es,ax mov ax,1003h ;disable blink mov bl,0 ; attribute mov al,00h ;clear screen call q10scrl (2) a20: mov col,05 ;set column to 05 call b10prom ;display prompt call c10inpt ;provide for input of name cmp actlen,0 ;no name? je a30 ; yes, exit call d10name ;display name jmp a20 a30: mov al,00h ;exit, call q10scrl ;clear screen mov ax,4c00h ;end of processing int 21h a10main endp
; display prompt: ; ---------------- b10prom proc near mov attrib,71h;set attribute lea bp,prompt ;set address of prompt mov cx,6 ; and length call e10disp ;display routine b10prom endp ; accept input of name from keyboard: ; ----------------------------------- c10inpt proc near mov ah,0ah ;request keyboard lea dx,parlist int 21h c10inpt endp
; set up for displaying name, scroll if ; near bottom of the screen: ; ------------------------------------- d10name proc near pusha ;preserve general registers mov al,maxlen ;calculate screen indent, sub al,actlen add al,left_col ; add to left column, mov col,al ; and store mov attrib,17h ;reverse video lea bp,kbname ;initialize name mov cx,actlen ; and length call e10disp ;display name cmp row,bott_scrn ;near bottom of screen? jae d30 inc row ; no, increment row jmp d90 ; and exit d30: mov al,1 ; call q10scrl ; scroll screen d90: popa ;restore general registers d10name endp ; display character and set attribute: ; ------------------------------------ e10disp proc near ;BP, CX set on entry pusha ;preserve general registers mov ah,13h ;request display mov al,1 ; characters mov bh,0 ;page number mov bl,attrib ;attribute mov dh,row ;screen row mov dl,col ; and column popa ;restore general registers ;urn to caller e10disp endp
; scroll screen and set attribute: ; -------------------------------- q10scrl proc near pusha ;preserev general registers mov ah,6 ;request scroll screen mov bh,86h ;grey, brown mov cx,0 ;full screen mov dx,184fh ;call bios popa ;restore general registers q10scrl endp end a10main 04H B800 8 320*200 4 05H B800 8 320*200 4 06H B800 8 640*200 2 0DH B800 8 320*200 16 0EH A000 4 640*200 16 0FH A000 2 640*350 1 10H A000 2 640*350 16 11H A000 1 640*480 2 12H A000 1 640*480 16 13H A000 1 320*200 256
INT 10H Function 0BH BH=0, ( BL) INT AH,0BH BH,0 BL,4 10H BH=1, (BL=0,1) INT AH,0BH BH,1 BL,0 10H INT 10H Function 0CH AL:, CX:Column, BH:, DX: Row INT AH,0CH AL,3 BH,0 CX,200 DX,50 10H
INT 10H, Function 10H, Subfn 0 AH,10H BH,02 ; BL,01 ; INT 10H : INT 10H function 13H function 0AH 10
.model small.stack 64.data string db '1234567890'.286 ;---------------------------------------------------------.code a10main proc far mov ax,@data ;establish mov ds,ax ;addressability mov es,ax mov ah,0fh ;get ; original push ax ; video mode and save call b10mode ;set video mode call c10scrl ;scroll screen call d10strg ;function 13h to display call e10disp ;function 0ah to display mov ah,10h ;request keyboard int 16h ; input pop ax mov ah,0 ;restore ; original mode (in AL) mov ax,4c00h ;end int 21h ; processing a10main endp ; set graphics mode and request palette: ; ----------------------- b10mode proc near ;uses AV and BX mov ah,0 ;set EGA/VGA graphics mode mov al,12h ;640 cols x 480 rows mov ah,0bh ;set background palette mov bh,0 ;background mov bl,07h ;grey b10mode endp
c10scrl proc near pusha ;preserve general registers mov ax,0605h ;request scroll 5 rows mov bh,1110b ;yellow color mov cx,0 ;from row:column mov dx,044fh ;to row:column popa ;restore registers ; yes, terminate c10scrl endp ; displaying string, set attribute and cursor: d10strg proc near pusha ;preserve general registers mov ax,1301h ;request display mov bx,21h ;page:attribute lea bp,string ;character string mov cx,10 ;length mov dx,0815h ;row:column popa ;restore registers d10strg endp
; display character repeatedly e10disp proc near pusha ;preserve general registers mov ax,0a01h ;request display mov bh,0 ;happy face mov bl,0100b ;red color mov cx,10 ;10 times popa ;restore registers e10disp endp end a10main 1
.model small.stack 64.286 ;---------------------------------------------------.code a10main proc near mov ax,@data ;establish mov ds,ax ; addressability mov es,ax mov ah,0fh ;get ; original push ax ; video mode and save call b10mode ;set video mode call c10disp ;display color graphics mov ah,10h ;request keyboard int 16h ;response pop ax mov ah,0 ;restore ; original mode (in AL) mov ax,4c00h ;end int 21h ; processing a10main endp ; set graphics mode and palette: ; ------------------------------ b10mode proc near mov ax,012h ;request graphics mode ;640 cols x 480 rows mov ah,0bh ;set background palette mov bx,07h ;background grey b10mode endp
; display 210 rows of graphics dots, 512 ; columns, change color for each row: ; -------------------------------------- c10disp proc near pusha ;preserve general registers mov bx,0 ;set initial page, mov cx,64 ; color, column, mov dx,70 ; and row c20: mov ah,0ch ;write pixel dot mov al,bl ;set color ;bx, cx, and dx are preserved inc cx ;increment column cmp cx,576 ;column at 576? jne c20 ; no, loop mov cx,64 ; yes, reset column inc bl ;change color inc dx ;increment row cmp dx,280 ;row at 280? jne c20 ; no, loop popa ;restore registers ; yes, terminate c10disp endp end a10main Mode 3 page 1 B900[0] 2 : ASCII 5 10, 60 A, P
.model small.stack 64 video_seg segment at 0b900h ;page 1 of video area vid_area db 1000h dup (?) video_seg ends.286 ;--------------------------------------------------.code a10main proc far mov ax,video_seg ;addressibility for mov es,ax ; video area assume es:video_seg mov ah,0fh ;request get ; and save push ax ; current mode push bx ; and page mov ax,3 ;set mode 3, ; clear screen mov ax,0501h ;set page #01 call b10disp ;process display area mov ah,10h ;wait for keyboard int 16h ; response mov ah,5 ;restore original pop bx ;page number mov al,bh pop ax ;restore video mode mov ah,0 ; mov ax,4c00h ;end of processing int 21h a10main endp
b10disp proc near pusha ;preserve general registers mov al,41h ;character to display mov ah,1 ;attribute mov di,820 ;start of display area b20: mov cx,60 ;characters per row b30: mov es:word ptr[di],ax ;character to display add di,2 ;next attribute + character loop b30 ;repeat 60 times inc ah ;next attribute inc al ; and character add di,40 ;indent for next row cmp al,51h ;last character to display? jne b20 ; no, repeat popa ;restore registers b10disp endp end a10main C4H CDH B3H BAH DAH C9H C0H C8H BFH BBH D9H BCH C3H CCH B4H B9H C2H CBH C1H CAH C5H CEH
Menu MENU DB 0DAH, 17 DUP (0C4H), 0BFH DB 0B3H, Add records, 0B3H DB 0B3H, Delete records, 0B3H DB 0B3H, Enter orders, 0B3H DB 0B3H, Print report, 0B3H DB 0B3H, Update accounts, 0B3H DB 0B3H, View records, 0B3H DB 0C0H, 17 DUP (0C4H), 0D9H