Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DEF SEG ADDRESSES

Status
Not open for further replies.

KenshinHimura

Programmer
May 8, 2003
91
0
0
US
I was wondering what the DEF SEG = &HFFA6 is pointing to? And also could you tell me more useful memory addresses. Any would be fine. THX :)
 
Def Seg &HB800
Text mode screen
for loading screen image (text)
def seg &HA000
VGA mode screen 12 (most others too)
 
&HA000 is video memory...

I believe even Vesa modes bank the data through this segment... (Not Sure)

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
but what about DEF SEG + &HFFA6
and I also have 1 more question what is a buffer and what does it mean. THX :)
 
&Hffa6 is somewhere towards the top of the bios.

A buffer is an area of memory set aside to receive data.

rgds
Zeit.
 
&HFFA6 is where the bios font is stored.

doing....

DEF SEG = &HAFFA6

...points to this location. Then you can use PEEK to retrieve the font data. Here's a small SUB that uses this method which prints words on the screen without using PRINT.

Code:
DEFINT A-Z

DECLARE SUB BIOSPRINT (x%, y%, Text$, clr%)

SCREEN 13

BIOSPRINT 12, 12, "Hello", 12

DEFSNG A-Z
SUB BIOSPRINT (x%, y%, Text$, clr%)
'================================
'x%, y% = location to print.
'Text$ = Text to print
'clr% = Color of text
'================================

FOR d% = 1 TO LEN(Text$)
   FOR c% = 0 TO 7
     DEF SEG = &HFFA6
     l% = PEEK(14 + 8 * ASC(MID$(Text$, d%, 1)) + c%)
     x1% = x% + d% * 8 - 1
     x2% = x% + d% * 8 + 15: a% = 7
     FOR b% = x1% TO x2%
       IF l% AND 2 ^ a% THEN
         PSET (b%, c% + y%), clr%
       END IF: a% = a% - 1
     NEXT
   NEXT
NEXT

DEF SEG

END SUB


People often use method instead PRINT because the text has a transparent background,instead of blocking out the background the way PRINT does.

- Dav

My Qbasic Source code....
 
Yeah,
Such as a video buffer... it is an area (or array) of memory where you use to set up the screen for quick 'flipping'... this way you don't see the changes being made to the image until it is done... also, it is usually faster to use 'Normal' memory then Video memory to quickly read and write multiple data... Such as with blurring filters...


A keyboard buffer is another area of memory where the keypresses are processed and sent so you can go and see what keys were pressed...

Inkey$ reads from the keyboard buffer...
Inp(96) aka Inp(&h60) reads directly from the port...

If you use Inp(96), the buffer is bypassed and you must clear it out or it will overflow and begin to beep...

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
why is it that I can't change the values of DEF SEG = &HFFA6
when I POKE a value to it it just changes back? Is there a way to change it? Thx for all the help so far :)
 
That area should be controled by bios or rom...
And should not let anything change it...
It stored the Data for the ASCII characters... Such as the ones shown at startup... and Dos Prompt...

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
Would there be anyway possible to change the values? And if you did would that change the all of the DOS font?
 
Would there be anyway possible to change the values?
NOT THAT I KNOW OF...

And if you did would that change the all of the DOS font?
YES, IT WOULD

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
Guess I'll have to go deeply into this because that would be so cool. I mean then all you would have to do is BSAVE the memory and BLOAD it so they would be actual fonts in DOS instead of that boring one. I mean anythings possible with programming after all. I mean theres gotta be a way to shutdown the security.
 
...Unless the security is actually ROM...

Though, I believe Windows NT handles something differently...

Some Qbasic routines to draw Graphic fonts, using the Bios Ascii Character Map, any where on the screen tend to result in scrambled characters when you use the FFA6 segment to get the masks...

So I really don't know where the data comes from or what manages it...

If you find a work around, be sure to post it ;-)

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
Well I'm pretty sure that the data is loaded when you start up the computer. And I think that if you issue any SCREEN statement it will restore the ascii segments to the original way they were so if you did manage to change it every time you use a statement in DOS to affect the screen it would change the vallues in the segment &HFFA6 back to the way they were. Like how when you change SCREENs in qbasic everything at segment &HA000 is changed back to 0. So the "font" has to be loaded when the computer is booting up I think. Well, I'll have to research it more, but there just has to be a way. Even if it means slashing up my computer with a katana (but I'm pretty sure that wouldn't work). If files can be corrupted, if a computers will crash, if tousands of errors happen to you computer each day then I know theres a way to change those stupid values. cause the DOS text is just so boring.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top