assemble.jrt for creating assemble.com which has asm.jrt preloaded rebuild.bat for re-bootstrapping tinyjort from scratch and verifying that minijort and assemble produce the same binary small CGA textmode vocabulary with test program
48 lines
774 B
Plaintext
Executable file
48 lines
774 B
Plaintext
Executable file
0 VAR, textpage
|
|
0x0f VAR, textpen
|
|
|
|
80 const pagew
|
|
25 const pageh
|
|
|
|
0xb800 CONST TEXTMEM
|
|
: PREP-TEXTCOPY
|
|
MOV ES t& TEXTMEM @+
|
|
MOV AH textpen @+
|
|
MOV DI textpage @+ ;
|
|
|
|
:ASM fill-page ( char -- )
|
|
POP AX
|
|
PREP-TEXTCOPY
|
|
MOV CX pagew pageh * #
|
|
REPZ STOSW
|
|
NEXT
|
|
|
|
0 VAR, textpos
|
|
: textx textpos @ pagew % ;
|
|
: texty textpos @ pagew / ;
|
|
: textx! texty pagew * + textpos ! ;
|
|
: texty! pagew * textx + textpos ! ;
|
|
: nextline texty 1+ pagew * textpos ! ;
|
|
|
|
: PREP-TEXTCOPY-XY
|
|
PREP-TEXTCOPY
|
|
ADD SI textpos @+ ;
|
|
|
|
:ASM draw-text ( s -- )
|
|
MOV BX SI
|
|
POP SI
|
|
PREP-TEXTCOPY-XY
|
|
L: draw-next-char
|
|
LODSB
|
|
OR AL AL
|
|
JZ 0 @>
|
|
STOSW
|
|
JMP draw-next-char
|
|
0 <:
|
|
SUB DI textpage @+
|
|
INC DI
|
|
MOV textpos @+ DI
|
|
MOV SI BX
|
|
NEXT
|
|
|