home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB140
/
grlib03a.arj
/
LTEXT.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-12-08
|
11KB
|
318 lines
PAGE ,132
;LTEXT.ASM
;UPDATE HISTORY
;==============
; 15 nov 84 Convert to CI86 V2.2
include asmc.h
SEGEND CODE
SEGDEF DATA
EXTRN l_type:BYTE, t_col:BYTE, gbmod:BYTE, t_sca:BYTE
Lflag DB 1
Lxs DW 1
Lys DW 1
Lxf DW 1
Lyf DW 1
;******************************************************************
;* *
;* stroke font character set *
;* *
;******************************************************************
;
;the following tables are vertice information for a stroked character
;set the x,y coordinate information is represented by 4 bit 2's
;complement numbers in the range of +-7 x, +-7 y. end of character
;is represented by -8 x, -8 y and dark vector is represented by -8 x,
; 0 y.
;
; bit 7 6 5 4 3 2 1 0
; | | | |
; \ ; \ ;
; x y
;
;characters are currently mapped into the positive quadrant,
;with the origin at the lower left corner of an upper case character,
;therfore, lowercase characters will descend below the line specified
;for the character.
Lf_20 DB 88H
Lf_21 DB 20H,21H,80H,23H,26H,88H
Lf_22 DB 24H,26H,80H,54H,56H,88H
Lf_23 DB 20H,26H,80H,40H,46H,80H,04H,64H,80H,02H,62H,88H
Lf_24 DB 2fH,27H,80H,01H,10H,30H,41H,42H,33H,13H,04H,05H
DB 16H,36H,45H,88H
Lf_25 DB 11H,55H,80H,14H,15H,25H,24H,14H,80H,41H,51H,52H
DB 42H,41H,88H
Lf_26 DB 50H,14H,15H,26H,36H,45H,44H,11H,10H,30H,52H,88H
Lf_27 DB 34H,36H,88H
Lf_28 DB 4eH,11H,14H,47H,88H
Lf_29 DB 0eH,31H,34H,07H,88H
Lf_2a DB 30H,36H,80H,11H,55H,80H,15H,51H,80H,03H,63H,88H
Lf_2b DB 30H,36H,80H,03H,63H,88H
Lf_2c DB 11H,20H,2fH,0dH,88H
Lf_2d DB 03H,63H,88H
Lf_2e DB 00H,01H,11H,10H,00H,88H
Lf_2f DB 00H,01H,45H,46H,88H
Lf_30 DB 01H,05H,16H,36H,45H,41H,30H,10H,01H,88H
Lf_31 DB 04H,26H,20H,80H,00H,40H,88H
Lf_32 DB 05H,16H,36H,45H,44H,00H,40H,41H,88H
Lf_33 DB 05H,16H,36H,45H,44H,33H,42H,41H,30H,10H,01H,80H
DB 13H,33H,88H
Lf_34 DB 06H,03H,43H,80H,20H,26H,88H
Lf_35 DB 01H,10H,30H,41H,42H,33H,03H,06H,46H,88H
Lf_36 DB 02H,13H,33H,42H,41H,30H,10H,01H,05H,16H
DB 36H,45H,88H
Lf_37 DB 06H,46H,44H,00H,88H
Lf_38 DB 01H,02H,13H,04H,05H,16H,36H,45H,44H,33H,42H,41H
DB 30H,10H,01H,80H,13H,23H,88H
Lf_39 DB 01H,10H,30H,41H,45H,36H,16H
DB 05H,04H,13H,33H,44H,88H
Lf_3a DB 15H,25H,24H,14H,15H,80H,12H,22H,21H,11H,12H,88H
Lf_3b DB 15H,25H,24H,14H,15H,80H
DB 21H,11H,12H,22H,20H,1fH,88H
Lf_3c DB 30H,03H,36H,88H
Lf_3d DB 02H,42H,80H,04H,44H,88H
Lf_3e DB 10H,43H,16H,88H
Lf_3f DB 06H,17H,37H,46H,45H,34H,24H,22H,80H,21H,20H,88H
Lf_40 DB 50H,10H,01H,06H,17H,57H,66H,63H,52H,32H,23H,24H
DB 35H,55H,64H,88H
Lf_41 DB 00H,04H,26H,44H,40H,80H,03H,43H,88H
Lf_42 DB 00H,06H,36H,45H,44H,33H,42H,41H,30H
DB 00H,80H,03H,33H,88H
Lf_43 DB 45H,36H,16H,05H,01H,10H,30H,41H,88H
Lf_44 DB 00H,06H,36H,45H,41H,30H,00H,88H
Lf_45 DB 40H,00H,06H,46H,80H,03H,23H,88H
Lf_46 DB 00H,06H,46H,80H,03H,23H,88H
Lf_47 DB 45H,36H,16H,05H,01H,10H,30H,41H,43H,23H,88H
Lf_48 DB 00H,06H,80H,03H,43H,80H,40H,46H,88H
Lf_49 DB 10H,30H,80H,20H,26H,80H,16H,36H,88H
Lf_4a DB 01H,10H,30H,41H,46H,88H
Lf_4b DB 00H,06H,80H,02H,46H,80H,13H,40H,88H
Lf_4c DB 40H,00H,06H,88H
Lf_4d DB 00H,06H,24H,46H,40H,88H
Lf_4e DB 00H,06H,80H,05H,41H,80H,40H,46H,88H
Lf_4f DB 01H,05H,16H,36H,45H,41H,30H,10H,01H,88H
Lf_50 DB 00H,06H,36H,45H,44H,33H,03H,88H
Lf_51 DB 12H,30H,10H,01H,05H,16H,36H,45H,41H,30H,88H
Lf_52 DB 00H,06H,36H,45H,44H,33H,03H,80H,13H,40H,88H
Lf_53 DB 01H,10H,30H,41H,42H,33H,13H,04H,05H,16H,36H
DB 45H,88H
Lf_54 DB 06H,46H,80H,20H,26H,88H
Lf_55 DB 06H,01H,10H,30H,41H,046H,88H
Lf_56 DB 06H,02H,20H,42H,46H,88H
Lf_57 DB 06H,00H,22H,40H,46H,88H
Lf_58 DB 00H,01H,45H,46H,80H,40H,41H,05H,06H,88H
Lf_59 DB 06H,24H,20H,80H,24H,46H,88H
Lf_5a DB 06H,46H,45H,01H,00H,40H,88H
Lf_5b DB 37H,17H,1fH,3fH,88H
Lf_5c DB 06H,05H,41H,40H,88H
Lf_5d DB 17H,37H,3fH,2fH,88H
Lf_5e DB 04H,26H,44H,88H
Lf_5f DB 0fH,7fH,88H
Lf_60 DB 54H,36H,88H
Lf_61 DB 40H,43H,34H,14H,03H,01H,10H,30H,41H,88H
Lf_62 DB 06H,01H,10H,30H,41H,43H,34H,14H,03H,88H
Lf_63 DB 41H,30H,10H,01H,03H,14H,34H,043H,88H
Lf_64 DB 46H,41H,30H,10H,01H,03H,14H,34H,43H,88H
Lf_65 DB 41H,30H,10H,01H,03H,14H,34H,43H,42H,02H,88H
Lf_66 DB 20H,25H,36H,46H,55H,80H,03H,43H,88H
Lf_67 DB 41H,30H,10H,01H,03H,14H,34H,43H,4fH
DB 3eH,1eH,0fH,88H
Lf_68 DB 00H,06H,80H,03H,14H,34H,43H,40H,88H
Lf_69 DB 20H,23H,80H,25H,26H,88H
Lf_6a DB 46H,45H,80H,43H,4fH,3eH,1eH,0fH,88H
Lf_6b DB 00H,06H,80H,01H,34H,80H,12H,30H,88H
Lf_6c DB 20H,26H,88H
Lf_6d DB 00H,04H,80H,03H,14H,23H,34H,43H,40H,88H
Lf_6e DB 00H,04H,80H,03H,14H,34H,43H,40H,88H
Lf_6f DB 01H,03H,14H,34H,43H,41H,30H,10H,01H,88H
Lf_70 DB 04H,0eH,80H,01H,10H,30H,41H,43H,34H,14H,03H,88H
Lf_71 DB 41H,30H,10H,01H,03H,14H,34H,43H,80H,44H,4eH,88H
Lf_72 DB 00H,04H,80H,03H,14H,34H,88H
Lf_73 DB 01H,10H,30H,41H,32H,12H,03H,14H,34H,43H,88H
Lf_74 DB 04H,44H,80H,26H,21H,30H,40H,51H,88H
Lf_75 DB 04H,01H,10H,30H,41H,80H,44H,40H,88H
Lf_76 DB 04H,02H,20H,42H,44H,88H
Lf_77 DB 04H,00H,22H,40H,44H,88H
Lf_78 DB 00H,44H,80H,04H,40H,88H
Lf_79 DB 04H,01H,10H,30H,41H,80H,44H,4fH,3eH,1eH,0fH,88H
Lf_7a DB 04H,44H,00H,40H,88H
Lf_7b DB 40H,11H,32H,03H,34H,15H,46H,88H
Lf_7c DB 20H,23H,80H,25H,27H,88H
Lf_7d DB 00H,31H,12H,43H,14H,35H,06H,88H
Lf_7e DB 06H,27H,46H,67H,88H
Lf_7f DB 07H,77H,88H
Llf_tabl equ $
DW Lf_20, Lf_21, Lf_22, Lf_23, Lf_24, Lf_25, Lf_26, Lf_27, Lf_28, Lf_29
DW Lf_2a, Lf_2b, Lf_2c, Lf_2d, Lf_2e, Lf_2f, Lf_30, Lf_31, Lf_32, Lf_33
DW Lf_34, Lf_35, Lf_36, Lf_37, Lf_38, Lf_39, Lf_3a, Lf_3b, Lf_3c, Lf_3d
DW Lf_3e, Lf_3f, Lf_40, Lf_41, Lf_42, Lf_43, Lf_44, Lf_45, Lf_46, Lf_47
DW Lf_48, Lf_49, Lf_4a, Lf_4b, Lf_4c, Lf_4d, Lf_4e, Lf_4f, Lf_50, Lf_51
DW Lf_52, Lf_53, Lf_54, Lf_55, Lf_56, Lf_57, Lf_58, Lf_59, Lf_5a, Lf_5b
DW Lf_5c, Lf_5d, Lf_5e, Lf_5f, Lf_60, Lf_61, Lf_62, Lf_63, Lf_64, Lf_65
DW Lf_66, Lf_67, Lf_68, Lf_69, Lf_6a, Lf_6b, Lf_6c, Lf_6d, Lf_6e, Lf_6f
DW Lf_70, Lf_71, Lf_72, Lf_73, Lf_74, Lf_75, Lf_76, Lf_77, Lf_78, Lf_79
DW Lf_7a, Lf_7b, Lf_7c, Lf_7d, Lf_7e, Lf_7f
SEGEND DATA
SEGDEF CODE
PUBLIC ltext
IF @bigmodel
EXTRN gdc_nb:FAR, chk_col:FAR, a_mode:FAR, line:FAR, a_patrn:FAR
EXTRN eseg_sav:FAR
ELSE
EXTRN gdc_nb:NEAR, chk_col:NEAR, a_mode:NEAR, line:NEAR, a_patrn:NEAR
EXTRN eseg_sav:NEAR
ENDIF
;************************************************************************
;* *
;* F U N C T I O N ltext(x, y, string) *
;* int x, y; char *string; *
;* *
;* entry: 8[bp] 'x' co-ordinate *
;* 10[bp] 'y' co-ordinate *
;* 12[bp] pointer to string array. *
;* *
;************************************************************************
PROCDEF ltext
push si
push di ;-2[bp] temp x.
push bp ;-4[bp] temp y.
mov bp,sp
sub sp,04H
mov ax,cs:WORD PTR eseg_sav
mov es,ax
call gdc_nb
mov al,BYTE PTR l_type ;get and save old line type.
push ax
mov BYTE PTR l_type,0 ;set up line type for solid lines.
call a_patrn ;set pattern multiplier.
pop ax ;restore old line type.
mov BYTE PTR l_type,al
mov al,BYTE PTR t_col ;check for correct colour.
call chk_col
test BYTE PTR gbmod,2 ;are we in vector mode.
jnz Lstrg
or BYTE PTR gbmod,12H
call a_mode
Lstrg:
mov ax,08[bp]
mov -2[bp],ax
mov ax,10[bp]
mov -4[bp],ax
mov si,12[bp] ;point to string array.
Ldo_strg:
lodsb ;get character.
or al,al
jz L0 ;exit if end of string.
cmp al,1FH
ja Ldo_1 ;loop if control character.
cmp al,7FH
jbe Ldo_1 ;loop if > DEL.
jmp Ldo_strg
Ldo_1: push si
call Lsho_char ;display it
pop si
mov al,BYTE PTR t_sca ;adjust 'x' position by scale factor.
xor ah,ah
shl ax,1
shl ax,1
add -2[bp],ax
jmp Ldo_strg ;loop until done
L0: mov sp,bp
pop bp
pop di
pop si
ret
Lsho_char:
mov BYTE PTR Lflag,0 ;set FLAG to first vector.
xor ah,ah
sub al,20H ;make character zero relative.
shl ax,1
mov si,ax
mov si,WORD PTR Llf_tabl[si] ;point into font vectors.
L1: mov al,[si] ;get vector.
test al,80H ;is it an end ?
jz L3 ;skip if not.
mov BYTE PTR Lflag,0
test al,8 ;is it END OF CHAR ?
jz L2
ret ;quit if yes.
L2: inc si ;point to next vector and start again.
jmp L1
L3: test BYTE PTR Lflag,1 ;is this the first vector ?
jz L4 ;jump if it is.
lea di, Lxf
jmp L5
L4: lea di, Lxs
L5: call Llvect ;work out and add in the offset s.
test BYTE PTR Lflag,1 ;is it the first vector ?
jnz L6 ;skip if not.
mov BYTE PTR Lflag,1 ;set FLAG to indicate first vector set
jmp L1 ;and start again.
L6: lea ax, Lxs
push ax
call line ;at last the line can be drawn.
add sp,2
mov ax,Lxf ;make the end of the last line
mov Lxs,ax ;the start of the next line.
mov ax,Lyf
mov Lys,ax
jmp L1
Llvect:
mov ax,-2[bp] ;get x value.
mov [di],ax
mov ax,-4[bp] ;get y value.
mov 2[di],ax
lodsb ;get stroke info
mov bx,ax ;and duplicate in bx for x offset .
and ax,0FH ;mask to y value
test al,8 ;negative ?
jz L7
or ax,0FFF0H ;sign extend
L7: mov cl,BYTE PTR t_sca
xor ch,ch
push cx
imul cx ;multiply by scale value
mov cx,2
idiv cx ;and divide by two.
add 2[di],ax ;subtract to y offset
and bx,0F0H ;mask to x value
mov cl,4 ;shift to 4 lsb
shr bx,cl
test bl,8 ;negative ?
jz L8
or bx,0FFF0H ;sign extend
L8: mov ax,bx
pop cx
imul cx ;multiply by scale value
mov cx,2
idiv cx ;and divide by two
add [di],ax ;add to x offset
ret
PROCEND ltext
include epilogue.h
END