home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
-
- TITLE page.com version 1.00 1989-04-08
-
- ;
- ; AnDan Software Page Version 1.00
- ; Copyright (c) AnDan Software 1988
- ;
- ;
- ; Shareware:
- ;
- ; This source code may be copied if no fee is charged and
- ; if no changes are done.
- ;
- ; AnDan Software
- ;
-
-
- com SEGMENT para
-
- ASSUME cs:com,ds:com,ss:com,es:com
-
- ORG 100H
-
- start_main: jmp main
-
- txt_err DB 13,10,'Illegal argument',13,10
- len_err EQU $-txt_err
-
- print: mov ah,40H
- mov bx,1
- int 21H
- ret
-
- jmp_white: lodsb
- cmp al,13
- jz jmp_white1
- cmp al,32
- jbe jmp_white
- dec si
- clc
- ret
- jmp_white1: stc
- ret
-
- atoi: xor ax,ax
- mov cl,10
- xor bh,bh
- atoi1: mov bl,[si]
- cmp bl,32
- jbe atoi2
- sub bl,'0'
- jb atoi3
- cmp bl,9
- ja atoi3
- mul cl
- add ax,bx
- inc si
- jmp atoi1
- atoi2: cmp ax,1023
- ja atoi3
- clc
- ret
- atoi3: stc
- ret
-
-
- main: mov bx,OFFSET stack
- mov cl,4
- shr bx,cl
- mov ah,4AH
- int 21H
- shl bx,cl
- mov sp,bx
-
- mov si,81H
- cld
- call jmp_white
- jc initvideo
- call atoi
- jc param_err
- push ax
- call jmp_white
- pop ax
- jc set_page
-
- param_err: mov dx,OFFSET txt_err
- mov cx,len_err
- call print
- jmp SHORT quit
-
- initvideo: mov ax,3
- int 10H
- jmp SHORT quit
-
- set_page: mov ah,5
- int 10H
-
- quit: mov ax,4C00H
- int 21H
- fail: jmp fail
-
- stack EQU $+1024
-
- com ENDS
-
- END start_main
-