Functions i've made: -------------------- All functions are built automatically into EXE unless other wise stated. start32.asm ----------- alloc_dma16 - alloc a 16KB DMA buffer (only 2 are avail the rest of RAM is alloced for malloc) (returns NULL if not avail) getint,vec:byte - get PMODE int vector setint,vec:byte,sel:word,off:dword - set it alloc_rmcallback,off:dword - get a RETF frame stack real mode callback (see DOS32 dox) - returns a seg:off (real mode) which when run will call your proc alloc_rmintcallback,off:dword - get a IRET frame stack real mode callback (see DOS32 dox) - returns a seg:off (real mode) which when run will call your proc as an interrupt malloc,siz:dword - alloc RAM (just like in C) (=ERROR if not avail) cmalloc,siz1:dword,siz2:dword ;total size= siz1*siz2 - alloc RAM (just like in C) (=ERROR if not avail) - also clears alloc RAM to 0 qfree - query free RAM avail. (eax=largest free ebx=total) free,blk:dword - free a block alloc from malloc getenv,nam:dword - get an enviroment string ptr (eax=ptr to string or NULL) exit,errorcode:byte - exit to DOS (func will do cleanup) - DO NOT CALL int 21h/ah=4c00 directly lock_ram,off:dword,siz:dword - lock RAM under DPMI (function will check for DPMI) unlock_ram,off:dword,siz:dword - unlock it DATA AVAIL IN c0.ASM selcode dw - code selector seldata dw - data selector selzero dw - zero selector _base dd - program base address _environ dd - ptr to enviroment table _psp dd - ptr to PSP _pmmode db - current PM mode = (1-RAW 2-XMS 4-VCPI 8-DPMI) plus other unimportant stuff... string.asm ---------- printf,format:dword,... - just like in C - the format of the format string is different types:b=byte w=word d=dword c=char modifiers:H=hex output B=binary S=signed decimal generally: % [modifier] type no strings yet... (eg: %s) sprintf,buf:dword,format:dword,... - just like in C sscanf,format:dword,... (addresses required) - just like in C but uses above format in string str2num,str:dword - convert a string to a number (always returned in eax) - string may start with + or - and leading spaces etc. ;the format of num2str's is num2str_bb,number,str:dword num2str_bb - convert # to string (byte - binary) num2str_bs - convert # to string (byte - signed) num2str_bb - convert # to string (byte - hex) num2str_b - convert # to string (byte - decimal) num2str_wb - convert # to string (word - binary) num2str_ws - convert # to string (word - signed) num2str_wb - convert # to string (word - hex) num2str_w - convert # to string (word - decimal) num2str_db - convert # to string (dword - binary) num2str_ds - convert # to string (dword - signed) num2str_db - convert # to string (dword - hex) num2str_d - convert # to string (dword - decimal) strcpy , strcat, strlen ,strcmp - all like in C print,str:dword - simple print string printxy,x:word,y:word,str:dword - print at screen pos x,y gotoxy,x:word,y:word - change cursor pos x,y setmode50 - change to 80x50 text mode clrscr - clears screen setcursor,scan:word - sets cursor start/stop scan lines (a value of 512 removes cursor) file.asm -------- open,file:dword,access:byte ;0=read 1=read/write (directly given to DOS) - open a file close,h:word read,h:word,buf:dword,len:dword write,h:word,buf:dword,len:dword lseek,h:word,pos:dword,typ:byte ;0=from start 1=relative 2=from end pack_init,nooffiles:word - initalizes the PAK system. You must give a # specifing how many files can be loaded within the packed files which will be opened pack_open - loads a packed file so that the files within can be opened -see pack.txt for details key.asm ------- key_init - init the PMODE keyboard handler key_read or getch - reads one key. AH=scan code AL=char NOTE: if al<32 or al>128 then it's a special code (see key.txt) text.asm (not linked in automatically - you must include it) -------- NOTE: to add this just include it. It's in the INC directory. backfill,x:word,xl:word,y:word,yl:word - fills background with char box,x:word,xl:word,y:word,yl:word - fills a solid BOX box1,x:word,xl:word,y:word,yl:word - draws a single-line box box2,x:word,xl:word,y:word,yl:word - draws a double-line box bar,x:word,y:word,xl:word,col:byte - draws a bar underneath text see video.txt to see how video stuff works...