mirror of
https://github.com/forth-ev/VolksForth.git
synced 2024-09-07 04:54:30 +00:00
154 lines
9.8 KiB
Plaintext
154 lines
9.8 KiB
Plaintext
Screen 0 not modified
|
|
0
|
|
1 This video display interface utilizes the ROM BIOS call $10.
|
|
2 The display is fairly fast and should work on most IBM
|
|
3 compatible computers
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
Screen 1 not modified
|
|
0 \ BIOS display interface ks 1 sep 86
|
|
1 Onlyforth \needs Assembler 2 loadfrom asm.scr
|
|
2 Variable dpage dpage off
|
|
3 Variable top top off
|
|
4
|
|
5 Code (at ( lin col -- ) A pop R push U push
|
|
6 dpage #) R+ mov A- D+ mov 2 # A+ mov $10 int
|
|
7 U pop R pop D pop Next end-code
|
|
8
|
|
9 Code (at? ( -- lin col ) D push R push U push
|
|
10 dpage #) R+ mov 3 # A+ mov $10 int U pop R pop
|
|
11 D+ A- mov 0 # A+ mov A+ D+ mov A push Next
|
|
12 end-code
|
|
13
|
|
14 1 6 +thru .( BIOS display interface active) cr
|
|
15
|
|
Screen 2 not modified
|
|
0 \ BIOS normal invers blankline ks 1 sep 86
|
|
1 : full top off ;
|
|
2
|
|
3 Variable attribut 7 attribut !
|
|
4
|
|
5 : normal 7 attribut ! ; : invers $70 attribut ! ;
|
|
6 : underline 1 attribut ! ; : bright $F attribut ! ;
|
|
7
|
|
8 Code blankline D push R push U push
|
|
9 dpage #) R+ mov attribut #) R- mov
|
|
10 3 # A+ mov $10 int ' c/row >body #) C mov
|
|
11 D- C- sub bl # A- mov 9 # A+ mov $10 int
|
|
12 U pop R pop D pop Next end-code
|
|
13
|
|
14 | : lineerase 0 (at blankline ;
|
|
15
|
|
Screen 3 not modified
|
|
0 \ curshape setpage curat? ks 8 mar 88
|
|
1
|
|
2 Code curshape ( top bot -- ) D C mov D pop
|
|
3 D- C+ mov 1 # A+ mov $10 int D pop Next
|
|
4 end-code
|
|
5
|
|
6 Code setpage ( n -- )
|
|
7 $503 # A mov D- A- and $10 int D pop Next
|
|
8 end-code
|
|
9
|
|
10 ' (at? Alias curat?
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
Screen 4 not modified
|
|
0 \ BIOS (type (emit ks 1 sep 86
|
|
1
|
|
2 Code (type ( addr len -- ) W pop R push U push
|
|
3 D U mov dpage #) R+ mov attribut #) R- mov
|
|
4 3 # A+ mov $10 int U inc C push $E0E # C mov
|
|
5 1 # A+ mov $10 int 1 # C mov [[ U dec 0= not
|
|
6 ?[[ D- inc ' c/row >body #) D- cmp 0= not
|
|
7 ?[[ W ) A- mov W inc 9 # A+ mov
|
|
8 $10 int 2 # A+ mov $10 int ]]?
|
|
9 ]? C pop 1 # A+ mov $10 int
|
|
10 U pop R pop D pop ' pause #) jmp
|
|
11 end-code
|
|
12
|
|
13 : (emit ( char -- ) sp@ 1 (type drop ;
|
|
14
|
|
15
|
|
Screen 5 not modified
|
|
0 \ BIOS (del scroll (cr (page ks 2 sep 86
|
|
1
|
|
2 : (del (at? ?dup
|
|
3 IF 1- 2dup (at bl (emit (at exit THEN drop ;
|
|
4
|
|
5 Code scroll D push R push U push attribut #) R+ mov
|
|
6 top #) C+ mov 0 # C- mov ' c/row >body #) D- mov
|
|
7 D- dec ' c/col >body #) D+ mov D+ dec D+ dec
|
|
8 $601 # A mov $10 int U pop R pop D pop Next
|
|
9 end-code
|
|
10
|
|
11 : (cr (at? drop 1+ dup 2+ c/col u>
|
|
12 IF scroll 1- THEN lineerase ;
|
|
13
|
|
14 : (page top @ c/col 2- DO I lineerase -1 +LOOP ;
|
|
15
|
|
Screen 6 not modified
|
|
0 \ BIOS status display ks 2 sep 86
|
|
1
|
|
2 ' (emit ' display 2 + ! ' (cr ' display 4 + !
|
|
3 ' (type ' display 6 + ! ' (del ' display 8 + !
|
|
4 ' (page ' display &10 + !
|
|
5 ' (at ' display &12 + ! ' (at? ' display &14 + !
|
|
6
|
|
7 : .sp ( n -- ) ." s" depth swap 1+ - 2 .r ;
|
|
8 : .base base @ decimal dup 2 .r base ! ;
|
|
9 : (.drv ( n -- ) Ascii A + emit ." : " ;
|
|
10 : .dr ." " drv (.drv ;
|
|
11 : .scr blk @ IF ." Blk" blk ELSE ." Scr" scr THEN
|
|
12 @ 5 .r ;
|
|
13 : .space ." Dic" s0 @ here $100 + - 6 u.r ;
|
|
14
|
|
15
|
|
Screen 7 not modified
|
|
0 \ statuszeile ks 1 sep 86
|
|
1
|
|
2 | : fstat ( n -- ) .base .sp
|
|
3 .space .scr .dr file? 2 spaces order ;
|
|
4
|
|
5 : .stat attribut @ output @ (at?
|
|
6 display invers c/col 1- 0 (at 4 fstat
|
|
7 blankline (at output ! attribut ! ;
|
|
8
|
|
9 : +stat ['] .stat Is .status .status ;
|
|
10
|
|
11 : -stat ['] noop Is .status ;
|
|
12
|
|
13
|
|
14
|
|
15
|
|
Screen 8 not modified
|
|
0
|
|
1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|