flat assembler
Message board for the users of flat assembler.

Index > DOS > bitmaps of ascii characters

Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1404
Location: Piraeus, Greece
Picnic 11 Dec 2007, 19:19
Hello,
How to find the bitmaps of ascii characters in memory?
Post 11 Dec 2007, 19:19
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 11 Dec 2007, 20:53
what you want is this?
FFA6:000E rom graphics character table?
Post 11 Dec 2007, 20:53
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1404
Location: Piraeus, Greece
Picnic 11 Dec 2007, 21:58
Hi edfed, I can't figure out what registers should i use, is this for 8x16 font?
Post 11 Dec 2007, 21:58
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 11 Dec 2007, 22:11
i don't know
but to have an exact knowledge, i propose you this:
Code:
org 100h
mov ax,13h
int 10h
mov ax,0A000h
mov es,ax
mov ax,0ffa6h
mov gs,ax
mov esi,0eh
mov edi,0
mov bx,255
.nextchar:
mov ax,[gs:esi]
add esi,2
.nextline:
mov cx,1
.nextpix:
mov dl,0 ;black
test ax,cx
je @f
mov dl,1 ;blue
@@:
mov [es:edi],dl
add edi,320
shl cx,1
jne .nextpix
sub edi,16*320
inc edi
dec bx
jnl .nextchar
ret
    


it need some fixes, but it works
Post 11 Dec 2007, 22:11
View user's profile Send private message Visit poster's website Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 11 Dec 2007, 23:17
Quote:

