VolksForth/8086/msdos/bios.vid
2021-04-11 13:43:39 +02:00

1 line
9.0 KiB
Plaintext

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