home *** CD-ROM | disk | FTP | other *** search
- ;
- ;--------------------------------------------------------------------------
- ; W.ASM by Claude Ostyn May 2, 1983
- ; rev 5/23/83
- ; This program sets the Osborne 1 screen width to 52, 80 or 104 columns and
- ; switches the auto scrolling feature on or off.
- ; This program will work only if the Screen-Pac modification is installed.
- ;--------------------------------------------------------------------------
- ; EQUATES
- clear equ 26 ;clear screen
- cr equ 0dh ;carriage return
- lf equ 0ah ;line feed
- esc equ 1bh ;escape
- phalf equ ')' ;begin dim display
- pfull equ '(' ;end dim display
- pcall equ 9 ;BDOS print call
- concall equ 0bh ;BDOS check console status call
- kcall equ 01h ;BDOS read character call
- bdos equ 5 ;BDOS call address
- widthflag equ 0e1a5h ;screen width flag byte
- adjust equ 0e4e5h ;BIOS routine to set width
- scrollctl equ 0e168h ;scroll control byte
- widfiftytwo equ 0
- wideighty equ 3
- widoneohfour equ 1
- doscroll equ 0ffh
- noscroll equ 00h
- ;
- ; START
- org 0100h
- beginhere: lxi d,promptwidth ;print prompt for new width
- call print
- call whatsnew ;go check keyboard
- whatwasit:
- mvi c,kcall ;now, what was that character?
- call bdos
- mov b,a ;copy the character into register B
- cpi 'A'
- jz fiftytwo ;and do the appropriate thing
- mov a,b
- cpi 'a'
- jz fiftytwo ;etc.
- mov a,b
- cpi '5' ;accept digits from distracted
- jz fiftytwo ; or tired users...
- mov a,b
- cpi 'B'
- jz eighty
- mov a,b
- cpi 'b'
- jz eighty
- mov a,b
- cpi '8'
- jz eighty
- mov a,b
- è cpi 'C'
- jz oneohfour
- mov a,b
- cpi 'c'
- jz oneohfour
- mov a,b
- cpi '1'
- jz oneohfour
- jmp beginhere ;character not acceptable...
- ;so try again
- ;
- fiftytwo:
- lxi h,widthflag ;point to the flagbyte
- mvi m,widfiftytwo ;set the flagbyte
- call adjust ;and adjust the width
- call backspace ;erase answer
- lxi d,selected ;and show selected
- call print
- lxi d,showfiftytwo ;width
- call print
- lxi d,screenhome ;(reset screen home,
- call print ; just in case)
- call makitscroll ;enable autoscrolling
- jmp autoscrollset
- eighty:
- lxi h,widthflag
- mvi m,wideighty
- call adjust
- call backspace
- lxi d,selected
- call print
- lxi d,showeighty
- call print
- call nomorescroll ;disable auto scrolling
- jmp autoscrollset
- oneohfour:
- lxi h,widthflag
- mvi m,widoneohfour
- call adjust
- call backspace ;erase answer
- lxi d,selected ;show selected width
- call print
- lxi d,showoneohfour
- call print
- call nomorescroll ;disable auto scrolling
- ;
- autoscrollset:
- lxi d,promptscroll
- call print
- call whatsnew
- whatwasitagain:
- mvi c,kcall ;now, what was this character?
- call bdos
- mov b,a ;copy the character into register B
- cpi 'Y'
- è jz scrollyes ;and do the appropriate thing
- mov a,b
- cpi 'y'
- jz scrollyes
- mov a,b
- cpi 'N'
- jz scrollnoway
- mov a,b
- cpi 'n'
- jz scrollnoway
- mov a,b
- cpi cr ;if <CR> then leave it as it is
- jz scrollstatus
- call backspace
- jmp whatwasitagain
- db 'Copyright 1983 Claude Ostyn'
- scrollyes:
- call makitscroll ;enable auto scrolling
- call backspace
- jmp scrollstatus
- scrollnoway:
- call nomorescroll ;disable auto scrolling
- call backspace
- scrollstatus:
- lxi d,selected ;print "selected"
- call print
- lxi h,scrollctl ; point to scroll control byte
- mov a,m ; read it
- cpi doscroll ; on or off?
- jz yes ; if on, go print "ON"
- lxi d,shownoscroll ; else print "OFF"
- call print
- jmp fini
- yes: lxi d,showscroll
- call print
- jmp fini ;go to exit point
- ;
- ; SUBROUTINES
- ;
- whatsnew:
- mvi c,concall ;go check for console status
- call bdos ;
- cpi 00h ;if no character ready,
- jz whatsnew ; keep going back
- ret ;if ready, go on with the program
- print:
- mvi c,pcall ;get call into C
- jmp bdos ;and get BDOS to do it
- backspace:
- mvi e,08h ;backspace character
- mvi c,02 ;is being output to console
- call bdos ;to erase wrong entry
- ret
- makitscroll:
- lxi h,scrollctl ;point to scroll control byte
- mvi m,doscroll ;set it to FFh
- è ret
- nomorescroll:
- lxi h,scrollctl ;point to scroll control byte
- mvi m,noscroll ;set it to 00
- ret
- ;
- ; STORAGE AREA
- ;
- screenhome: db esc,'S',20h,20h,'$'
- promptwidth: db clear,lf
- db 'New screen width:',cr,lf,lf
- db 9,'A. 52 columns',cr,lf
- db 9,'B. 80 columns',cr,lf
- db 9,'C. 104 columns',cr,lf
- db 9,9,9,9,'$'
- promptscroll: db esc,'=',28h,20h
- db 'Automatic scrolling?',cr,lf,esc,phalf
- db '(Note: Normally ON for 52 column display,',cr,lf
- db ' except with Supercalc, and normally OFF',cr,lf
- db ' with 80 or 104 column display.)',esc,pfull,cr,lf,lf
- db 'Enter <Y> for autoscroll ON, <N> for OFF: ',cr,lf,lf
- db '$'
- selected: db 'Selected: $'
- showfiftytwo: db '52$'
- showeighty: db '80$'
- showoneohfour: db '104$'
- showscroll: db 'Autoscroll ON',cr,lf,lf,lf,'$'
- shownoscroll: db 'Autoscroll OFF',cr,lf,lf,lf,'$'
- ;
- fini:
- ret
- end