flat assembler
Message board for the users of flat assembler.
Index
> DOS > How to program with CWSDPMI? |
Author |
|
Dex4u 04 May 2005, 13:04
I do not know much about DPMI, but "Dex4u" is like a 32bit pmode Dos, it has a full set of function you can call from pmode, but the best thing is you can uses upto 4GB of memory.
You can load programs from a floppy or cd. Heres a hello world" example: Code: ;=========================================================;; Test calltable 18/03/05 ;;---------------------------------------------------------;; By Dex4u. ;; ;; Here is a simple "hello world" program. ;; for Dex4u, using the calltable functions. ;; To assemble use fasm as follows ;; c:\fasm hello.asm hello.dex ;;=========================================================;use32 ORG 0x200000 ; where our program is loaded to jmp start ; jump to the start of program. db 'DEX1' ; We check for this, to make shore it a valid Dex4u file.msg1: db 'Hello world! ',13,0 ;----------------------------------------------------; ; Start of program. ; ;----------------------------------------------------;start: mov ax,18h mov ds,ax mov es,ax ;----------------------------------------------------; ; Get calltable address. ; ;----------------------------------------------------; mov edi,Functions ; this is the interrupt mov al,0 ; we use to load the DexFunction.inc mov ah,0x0a ; with the address to dex4u functions. int 40h ;----------------------------------------------------; ; Try print string. ; ;----------------------------------------------------; mov esi,msg1 ; this point's to our string. call [PrintString] ; this call the print function. call [WaitForKeyPress] ; is the wait for keypress function. ret ; This returns to the CLI/GUI ;----------------------------------------------------; ; Data. ; ;----------------------------------------------------;include 'DexFunctions.inc' ; Here is where we includ our "DexFunctions.inc" file you can get the OS here: http://falconrybells.co.uk/ Or see the forum here: http://dex.7.forumer.com/ |
|||
04 May 2005, 13:04 |
|
Cas 08 May 2005, 04:17
Hey. I am VERY interested in that. Where should I go to check that? And where can I get a documentation with all the services and such? Thanks.
|
|||
08 May 2005, 04:17 |
|
Dex4u 08 May 2005, 13:14
You can down load it here: http://falconrybells.co.uk/
And you can get info on programming for it at this forum : http://dex.7.forumer.com/ here are some of the services you can call Code: ;=========================================================;; Dex Functions 11/12/03 ;;---------------------------------------------------------;; Function call table. ;; ;; Dex4u V0.01 ;; (c) Craig Bamford, All rights reserved. ;;=========================================================;;----------------------------------------------------;; Functions ; Function calltable. ;;----------------------------------------------------;Functions:CallTableAddress rd 1 ; 0.call-table address,DO NOT call as function.Function1 rd 1 ; 1.RealModeInt10h rd 1 ; 2.Call realmode int 10h,fill in AX,BX,CX,DX, with function number etc, be carefull may not work will all functions.RealModeRegs rd 1 ; 3.Fills in AX,BX,CX,DX with result from above function,set CF to 1 on error.WaitForKeyPress rd 1 ; 4.Wait for keypress,Exit: ASCII code of keypressed in AL .KeyPressedNoWait rd 1 ; 5.If keyperssed AL=1,if no keypressed AL=0.ExtendedMemory rd 1 ; 6.puts extended memory in eax (in KBs),puts total ram in ebx (in MB)ConvenMemorySize rd 1 ; 7.puts conventional memory in eax (in KBs)TextColor rd 1 ; 8.Sets the text color, Entry: AL=color.PrintString rd 1 ; 9.prints a string,esi should point to a 0 termanated string.PrintChar rd 1 ; 10.prints the char,in alPrintCharCursor rd 1 ; 11.prints the char,in al and moves cursorSetCursorPos rd 1 ; 12.Sets Cursor Pos, Entry: AL=X, AH=Y, if the X or Y is bigger than screen size, CF to 1, succes AH=0.WriteHex32 rd 1 ; 13.print the hex value,in eaxWriteHex16 rd 1 ; 14.print the hex value,in alUpperCase rd 1 ; 15.Converts a 0 termanated string,to uppercase (es:edi = string buffer)CompearString rd 1 ; 16.Compear two strings,set CF to 1, if strings are not the sameSetDex4uFonts rd 1 ; 17.Goes to realmode and back sets 50x80 mode/fontsFloppyfileLoad rd 1 ; 18.Loads a file from floppy,ESI points to name of file to load,EDI = place to load file to,set's CF to 1 on error.CdfileLoad rd 1 ; 19.Loads a file from CD, CX = file name lenth,ESI = name of file to load,EDI points to place to load to,set's CF to 1 on error.SetDelay rd 1 ; 20.Sets a delay, ax = delay,18.2 = 1 second.DetectPciBus rd 1 ; 21.Detect Pci Bus present, set's CF to 1, if no pci busPciFindDevice rd 1 ; 22.Scan through PCI space looking for a device+vendor ID,CF to 1,if no vender/device found.PciRegWrite8 rd 1 ; 23.Entry: EAX=PCI Bus/Device/fn/register number,DL=data to write.PciRegWrite16 rd 1 ; 24.Entry: EAX=PCI Bus/Device/fn/register number,DX=data to write.PciRegWrite32 rd 1 ; 25.Entry: EAX=PCI Bus/Device/fn/register number,EDX=data to write.PciRegRead8 rd 1 ; 26.Entry: EAX=PCI Bus/Device/fn/register number,Exit: DL register data.PciRegRead16 rd 1 ; 27.Entry: EAX=PCI Bus/Device/fn/register number,Exit: DX register data.PciRegRead32 rd 1 ; 28.Entry: EAX=PCI Bus/Device/fn/register number,Exit: EDX register data.Function29 rd 1GetUserInput rd 1 ; 30.Gets user input, until enter pressed. Exit: EDI = buffer address, cx = string len.LoadVesaInfo rd 1 ; 31.loads the address of vesainfo in esi, use this to fill a vesa info structure.SetVesaMode rd 1 ; 32.Sets vesa mode 4112h (640*480 32bpp),need vesa info structure filling in, use above function.Function33 rd 1 Theres more function being add each week, you can also load the OS from dos just by running kernel32.exe from dos (not a dos box,but real dos). Hope this helps. |
|||
08 May 2005, 13:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.