Assembler in DOS.
category: code [glöplog]
ok, it was real simple.
since the program lies in only one segment, how can i know which addresses/offset that is safe to use? is everything safe? (that is all 64KB?) first i made a table, but like kb said this takes up way to much space, so i go for trying to use one byte instead (its just an experiment) for example i loaded one font into 0xffef. since that there are 16bytes (which makes up a char in standard textmode). the two last 16 bytes where safe (it seemed) this time, but what if i use some other offset address?
to make things more clear of what i am asking about, ill post some code _again_:
[code]
push 0ffefh ;push offset onto stack
pop bp ;pop stackvalue into bp
i now have pointer to es:bp (that is es:00EF and can change it), but is it safe? i guess so, if all code and data is at the start 0100h ? and everything below is safe to use. yes?
to make things more clear of what i am asking about, ill post some code _again_:
[code]
push 0ffefh ;push offset onto stack
pop bp ;pop stackvalue into bp
i now have pointer to es:bp (that is es:00EF and can change it), but is it safe? i guess so, if all code and data is at the start 0100h ? and everything below is safe to use. yes?
I'm not sure about that, but... if I'm not wrong, DOS reserves an entire segment (65536 bytes) for the COM program currently loaded. So it should be safe to store your font wherever you want as long as it's within that segment. Somebody else please correct me if I'm wrong, or confirm what I've just said.
sorry i meant ryg, not kb.
What you have to take care of is that you don't have a collision with the stack. In a COM file, the code segment is identical to the stack segment. Usually the stack pointer is set to offset FFFF and if you push once, it gets decreased etc. So if you store your font close to the location of the stack (i.e. the end of the segment), there might be a collision.
Quote:
[16:48] <rudi> what's the point on setting mode13h and mode03h after one another?
[16:50] <rudi> i see an assembler program that does just that
[16:53] <med> 13h is 320x200 vga mode, 03 sets it back to textmode
[16:54] <rudi> yes
[16:54] <rudi> i guess he just do it to force into fullscreen
[16:55] <med> is it a graphics program?
[16:55] <rudi> yes
[16:55] <rudi> its a program that goes into some 8x8 char mode though
[16:55] <med> probably on exit to go back to textmode
[16:59] <wbeee> he means it does one immediately after the other i think
[16:59] <med> hmm ascii demo?
[17:12] <rudi> wbeee: correct
[17:15] <rudi> i have other things bugging me though. i'd like to reset to the default bios fonts after ive used my own
[17:16] <rudi> that is, i make user defined fonts in some area in memory and use it, but when program is exit, the fonts are still there
[17:16] <rudi> dosbox seem to reset the fonts when i call mode 03h
[17:17] <rudi> but i am not sure if that is ordinary, because dosbox has alot of bugs
[17:17] <rudi> and also features that should not be there..
[17:18] <rudi> because the same thing can be done with the CLS command
[17:18] <rudi> like for example, when i boot into dos with my laptop, the CLS command doesnt reset to the BIOS fonts, while it does in dosbox
Have you tried to invoke int 11h? That's a complete BIOS API to manipulate the charset in textmode.
Consult Ralph Browns interrupt list for details.
Consult Ralph Browns interrupt list for details.
Every DOS program gets all available memory; in a non-multitasking environment, there's no reason not to.
You simply get all segments between your initial CS/DS and the highest available segment (stored in the PSP).
You simply get all segments between your initial CS/DS and the highest available segment (stored in the PSP).
torus: well, ive allready manipulated the fonts. i use functino 11h yes. its all here: http://www.home.no/rudibs/code/USERFONT.ASM
ryg: i found out just that. i save my font at the end of the program, so that it can work from there. im not sure if that is safe, but it works.
ryg: i found out just that. i save my font at the end of the program, so that it can work from there. im not sure if that is safe, but it works.