INT 10 - VIDEO - GET FONT INFORMATION (EGA, MCGA, VGA)
AX = 1130h
BH = pointer specifier
00h INT 1Fh pointer
01h INT 43h pointer
02h ROM 8x14 character font pointer
03h ROM 8x8 double dot font pointer
04h ROM 8x8 double dot font (high 128 characters)
05h ROM alpha alternate (9 by 14) pointer (EGA,VGA)
06h ROM 8x16 font (MCGA, VGA)
07h ROM alternate 9x16 font (VGA only) (see #00021)
11h (UltraVision v2+) 8x20 font (VGA) or 8x19 font (autosync EGA)
12h (UltraVision v2+) 8x10 font (VGA) or 8x11 font (autosync EGA)
Return: ES:BP = specified pointer
CX = bytes/character of on-screen font (not the requested font!)
DL = highest character row on screen
Note: for UltraVision v2+, the 9xN alternate fonts follow the corresponding
8xN font at ES:BP+256N
BUG: the IBM EGA and some other EGA cards return in DL the number of rows on
screen rather than the highest row number (which is one less).
SeeAlso: AX=1100h,AX=1103h,AX=1120h,INT 1F"SYSTEM DATA",INT 43"VIDEO DATA"

Format of alternate font table [array]:
Offset Size Description (Table 00021)
00h BYTE character to be replaced (00h = end of table)
01h N BYTEs graphics data for character, one byte per scan line
Post 11 Dec 2007, 23:17
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 12 Dec 2007, 03:28
to see what is the font from rom bios
Code:
        org 100h
        mov ax,13h
        int 10h
        mov ax,0A000h
        mov es,ax
        mov ax,0ffa6h
        mov gs,ax
        mov si,0eh
        xor di,di
        mov dx,di
        mov ch,16
.printline:
        mov cl,16
        mov di,dx
        shl di,2
        add di,dx
        shl di,6
.printchar:
        inc di
        mov bl,8
.nextline:
        mov al,[gs:si]
        add si,1
        mov ah,80h
.nextpix:
        mov bh,0 ;black
        test al,ah
        je @f
        mov bh,1 ;blue
@@:
        mov [es:di],bh
        inc di
        shr ah,1
        jne .nextpix
        add di,320-8
        dec bl
        jne .nextline
        sub di,320*8-8
        dec cl
        jne .printchar
        add dl,9
        dec ch
        jne .printline
@@:
        in al,60h
        cmp al,1
        jne @b
        ret
    


UFO NOSS Smile
Post 12 Dec 2007, 03:28
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1404
Location: Piraeus, Greece
Picnic 13 Dec 2007, 19:08
Thank you both for your help, i've tested both ways.
I can't locate the bytes at FFA6:000E in xp console but it's ok on DosBox Emulator.
Vga's 1130h works fine.
Post 13 Dec 2007, 19:08
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1404
Location: Piraeus, Greece
Picnic 24 Dec 2007, 22:30
Displays a nice big 'FASM' in mode 13h, tested on Windows xp.
Code:
        org 100h                    
        
        mov al,13h                    ; mode 13h 320x200 
        int 10h      
        
        mov si,fasm                   ; offset address
        mov bx,4                       ; x horizontal coordinate   
        mov cl,bl                       ; outer loop (4 characters)
find:                                 
        lodsb                            
        cbw                             ; byte to word
        shl ax,3                        ; ax*8
        lgs di,[fs:43h*4]            ; font table location
        add di,ax                      ; find current letter 
        mov dx,60                     ; y vertical coordinate
        mov ch,8                      ; inner loop (8 bytes)
get:                                 
        mov ah,[gs:di]               ; get character byte
        call draw                       
        add dx,10                     
        inc di                            ; next byte              
        dec ch                         
        jnz get                         
        add bx,80                                      
        loop find                       ; find next character
        xor ah,ah                      ; wait for key   
        int 16h                            
        mov ax,3                      ; restore text mode
        int 10h                        
        int 20h                         ; exit program        
                   
draw:
        pusha                           ; save registers
        mov al,8                       ; for each bit in byte
bit:
        shl ah,1                        ; shift to the left
        jnc nxt                         ; draw tile if carry flag
        mov cl,8                       ; tile height (pixels)
tout:        
        mov ch,8                       ; tile width
tin:
        call pixel
        inc bx                            
        dec ch
        jnz tin
        sub bx,8    
        inc dx
        loop tout
        sub dx,8       
nxt:
        add bx,10                       
        dec al                    
        jnz bit
        popa                               ; restore registers                   
        ret                     
         
pixel:
        pusha
        mov cx,bx                       
        mov ax,0c0fh                   ; draw white pixel at cx,dx 
        int 10h    
        popa
        ret        
        
        fasm db 'FASM'
    
Post 24 Dec 2007, 22:30
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 25 Dec 2007, 00:14
thimis wrote:
Displays a nice big 'FASM' in mode 13h, tested on Windows xp.


Did you test on DOS also ?

You know, it displays junk Crying or Very sad

Code:
        org 100h                    
        
        mov al,13h                    ; AH = ??? Laughing 0 maybe ?
        int 10h      
        
        mov si,fasm                   ; offset address
        mov bx,4                       ; x horizontal coordinate   
        mov cl,bl                       ; outer loop (4 characters)
find:                                 
        lodsb                            
        cbw                             ; byte to word
        shl ax,3                        ; ax*8
        lgs di,[fs:43h*4]            ; FS = ??? Laughing Also 0 maybe ? 
    

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 25 Dec 2007, 00:14
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1404
Location: Piraeus, Greece
Picnic 25 Dec 2007, 10:18
Unfortunately no, only on Windows xp Dos and Dosbox Emulator.
Thanks for the indications NTOSKRNL_VXE, zero on both cases Smile
Post 25 Dec 2007, 10:18
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 25 Dec 2007, 11:10
here is an old font editor. unfortunatelly (for you) it has russian interface, but it is so simple, so you can try to use it in a "blind" way:

1.when you start it it will ask you to search font: in file (up option) and in memory (down option). if you will choose file - you will need then to type file name manually (if file not found - check if it is not hidden or so). if it is not in current dir - maybe need to type full file name.
2.after file or memory searched - suggested list of found fonts 8x?? - you may chose one to edit or search manually.
3.if you are searching manually "+"/"-" increase/decrease font height to update search.
4.when you found a font you may edit it: press F4
5.while editing - walking by dots - arrow keys, by symbols - shift+arrow keys, toggle dot - space bar.
options:
F2-save full this file
F3-replace current font with another from other file
F4-save current font to file


Description:
Download
Filename: F0NTEDIT.7z
Filesize: 16.77 KB
Downloaded: 547 Time(s)


_________________
UNICODE forever!
Post 25 Dec 2007, 11:10
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.