Jump to content
xisto Community

Dirk Wolfgang Glomp

Members
  • Content Count

    23
  • Joined

  • Last visited

Everything posted by Dirk Wolfgang Glomp

  1. The text after a semicolon is a comment only for us and will be ignored from the assembler. This is a command line parameter of the 16 bit link.exe from masm 5.1. (We can remove all parameter.) 16 bit linker: Microsoft ® Segmented Executable Linker Version 5.60.339 Dec 5 1994 http://forums.xisto.com/no_longer_exists/ I think this fit the start address of the data segment on an boundary of 4 byte instead of only 2 byte for a data ailgment with an 32 bit access reading and writing within the data segment. From my homepage: Mode info: http://forums.xisto.com/no_longer_exists/ (2576 bytes) Demo: http://forums.xisto.com/no_longer_exists/ (12739 bytes) Dirk
  2. I prefer first person shooter. Dirk
  3. Because i want a strong card for gaming and additional a card for to programm own applications which use the VBE3-Bios in 1920x1200x32 (the native widescreen resolution of my 28" LCD) i bought a Colorfull GTX 295. Dirk
  4. I think this is a problem from the manufacturer of those cards and not a problem of the GPU.Daily i use a Geforce 4 TI4200(AGPx4 64MB) from MSI since many years without any problems, but my brothers Geforce 4 TI4200(AGPx8 128) from Asus died years ago. Dirk
  5. I like to help. There are some more integer math instructions. Increment: inc ax Decrement: dec ax Addition with carry (carry flag): mov ax, 8001hmov bx, 8000hadd ax, bxadc dx, 1 Substaction with borrow (carry flag): mov ax, 8000hmov bx, 8001hmov dx, 5sub ax, bxsbb dx, 1 Shift (bitwise) right (equivalent to an unsigned division by 2): mov ax, 4; AX in bits = 00000100shr ax, 1; AX in bits = 00000010 = 2 Shr inserts a zero bit in the highest position(msb) and shifted out a bit on the lowest position(lsb). (No flags are involved) Shift (bitwise) left (equivalent to an unsigned multiplication by 2): mov ax, 4; AX in bits = 00000100shl ax, 1; AX in bits = 00001000 = 8 Shl inserts a zero bit in the lowest position(lsb) and shifted out a bit on the highest position(msb). (No flags are involved) Load effective adress (only) for addition: lea bx, [bx+4]; instead of "add bx, 4"The primary purpose of the "lea" instruction is for to calculate the effective offset-address of a memory location, but we can use it also for an addition (possible with up to three operands). Lea is one of the fastest instructions, so it will be alienated and used as a replacement for increment, addition, decrement, subtraction and for multiplication (with a scale factor of 2, 4 or 8 in combination with a 32Bit register). (No flags are involved) Dirk
  6. For Windows i use most times the Built-in FTP client of the Total Commander to upload files to my homepage. Dirk
  7. Hm, then i think my file is corrupted and another copy of that file also.The next days i try to contact my nephews for to clear this. Many thanks for your feedback. Dirk
  8. Sorry, i don´t know wich image exactly do you mean. Wich one is from pipux.net?a) http://oldcomputers.net/pics/ti-994a.jpg http://cbmmuseum.kuto.de/images/home_c64_1.jpg c) http://forums.xisto.com/no_longer_exists/404.png But this is a dirty lie, because they want that people watch their image and therefore it is reachable on their webpage and the image is not removed til this moment, so it can´t be stolen.Additional no illegal copy of that image exist here on this page. This page have only a link to the image and the link itself is used for that what links are regular made for. Ok i try to test it, if i know which image is exacly from pipux.net. I understand what they want and i understand the problem for the forum to become a cease-and-desist order from a counsellor, but i don´t believe that they have the right to dictate how we watch their image.Maybe the next owners of images want that we stay only on one leg and singing didilidum to watch their images. Who knows does it go. We have always the right to filter any content of any webpage that we want to filter and if we want that only one image from a webpage appear for watching, then nobody have the legitimation to prevent us from watching only that image, if the image is reachable from the owners webpage and we only redirect the watcher to a part of their webpage. Comperatively if we stay together on the street in front of a shop with a lot of advertising inside of the shop window and i give you an eyeglass with red glasses and advise you to look into my little mirror in my hand to have a look only into a part of that shop window. If there is anybody that shout: "Hey policeman they have stolen our puppets only by watching it with a mirror, please stop that thieves."? Or is there a magican that elfstruck all mirrors so that they all are dangerous now, so we have to prevent the world from looking into mirrors? Yes, it is only a kind of dirty jokes, also with that owners of any content if they want something with no rights to dictate how we watch their contents. In my opinion break this dictate the human rights, so we can say this is a criminal doing by that counsellors/justice who press us to desist orders, if they want that we remove a link from our webpage and to dictate us how we are watching images. I don´t want that this forum becomes any problem with that and i realy want to care the rules here. So in the next time i don´t post any adress for to link an image, if it is not clear that the owner of that image give a positive statemant for to use it for free. Dirk
  9. Ups, first i have to say i don´t want to break the rules here. But i have not realy post the image, only the adress of the image. And i see a litle different between to download/upload an image and only to link an image on an other webpage. I still believe to link a webpage(or a part of it) with a page that we have made let us not to be the owner of the content of the other webpage. And we are also using their images if we have a directly look to their page and i am not sure about it, if we realy need any special rights for to link a content from other pages. In my opinion have nobody the rights to dictate how i have to look some pages on the web. Not the right to dictate which eyeglasses or which brownser i use and whether i use black papers to hide some pieces of the content that i don´t want to see. Figuratively a link is only the same as my black paper or a kind of eyeglasses that filters the content. At last i don´t want to begin a debate of rights here, so in the future i will try to follow the rules of this community more strictly. Thank you for your advice. Dirk
  10. Hi yordan, Personaly i am not realy familar with Linux, so i became i little help from my nephews. He send me this example for to remove all CRs in textfiles.I guess the red marked redirection command here("<$i >/tmp/trtmp && mv /tmp/trtmp") include also the filename for the mv-command? Dirk
  11. I began to learn to program on a TI 99-4a (from Texas Instruments) from looking and editing some Basic-Listings that i found.With an old Ghetto-Blaster(cassette-recorder) we load some listings into the Basic-ram. But we wait allways many hours for to load a small Listing. Additional the basic interpreter was also very slowly, so i begin to look to an alternative to speed up a program. A friend of mine told me that i have to learn how CPUs are working. Some years later i begin to learn how 6502-CPUs(Comodore 64) are working. Starting on a 80286-CPU i began with DOS and debug.exe to program on a x86. Today i use an Intel Core2quad Q9550@2.83 ghz. .............. but i need more single CPU-speed for routines that can´t be split like iterative formula. An answer from Betov (in alt.lang.asm) regarding the question "Why use assembly": "The price of freedom, so to say, and one of the reasons i am used to say that Assembly is an anarchist Language, whereas C (typicaly) is a fascist Language." Dirk
  12. I like it to copy files with Winscp from Windows to a different PC that run Linux with a ssh-server. Additional i use Putty to login and to telecontrol some Linux-PCs. But there is a little different between text-files that comes from Windows and text-files that comes from Linux. If we save a text-file with Notepad, then it contains "carriage return"-bytes at the end of every line. A text-file saved with a Linux editor contains only "linefeed"-bytes. For to remove "carriage return"-bytes from a text-file on a Linux-PC i use this script: #!/bin/sh for i in `find -type f`; do tr -d '\r' <$i >/tmp/trtmp && mv /tmp/trtmpAdditional i have written a little aplications for to run under DOS/Windows for to remove "carriage return"-bytes from smaller text-files(<64KB). ; Sourcecode for MASM 5 .MODEL SMALL.386 CODE SEGMENT use16 'CODE' assume cs:CODE,ds:DATEN,ss:STAPEL org 100hSTART: mov ax, DATEN mov ds, ax mov bx, ss ; zunächst die beiden Segmentadressen mov ax, es ; voneinander abziehen. Das ergibt die sub bx, ax ; Anzahl der Paragraphen vom PSP bis ; zum Anfang des Stack mov ax, sp ; da sich der Stackpointer am Ende des add ax, 0Fh ; Stacksegments befindet, gibt sein shr ax, 4 ; Inhalt die Länge des Stacks an add bx, ax ; zur bisherigen Länge hinzuaddieren mov ah, 4Ah ; neue GrĂśĂe an das DOS Ăźbergeben int 21h mov bx, 1000h ; 64 KB anfordern/reservieren mov ah, 48h ; anfordern/reservieren: BX = Anzahl/16 int 21h jc NOSPACE ; keine 64 KB = Fehler ! mov [FILSEG], ax ; Segment des File's mov fs, ax;---------------------------------------------------------------------------- mov ah, 62h ; Segment des PSP's ermitteln int 21h mov ds, bx ; PSP-Segment nach DS mov es, bx mov di, 80h ; Länge Kommandozeile mov cl, [di] ; nach CL cmp cl, 2 jna NOPARA cld ; aufwärts zählen inc di mov al, 20h repe scasb ; erste Leerzeichen Ăźberspringen dec di ; ein zurĂźck mov bp, diSUCHCR: cmp BYTE PTR[di], 0Dh jz short FOUND inc di jmp SUCHCR;------------------------------------FOUND: mov WORD PTR[di], 2400h; hinter filenamen: 0,"$" mov ax, fs mov cx, es mov fs, cx mov es, ax;---------------------------------------------------------------------------- mov dx, bp ; Zeiger auf 1.ASCII mov ax, 3D02h ; Datei Ăśffnen: lesen/schreiben (OPEN) int 21h jc NOFILE ; File nicht gefunden = Fehler ! mov bx, ax mov ax, DATEN mov ds, ax xor dx, dx ; low auf Anfang stellen xor cx, cx ; high auf Anfang stellen mov ax, 4202h ; Länge holen: vom Ende (LSEEK) int 21h and dx, dx ; High-word = null ? jnz TOBIG ; nein zurĂźck mov [FILEN], ax ; Anzahl retten mov dx, 1 ; low holen xor cx, cx ; high holen mov ax, 4200h ; Zeiger positionieren: vom Anfang(LSEEK) int 21h ; nochmal wegen DOS-Fehler xor dx, dx ; low holen xor cx, cx ; high holen mov ax, 4200h ; Zeiger positionieren: vom Anfang(LSEEK) int 21h mov cx, [FILEN] ; Anzahl zu ladender Byte's mov ds, [FILSEG] mov ah, 3Fh ; Datei lesen u. Zeiger bewegen (READ) int 21h mov cx, ax mov ah, 3Eh ; Datei schlieĂen (CLOSE) int 21h;---------------------------------------------------------------------------- mov ax, DATEN mov ds, ax xor si, si mov [FILEN], cxSUCHE: cmp si, cx ; Ende des File erreicht ? ja short ZMA cmp BYTE PTR es:[si], 0Dh jz short SCHR inc si jmp short SUCHE;------------------------------------SCHR: dec WORD PTR[FILEN] sub cx, si mov di, si inc si mov ds, [FILSEG] dec cx mov dx, si rep movsb mov ax, DATEN mov ds, ax mov si, dx mov cx, [FILEN] jmp short SUCHE;----------------------------------------------------------------------------ZMA: mov ax, fs mov dx, 82h xor cx, cx mov ds, ax mov ah, 3Ch ; Datei erstellen (CREATE) int 21h mov bx, ax mov ax, DATEN mov ds, ax xor dx, dx mov cx, [FILEN] mov ds, [FILSEG] mov ah, 40h ; Datei beschreiben (WRITE) int 21h;----------------------------------------------------------------------------NBACK: mov ah, 3Eh ; Datei schlieĂen (CLOSE) int 21hBACKE: mov ax, 4C00h int 21h;--------------------------------------------------------------------------- NOSPACE: mov dx, OFFSET ERRTEXT mov ah, 9 int 21h jmp short BACKE;------------------------------------NOPARA: mov ax, DATEN mov ds, ax mov dx, OFFSET PARERR mov ah, 9 int 21h jmp short BACKE;------------------------------------NOFILE: mov ax, DATEN mov ds, ax mov dx, OFFSET FILERR mov ah, 9 int 21h mov ax, fs mov ds, ax mov dx, bp mov ah, 9 int 21h jmp short BACKE;------------------------------------TOBIG: mov dx, OFFSET BIGERR mov ah, 9 int 21h jmp short NBACK CODE ends;--------------------------------------------------------------------------- DATEN SEGMENT use32 'DATA'FILSEG DW 0FFFFh ; Segment des File`sFILEN DW 0FFFFh ; Anzahl der geladenen Byte`sFILERR DB 0Dh, 0Ah DB "FEHLER ! File auf (angegebenen) Laufwerk/Pfad nicht gefunden = $"PARERR DB 0Dh, 0Ah DB "FEHLER ! Kein Filename als Parameter angehängt/Ăźbergeben !$"ERRTEXT DB 0Dh, 0Ah DB "FEHLER ! Zu wenig Arbeits-Speicher vorhanden !" DB 0Dh, 0Ah, 0Dh, 0Ah DB "Das Programm benĂśtigt zur AusfĂźhrung, ca. 64 KB freien Arbeits-Speicher !" DB "$"BIGERR DB 0Dh, 0Ah DB "FEHLER ! File ist grĂśĂer als 64KB !$" DATEN ends;--------------------------------------------------------------------------- STAPEL SEGMENT use16 STACK 'STACK' DB 20h dup (0FFh) STAPEL ends;--------------------------------------------------------------------------- endDirk
  13. I have played a little with JBuilder, but i have not really a know what i am doing. // $Header: z:/javafrak.java 2.1import java.awt.*;import java.lang.*;public class javafrak extends java.applet.Appletimplements Runnable{ Thread thread=null; int Max_X,Max_Y,Iter,X,Y,Col,ColR,ColG,ColB; double A,B,C,D,G,F,H,I,J,K,L,M,Zoom,verti,hori; double A1,B1,C1,D1,Step; String message1,message2,textfont; int textsize,textX,textY,textH,textW; Graphics offGraphics; Image offImage; public void init() { Max_X=size().width; Max_Y=size().height; offImage=createImage(Max_X,Max_Y); offGraphics=offImage.getGraphics(); offGraphics.fillRect(0,0,Max_X+1,Max_Y+1); Iter = 1250; hori = .000036; // nach rechts verti = .000035; // hĂśher Zoom = .002500; // tiefer Step = Zoom/80; A = -.765216+Zoom+hori; B = -.765325-Zoom+hori; C = .099886-Zoom+verti; D = .099996+Zoom+verti; message1 = "Bitte etwas Geduld"; message2 = "Fraktal wird berechnet"; textfont = "TimesRoman"; textsize = 36; Font myFont=new Font(textfont, Font.BOLD, textsize); FontMetrics myMetrix=getFontMetrics(myFont); textH=myMetrix.getHeight(); textW=myMetrix.stringWidth(message1); textX=(int)((Max_X-textW)/2); textY=(int)((Max_Y-textH)/2)-myMetrix.getDescent(); setFont(myFont); } public void start() { if(thread == null) { thread = new Thread(this); thread.start(); } } public void stop() { thread = null; offImage = null; offGraphics = null; } public void run() { while (thread != null) { try {Thread.sleep(0);} catch (InterruptedException e) {} repaint(); } } public void paint(Graphics g) { setBackground(Color.black); g.setColor(Color.green); g.drawString(message1,textX,textY); g.drawString(message2,textX-textsize,textY+textH); update(g); } public void update(Graphics g) { A1 = A; B1 = B; C1 = C; D1 = D; A -= Step; B += Step; C += Step; D -= Step; G=(D1-C1)/Max_Y; F=(B1-A1)/Max_X;//---------------------------------------------- for (Y = 0; Y < Max_Y; Y++) { for (X = 0; X < Max_X; X++) { Col=0; K=G*Y+C1; J=K; I=F*X+A1; H=I; L=J*J; M=H*H;//---------------------------------------------- frak: { while (Col<Iter) { J=2*H*J+K; H=M-L+I; L=J*J; M=H*H; Col++; if ((M+L)>4) { break frak; } } }// -------------- Pixel-Setzer ---------------- Col=(Col & 0x0000FF); // and ColR=(Col & 0xE0); ColG=(Col & 0x18); ColG=(ColG << 3); // shl ColB=(Col & 0x07); ColB=(ColB << 5); offGraphics.setColor(new Color(ColR,ColG,ColB)); offGraphics.drawLine(X,Y,X,Y);//---------------------------------------------- } // next X } // next Y//---------------------------------------------- g.drawImage(offImage,0,0,this); }}Dirk
  14. Only a few vesa function is for the protected mode(PM) only. So it is not possible to set a vesamode using the PM.But it is possible to use most VESA 3 function in the realmode(RM). VESA 3 provide vesamodi with own refreshrate that can be used also in banked mode. Linear Vesamodi can also be used with EMS-memory-manager within the RM or the Unrealmode/Bigrealmode/Flatrealmode(without a memory-manager). Dirk
  15. Vesa function 0 fill our buffer with the vesa-info. Inside of this vesa-buffer we found a pointer to the vesa-modetable. The modetable contains all aviable vesa-modenumbers(of the used vesa-bios).In the end of the modetable we found 0FFFFh. INT 10 - VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION AX = 4F00h ES:DI -> buffer for SuperVGA information (see #00077) Return: AL = 4Fh if function supported AH = status 00h successful ES:DI buffer filled 01h failed ---VBE v2.0--- 02h function not supported by current hardware configuration 03h function invalid in current video mode Desc: determine whether VESA BIOS extensions are present and the capabilities supported by the display adapter SeeAlso: AX=4E00h,AX=4F01h,AX=7F00h"SOLLEX",AX=A00Ch Index: installation check;VESA SuperVGA Format of SuperVGA information: Offset Size Description (Table 00077) 00h 4 BYTEs (ret) signature ("VESA") (call) VESA 2.0 request signature ("VBE2"), required to receive version 2.0 info 04h WORD VESA version number (one-digit minor version -- 0102h = v1.2) 06h DWORD pointer to OEM name "761295520" for ATI 0Ah DWORD capabilities flags (see #00078) 0Eh DWORD pointer to list of supported VESA and OEM video modes (list of words terminated with FFFFh) 12h WORD total amount of video memory in 64K blocks ---VBE v1.x --- 14h 236 BYTEs reserved ---VBE v2.0 --- 14h WORD OEM software version (BCD, high byte = major, low byte = minor) 16h DWORD pointer to vendor name 1Ah DWORD pointer to product name 1Eh DWORD pointer to product revision string 22h WORD (if capabilities bit 3 set) VBE/AF version (BCD) 0100h for v1.0P 24h DWORD (if capabilities bit 3 set) pointer to list of supported accelerated video modes (list of words terminated with FFFFh) 28h 216 BYTEs reserved for VBE implementation 100h 256 BYTEs OEM scratchpad (for OEM strings, etc.) Notes: the list of supported video modes is stored in the reserved portion of the SuperVGA information record by some implementations, and it may thus be necessary to either copy the mode list or use a different buffer for all subsequent VESA calls the 1.1 VESA document specifies 242 reserved bytes at the end, so the buffer should be 262 bytes to ensure that it is not overrun; for v2.0, the buffer should be 512 bytes the S3 specific video modes will most likely follow the FFFFh terminator at the end of the standard modes. A search must then be made to find them, FFFFh will also terminate this second list in some cases, only a "stub" VBE may be present, supporting only AX=4F00h; this case may be assumed if the list of supported video modes is empty (consisting of a single word of FFFFh) Bitfields for VESA capabilities: Bit(s) Description (Table 00078) 0 DAC can be switched into 8-bit mode 1 non-VGA controller 2 programmed DAC with blank bit (i.e. only during blanking interval) 3 controller supports VBE/AF v1.0P extensions 4 (VBE/AF) must call EnableDirectAccess to access framebuffer 5 (VBE/AF) controller supports hardware mouse cursor 6 (VBE/AF) controller supports hardware clipping 7 (VBE/AF) controller supports transparent BitBLT 8-31 reserved (0) SeeAlso: #00077,AX=4F09hWith the vesamodenumber and with the vesa function 1 we can get the modeinfo of the mode in a second buffer.In this modeinfo-buffer we can find the resolution of the mode. Buffer+12h = X (horizontal) and Buffer+14h = Y (vertical). Format of VESA SuperVGA mode information: ----------------------------------------- Offset Size Description (Table 0065) -------------------------------------------- 00h WORD mode attributes (see #0066) 02h BYTE window attributes, window A (see #0067) 03h BYTE window attributes, window B (see #0067) 04h WORD window granularity in KB 06h WORD window size in KB 08h WORD start segment of window A 0Ah WORD start segment of window B 0Ch DWORD -> FAR window positioning function (equivalent to AX=4F05h) 10h WORD bytes per scan line ---remainder is optional for VESA modes in v1.0/1.1, needed for OEM modes--- 12h WORD width in pixels (graphics) or characters (text) 14h WORD height in pixels (graphics) or characters (text) 16h BYTE width of character cell in pixels 17h BYTE height of character cell in pixels 18h BYTE number of memory planes 19h BYTE number of bits per pixel 1Ah BYTE number of banks 1Bh BYTE memory model type (see #0068) 1Ch BYTE size of bank in KB 1Dh BYTE number of image pages 1Eh BYTE reserved (0) ---VBE v1.2+--- 1Fh BYTE red mask size 20h BYTE red field position 21h BYTE green mask size 22h BYTE green field size 23h BYTE blue mask size 24h BYTE blue field size 25h BYTE reserved mask size 26h BYTE reserved mask position 27h BYTE direct color mode info bit 0: color ramp is programmable bit 1: bytes in reserved field may be used by application ---VBE v2.0 --- 28h DWORD physical address of linear video buffer 2Ch DWORD pointer to start of offscreen memory 30h WORD KB of offscreen memory ---VBE v3.0 --- 32h WORD bytes per scan line 34h BYTE 35h BYTE 36h BYTE 37h BYTE 38h BYTE 39h BYTE 3Ah BYTE 3Bh BYTE 3Ch BYTE 3Dh BYTE 3Eh DWORD max. Pixel clock ----------------------------------- 42h BYTE 189 dup(0) reserved ------------------------------------------------------------------------------ Bitfields for VESA SuperVGA mode attributes: Bit(s) Description (Table 0066) 0 mode supported 1 optional information available 2 BIOS output supported 3 set if color, clear if monochrome 4 set if graphics mode, clear if text mode ---VBE v2.0 --- 5 mode is not VGA-compatible 6 bank-switched mode not supported 7 linear framebuffer mode supported ------------------------------------------------------------------------------ Bitfields for VESA SuperVGA window attributes: Bit(s) Description (Table 0067) 0 exists 1 readable 2 writable 3-7 reserved ------------------------------------------------------------------------------ (Table 0068) Values for VESA SuperVGA memory model type: 00h text 01h CGA graphics 02h HGC graphics 03h 16-color (EGA) graphics 04h packed pixel graphics 05h "sequ 256" (non-chain 4) graphics 06h direct color (HiColor, 24-bit color) 07h YUV (luminance-chrominance, also called YIQ) 08h-0Fh reserved for VESA 10h-FFh OEM memory modelsDirk
  16. VESA Programming This is the second part of the source-code(please merge it with the fist part) : ;----------------------------------------------------------------------------; D A T A - S e g m e n t;---------------------------------------------------------------------------- DATEN SEGMENT use32 'DATA' org 0;--------------------------------------PIXTAB DD MaxY+Ausri dup (0); Offset table of startadresses of any line of the screen(linear framebuffer);----------------------------------------------------------------------------; Position - Table;----------------------------------------------------------------------------SX0 DD 122, 197 ; X, Y DD 373, 347 DD 493, 276 DD 363, 143 DD 323, 316 DD 235, 192 DD 273, 226 DD 107, 226 DD 422, 373 DD 112, 347 DD 133, 266 DD 471, 343 DD 423, 366 DD 227, 230 DD 143, 157 DD 376, 322 DD 212, 101 DD 442, 226 DD 293, 129 DD 371, 123 DD 323, 325 DD 167, 292 DD 223, 172 DD 226, 145 DD 113, 222 DD 167, 166 DD 133, 134 DD 442, 292 DD 252, 270 DD 323, 350 DD 262, 374 DD 270, 151 DD 166, 213 DD 233, 154 DD 123, 222 DD 126, 274 DD 060, 257 DD 226, 313 DD 418, 177 DD 357, 153 DD 458, 270 DD 185, 035 DD 248, 113 DD 463, 366 DD 370, 132 DD 254, 267 DD 239, 134 DD 445, 262 DD 454, 334 DD 279, 257 DD 146, 323 DD 238, 267 DD 143, 134 DD 236, 377 DD 139, 334 DD 475, 258 DD 454, 154 DD 136, 337 DD 484, 253 DD 177, 266 DD 224, 143 DD 397, 127 DD 448, 345 DD 188, 123 DD 442, 332 DD 323, 176 DD 472, 123 DD 194, 379 DD 046, 124 DD 227, 111 DD 144, 124 DD 359, 165 DD 177, 246 DD 151, 342 DD 178, 168 DD 132, 149 DD 427, 236 DD 214, 013 DD 361, 345 DD 323, 176 DD 249, 336 DD 179, 144 DD 439, 123 DD 438, 347 DD 288, 248 DD 343, 158 DD 228, 346 DD 183, 253 DD 347, 288 DD 233, 235 DD 198, 286 DD 153, 147 DD 297, 273 DD 336, 231 DD 479, 150 DD 243, 287 DD 257, 165 DD 111, 122 DD 389, 258 DD 358, 285 DD 224, 127 DD 082, 122 DD 266, 311 DD 114, 351 DD 321, 275 DD 433, 159 DD 240, 154 DD 496, 160 DD 148, 038 DD 224, 369 DD 312, 134 DD 167, 126 DD 278, 173 DD 533, 436 DD 356, 291 DD 490, 352 DD 369, 111 DD 230, 134 DD 477, 177 DD 319, 443 DD 553, 399 DD 236, 266 DD 474, 130 DD 397, 127 DD 238, 169 DD 142, 186 DD 171, 383 DD 599, 138 DD 368, 437 DD 124, 424 DD 597, 259 DD 165, 197 DD 143, 270 DD 459, 349 DD 159, 459 DD 427, 427 DD 215, 135 DD 180, 180 DD 377, 377 DD 245, 145 DD 473, 173 DD 308, 408 DD 483, 283 DD 525, 125 DD 412, 312 DD 242, 142 DD 293, 293 DD 571, 371 DD 423, 323 DD 467, 267 DD 183, 283 DD 326, 126 DD 313, 413 DD 267, 267 DD 533, 133 DD 248, 188 DD 358, 458 DD 183, 383 DD 162, 162 DD 370, 170 DD 434, 134 DD 357, 157 DD 123, 123 DD 477, 167 DD 534, 134 DD 477, 177 DD 264, 124 DD 458, 138 DD 154, 244 DD 137, 237 DD 193, 353 DD 376, 276 DD 543, 443 DD 427, 227 DD 145, 345 DD 523, 123 DD 338, 158 DD 473, 425 DD 196, 283 DD 443, 394 DD 558, 343 DD 430, 134 DD 414, 362 DD 331, 185 DD 561, 232 DD 434, 321 DD 376, 255 DD 598, 388 DD 114, 145 DD 140, 243 DD 537, 189 DD 375, 434 DD 225, 257 DD 178, 283 DD 157, 125 DD 296, 158 DD 372, 435 DD 484, 192 DD 543, 134 DD 439, 212 DD 338, 166 DD 367, 288 DD 133, 143 DD 196, 313 DD 429, 124 DD 122, 448 DD 585, 127 DD 145, 173 DD 534, 134 DD 157, 157 DD 323, 323 DD 177, 167 DD 134, 134 DD 277, 177 DD 164, 134 DD 558, 358 DD 254, 154 DD 287, 137 DD 493, 153 DD 476, 376 DD 243, 143 DD 527, 127 DD 445, 245 DD 123, 223 DD 138, 258 DD 373, 225 DD 396, 383 DD 143, 194 DD 258, 443 DD 330, 134 DD 414, 262 DD 531, 185 DD 361, 132 DD 334, 121 DD 476, 155 DD 198, 288 DD 114, 145 DD 240, 343 DD 137, 389 DD 275, 134 DD 525, 157 DD 478, 183 DD 557, 325 DD 296, 258 DD 572, 135 DD 484, 192 DD 343, 134 DD 239, 212 DD 138, 266 DD 467, 388 DD 233, 143 DD 196, 313 DD 529, 174 DD 422, 148 DD 385, 157 DD 245, 173;---------------------------------------------------------------------------; Stepper - Table;---------------------------------------------------------------------------STEP0X DD 1, 1 ; Number of Pixel for movement in horizontal DD 1, 2 ; and vertical direction (Step X,Y) DD 2, 1 DD 2, 4 DD 3, 1 DD 6, 6 DD 7, 5 DD 8, 4 DD 9, 3 DD 2, 8 DD 1, 6 DD 5, 2 DD 1, 3 DD 2, 4 DD 3, 5 DD 4, 6 DD 8, 1 DD 1, 2 DD 8, 3 DD 1, 9 DD 9, 1 DD 2, 2 DD 2, 3 DD 2, 7 DD 6, 1 DD 8, 8 DD 3, 3 DD 7, 7 DD 4, 1 DD 2, 7 DD 4, 3 DD 4, 2 DD 1, 1 DD 1, 2 DD 1, 3 DD 2, 3 DD 2, 1 DD 2, 2 DD 2, 2 DD 2, 1 DD 3, 1 DD 6, 2 DD 3, 3 DD 3, 3 DD 4, 1 DD 2, 2 DD 4, 3 DD 4, 6 DD 1, 1 DD 1, 2 DD 1, 2 DD 1, 4 DD 2, 1 DD 2, 2 DD 3, 3 DD 2, 4 DD 3, 1 DD 3, 3 DD 3, 2 DD 3, 1 DD 4, 5 DD 2, 2 DD 4, 3 DD 1, 2 DD 3, 1 DD 1, 2 DD 1, 3 DD 2, 4 DD 2, 1 DD 2, 2 DD 2, 3 DD 2, 4 DD 3, 1 DD 3, 2 DD 3, 3 DD 3, 4 DD 4, 1 DD 3, 2 DD 4, 3 DD 2, 2 DD 1, 1 DD 1, 2 DD 1, 3 DD 1, 2 DD 2, 1 DD 1, 2 DD 2, 3 DD 2, 2 DD 1, 1 DD 3, 2 DD 3, 3 DD 1, 1 DD 2, 1 DD 3, 2 DD 1, 3 DD 1, 2 DD 1, 1 DD 1, 2 DD 1, 3 DD 1, 3 DD 3, 1 DD 2, 2 DD 2, 1 DD 2, 1 DD 5, 1 DD 3, 2 DD 3, 3 DD 3, 1 DD 3, 1 DD 3, 2 DD 2, 3 DD 4, 1 DD 1, 1 DD 1, 2 DD 1, 3 DD 3, 4 DD 2, 1 DD 1, 5 DD 2, 3 DD 2, 4 DD 3, 1 DD 3, 2 DD 1, 3 DD 2, 3 DD 3, 1 DD 1, 2 DD 1, 3 DD 2, 1 DD 1, 1 DD 1, 1 DD 1, 3 DD 1, 2 DD 2, 1 DD 2, 2 DD 2, 3 DD 2, 3 DD 1, 1 DD 3, 2 DD 3, 3 DD 3, 3 DD 1, 1 DD 4, 1 DD 4, 3 DD 4, 2 DD 3, 1 DD 1, 2 DD 1, 3 DD 1, 3 DD 2, 1 DD 2, 2 DD 5, 3 DD 2, 1 DD 3, 1 DD 3, 2 DD 3, 3 DD 5, 3 DD 4, 1 DD 5, 2 DD 4, 1 DD 1, 2 DD 1, 1 DD 1, 5 DD 1, 3 DD 1, 3 DD 2, 1 DD 2, 2 DD 5, 1 DD 1, 4 DD 1, 1 DD 5, 2 DD 3, 5 DD 3, 4 DD 4, 1 DD 1, 2 DD 4, 3 DD 3, 5 DD 1, 1 DD 1, 1 DD 3, 3 DD 1, 4 DD 2, 3 DD 2, 1 DD 2, 3 DD 2, 4 DD 3, 1 DD 3, 2 DD 5, 3 DD 3, 1 DD 1, 3 DD 3, 5 DD 4, 3 DD 1, 2 DD 1, 1 DD 1, 2 DD 1, 3 DD 1, 4 DD 2, 1 DD 5, 1 DD 2, 3 DD 3, 4 DD 3, 3 DD 1, 2 DD 3, 3 DD 3, 4 DD 4, 1 DD 3, 2 DD 1, 3 DD 2, 4 DD 1, 5 DD 1, 2 DD 5, 3 DD 1, 2 DD 2, 1 DD 2, 2 DD 2, 5 DD 2, 3 DD 3, 1 DD 3, 3 DD 3, 3 DD 3, 1 DD 2, 1 DD 3, 5 DD 2, 3 DD 4, 2 DD 1, 1 DD 3, 1 DD 1, 3 DD 1, 3 DD 2, 1 DD 5, 2 DD 2, 3 DD 2, 1 DD 3, 3 DD 3, 2 DD 3, 3 DD 3, 3 DD 5, 1 DD 1, 2 DD 2, 3 DD 4, 2 DD 1, 1 DD 1, 2 DD 1, 3 DD 1, 4 DD 2, 1 DD 5, 2 DD 2, 3 DD 2, 4 DD 3, 1 DD 3, 2 DD 3, 5 DD 2, 1 DD 3, 1 DD 2, 2 DD 1, 3 DD 2, 2 ;----------------------S_Len = ($-STEP0X);--------------------------------------; Table of direction-flags for movement;--------------------------------------W0 DB (Anzahl+1)* 8 DUP(0) ; plus(0) / minus(1) für X,Y;--------------------------------------BALL DB 0CC00h dup (22h) ; Sprite-Table: Offset32, Farbe32;--------------------------------------PICAKT DD MaxX*4*MaxY ; Actual adress of the framebufferPICLEN DD MaxX*4*MaxY ; Screen lenghtPICMAX DD MaxX*4*MaxY*2 ; Max adress;--------------------------------------RETTSI DW 0, 0 ; I don´t like to push the SI-register on the stack;--------------------------------------HINFAR DD HFarb, HFarb ; Background Color;--------------------------------------; C i r c l e;--------------------------------------Y DD 0 ; Double-Word for FPU: sqrXM DD 0 ; X PositionYM DD 0 ; Y PositionCOL DD 0 ; ColorXMAX DW 0, 0YMAX DW 0, 0;--------------------------------------EDID DB 80h dup (55h) ; Buffer for DDC-Monitor-Info;--------------------------------------VINF DB 512 dup (0AAh) ; Buffer for Vesa-Info(4F00h)MINF DB 256 dup (044h) ; Buffer for Mode Info(4F01h);--------------------------------------CRTC DW 1456 ; Horizontal Total in PixelHORIANF DW 1122 ; Horizontal Sync-Start in PixelHORIEND DW 216 ; Horizontal Sync-End in PixelVERTOTA DW 814 ; Vertical Total in LinesVERTANF DW 768 ; Vertical Sync-Start in LinesVERTEND DW 42 ; Vertical Sync-End in LinesDOIFLAG DB 04h ; Flag (interlaced,doubleScan,polarity)PIXCLOC DD 118309000 ; Pixel clock in hzREFRATE DW 10000 ; Refresh-Rate in 0.01 hz;--------------------- DB 40 dup (0);--------------------------------------FLAG DB 0 ; Used for triple buffering adress switching;--------------------------------------ERTEX1 DB Cr, Lf, "No Video-Mode", Cr, Lf, "{:content:}quot;ERTEX2 DB Cr, Lf, "No lineare offset", Cr, Lf, "{:content:}quot;ERTEX3 DB Cr, Lf, "No MMX-CPU", Cr, Lf, "{:content:}quot;ERTEX4 DB Cr, Lf, "No Vesa-Bios", Cr, Lf, "{:content:}quot;ERTEX5 DB Cr, Lf, "No VESA 3 -Bios", Cr, Lf, "{:content:}quot;ERTEX6 DB Cr, Lf, "No DDC", Cr, Lf, "{:content:}quot;ERTEX7 DB Cr, Lf, "Less than 96 khz", Cr, Lf, "{:content:}quot;ERTEX8 DB Cr, Lf, "Less than 160 hz", Cr, Lf, "{:content:}quot;ERTEX9 DB Cr, Lf, "No pixelcloc", Cr, Lf, "{:content:}quot;;-------------------------------------- DATEN ends;---------------------------------------------------------------------------- STAPEL SEGMENT use16 STACK 'STACK' DB 10h dup (0) STAPEL ends;---------------------------------------------------------------------------- end Dirk
  17. VESA Programming This pure 16 Bit DOS aplication below demonstrate how to use a vesamode with a resolution of 1024 x 768 x 32 with an own refreshrate of 100hz and additionaly it demonstrate how to use the linear framebuffer with hardware triple buffering. To enable an access to the linear framebuffer i prefer the unrealmode/bigrealmode. For to use the unrealmode/bigrealmode we have to remove/REM any memmory manager like emm386.exe in our config.sys before. After rebooting without it we can start the aplication. Goal of the aplication: If the application starts without any error message, then the application switch into the vesamode and begin to move some balls across the screen and if they reached a border of the screen, then they turn their direction. For to terminate the application and to switch back to DOS in the textmode(3) please press any key on your keyboard. Minimum system requirements: Operating system: DOS 5, 6, or DOS 7 (a part of Windows98/ME) // Not working under Windows(DOSbox) and not working with a memmory manager like emm386.exe. MMX-CPU (tested on AMD Palomino 1800+@1550mhz and on AMD Tbred 2700+@2100mhz; Socket A mainboard with AGP) Fully working vesa 3 Bios (tested on MSI NVIDIA Geforce 4 TI 4200 64MB AGPx4 // failed with Powercolor ATI x800 pro(VBE3 256MB AGPx8)) CRT-Monitor with DDC and 96 khz (tested on 19" Samsung 940 and on 19" SAMTRON 96P) Used public documents from vesa.org(register and/or login): EEDIDguideV1.pdf vbe3.pdf ... Sorry, because i reached the limit for to post here i have to split the source-Code in two or tree parts looking forward to my next post. But all lines of the source must be in one file for to assemble it. So you have to merge it together. This is the first part of the source-code: ;--------------------------------------------------------------------------------------------------------------; I have written this sourcecode for MASM 5.; Example for to generate a 16 bit executable for a pure DOS-enviroment:; MASM /Z FILENAME.asm,FILENAME.obj,,; LINK /CP:1 FILENAME.obj,FILENAME.exe,,,;--------------------------------------------; Legal situation: No personalised spiritual ownership or liquidication rights for usement,; or for spreading out aviable, because all ideas are (at all hazards) only a small part of the; heritage of our common human culture and nobody can progress an idea without to make a use; of our all intergenerational relationships beginning from our roots thousands of years ago.;--------------------------------------------; Freeware and a wide-ranging transparency in the world helps a lot for to establish a social freedom and a gracefull living.; But additional We have to act very soon for to feed all humans and to stop the immiseration in the world.; Over one billion of humans are very hungry today, yesterday, the day before yesterday............; They all will die very painfully, if we can´t stop that with the highest ermergency now.;---------------------------------------------------------------------------------------------------------------.MODEL SMALL ; We want a small aplication.386P ; Enable protectmode instructions.387 ; Enable FPU instructions;-------------------------------------- MaxX = 1024 ; Horizontal resolution of the requested vesamode MaxY = 768 ; Vertical resolution MAXHZ = 160 ; CRT-Monitor: HZ MAXKHZ = 96 ; KHZ KreiFa = 00FFDD00h ; Circel Color Vring = 00030400h ; Color decrement Groesse = 02Dh ; Radius of the ball (2Dh) XPos = Groesse ; Position of the ball YPos = Groesse Anzahl = 35h ; Number of Objects (max.255) HFarb = 0; 0100A03h ; Background Color Max_X = (MaxX-(XPos*2))-9; Max and min Max_Y = MaxY-(YPos*2) ; X/Y Position Min_X = 9 ; of the movement area Min_Y = 9 IRQs_Port = 21h ; Port-Adress: IRQ-Controller Tast_Port = 60h ; Port-Adress: Keyboard-Controller Stat_Port = 64h ; Port-Adress: Keyboard-Status Cmos_Port = 70h ; Port-Adress: Bios-Cmos-Chip Cr = 0Dh ; Carriage Return Lf = 0Ah ; Line Feed Ausri = 16 ; Bytes for code alignment;---------------------------------------------------------------------------- CODE SEGMENT use16 'CODE' assume cs:CODE,ds:DATEN,ss:STAPEL org 100h;--------------------------------------START: mov eax, 1 ; Request for feature flags DB 0Fh, 0A2h ; CPUID instruction test edx, 00800000h ; is MMX feature flag(bit 23) set? jz NOMMX mov ax, DATEN ; Store relative Segmentadress of the Datasegment mov ds, ax ; into DS-Segmentregister mov es, ax ; into ES-Segmentregister mov di, OFFSET VINF ; Buffer(512 Bytes) for VESA-Info mov ax, 4F00h ; Function 0 int 10h ; Get up to 512 Bytes es:di (Datasegment:VINF) cmp ax, 4Fh ; succsesfull ? jnz NOVESA ; else error: no Vesabios aviable cmp Byte PTR[di+5], 3 ; Compare major version number of Vesa jb NOVESA3 ; lesser than Version 3 ? lfs si, [di+0Eh] ; Get pointer of Modelist in FS:SIMODE: mov cx, fs:[si] ; Get Modenumber lea si, [si+2] ; Instead of "add si,2" (increase Offset of modelist) cmp cx, 0FFFFh ; End of list ? jnz NOMODE add cx, 4000h + 800h ; VESAnumber + linear + CRTC mov ax, 4F01h ; Get Mode Info mov di, OFFSET MINF ; Buffer(256 Bytes) for Mode Info int 10h cmp ax, 4Fh jnz NOVESA cmp Word PTR[di+12h], MaxX jnz MODE cmp Word PTR[di+14h], MaxY jnz MODE cmp BYTE PTR[di+19h],20h; 32 Bits per pixel? jnz MODE and BYTE PTR[di], 80h ; Linear access enable ? jz NOLIN mov eax,[di+28h] and eax, eax ; Check if the linear Offset to the framebuffer is aviable ? jz NOLIN mov bp, cx ; Store the modenumber;-------------------------------------- mov ax, 4F0Bh ; Get/set Pixel-Clock mov dx, cx xor bl, bl ; Get mov ecx, DWORD PTR[PIXCLOC] int 10h cmp ax, 4Fh jnz NOCLOC ; Error: No pixelcloc mov DWORD PTR[PIXCLOC], ecx;-------------------------- xor eax, eax ; Calculate Refreshrate mov ax, [CRTC] ; Horizontal Total xor ebx, ebx mov bx, [VERTOTA] ; Vertikal Total mul ebx mov ebx, eax mov eax, ecx ; Pixelcloc mov esi, 10 xor edx, edx div esi xor edx, edx div ebx mov [REFRATE], ax ; RefreshRate=Pixelcloc/(HTotal*Vtotal);-------------------------------------- mov ax, 4F15h ; DDC - INSTALLATION CHECK mov bl, 0 ; for to get the monitor information int 10h cmp ax, 4Fh jnz NODDC mov ax, 4F15h ; DDC - READ EDID mov bl, 1 xor cx, cx xor dx, dx mov di, OFFSET EDID int 10h mov eax, 0FD000000h ; Text-identifier V/H range mov bx, 36h cmp [di+bx], eax ; di+36h detailed timing #1 jz short H1 add bx, 12h cmp [di+bx], eax ; di+48h detailed timing #2 jz short H1 add bx, 12h cmp [di+bx], eax ; di+5Ah detailed timing #3 jz short H1 add bx, 12h cmp [di+bx], eax ; di+6Ch detailed timing #4 jnz NODDCH1: cmp BYTE PTR[di+bx+6], MAXHZ jb NOHZ cmp BYTE PTR[di+bx+8], MAXKHZ jb NOKHZ;-------------------------------------- mov ax, 4F02h ; Switch to the requested vesamode mov bx, bp ; with an access to the linear framebuffer mov di, OFFSET CRTC ; and with an own Video-Timing(..refreshrate) int 10h cmp ax, 4Fh jnz NOMODE ; ERROR: No Vesamode;-----------------Switch to the unrealmode---------------------------------- cli ; Dissable software-Interrupts mov al, 2 ; Dissable IRQ 1 out IRQs_Port, al in al, Cmos_Port ; Dissable Non-Mask-Interrupts(NMIs) or al, 80h out Cmos_Port, al call ESEG ; Switch to the Unrealmode(Enhance segment) mov ax, DATEN mov ds, ax in al, Cmos_Port ; Enable NMI's and al, 7Fh out Cmos_Port, al sti ; Enable Software-Interrupts;-----------------------------------------------------------------------------; Create an Offset table of startadresses of any line of the linear framebuffer;----------------------------------------------------------------------------- call PIXOFF ; ...placed in the beginning of the data segment;---------------------------------------------------------------------------- finit ; Paint a ball mov DWORD PTR[XM], XPos mov DWORD PTR[YM], YPos mov DWORD PTR[COL], KreiFa mov ecx, 1 ; RadiusRUND: call KREIS ; Root-Circle lea ecx, [ecx+1] ; inc ecx sub DWORD PTR[COL], Vring; Color decreasing cmp ecx, Groesse jnz RUND;-------------------------------------- call TABELLE ; Create a sprite-table of any colored pixel of the the screen;-------------------------------------- mov si, OFFSET BALL ; Clear the screen from the ball xor eax, eax ; Color blackOBJLO: mov ebx, [si] ; Get the Offset lea si, [si+8] ; add si, 8 mov [ebx], eax ; To the screen cmp si, bp ; End of table ? jb OBJLO;-------------------------set all balls to the screen----------------------- mov si, OFFSET SX0 ; Offset of Position-Table mov di, OFFSET STEP0X ; Offset of Stepper-TableHIN: mov ebx, [si] ; Get X-Position mov eax, [di] ; Get X-Stepper mov ecx, [si+4] ; Get Y-Position mov edx, [di+4] ; Get Y-Stepper shl ebx, 2 ; X * 4 Byte (true color) shl eax, 2 ; X-Stepper * 4 Byte (true color) mov ecx, [ecx*4] ; Get line mov edx, [edx*4] ; Get Stepper-line sub ecx, DWORD PTR[PIXTAB]; Substract linear screen-Offset sub edx, DWORD PTR[PIXTAB]; Substract linear screen-Offset mov [si], ebx ; Write X back mov [si+4], ecx ; Write Y back as line lea si, [si+8] ; add si,8 mov [di], eax ; Write back X-Stepper mov [di+4], edx ; Write back Y-Step as Step-line lea di, [di+8] ; add di,8 cmp si, Anzahl*8+OFFSET SX0 jb HIN;-------------------------------------- mov edx, DWORD PTR[PICAKT]; Get the actual adress of the framebuffer;-------------------------------------- mov bx, OFFSET HINFAR ; Background color DB 0Fh, 6Fh, 7 ; MOVQ mm0, [bx];---------------------------------------------------------------------------- DB 0EAh ; Clear Prefetch-buffer: DW (OFFSET ACTION) ; The following lines create DW (SEG ACTION) ; the opcode of "JMP FAR CS:ACTION";----------------------------------------------------------------------------; M A i N - R O U T I N E;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri; Code-Alignment;---------------------------------------------------------------------------ACTION: mov ebx, edx ; Movement and checking if a ball mov ecx, DWORD PTR[PICLEN]; reached a border mov si, OFFSET SX0 ; Offset of Position-Table mov di, OFFSET STEP0X ; Offset of Stepper-Table add ebx, DWORD PTR[PIXTAB] shr ecx, 3 ; Beginning with to clear the screenCLEAN: DB 67h, 0Fh, 7Fh, 3 ; MOVQ [ebx], mm0 lea ebx, [ebx+8] ; add bx,8 dec ecx jnz CLEAN;----------------------------------------------------------------------------ALL: mov ebx, [si] ; Get X-Position cmp BYTE PTR[di+S_Len], 1 ; Compare Plus/Minus-XFlag jz short FRAGX1 ; if minus, then jumpFRAGX0: cmp ebx, Max_X * 4 ; Compare X-Position with max.-X jb short MAKEX0 ; if less, then jump mov BYTE PTR[di+S_Len], 1 ; Set Minus-XFlagMAKEX1: sub ebx, [di] ; X - XStepper jmp short ALLX;-------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;--------------------------------------FRAGX1: cmp ebx, Min_X * 4 ; Compare X-Position with min.-X ja short MAKEX1 ; if above, the jump mov BYTE PTR[di+S_Len], 0 ; Set Plus-XFlagMAKEX0: add ebx, [di] ; X + XStepper ALLX: mov [si], ebx ; save X-Position;---------------------------------------------------------------------------- mov ecx, [si+4] ; Get line cmp BYTE PTR[di+S_Len+1],1; Compare Plus/Minus-line-Flag jz short FRAGY1 ; if minus, then jumpFRAGY0: cmp ecx, Max_Y * (MaxX*4); Compare line with max.line jb short MAKEY0 ; if lesser, then jump mov BYTE PTR[di+S_Len+1],1; Set Minus-lineflagMAKEY1: sub ecx, [di+4] ; Line - linestepper jmp short ALLY;-------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;--------------------------------------FRAGY1: cmp ecx, Min_Y * (MaxX*4); Compare line with min.line ja short MAKEY1 ; if above, then jump mov BYTE PTR[di+S_Len+1],0; Plus-YFlag setzenMAKEY0: add ecx, [di+4] ; Line + linestepper ALLY: mov [si+4], ecx ; Save new line lea si, [si+8] ; Increase Table-Offset (Position) add ecx, ebx ; Line plus X mov [RETTSI], si mov si, OFFSET BALL ; Table-Offset start add ecx, edxOBJECT: mov ebx, [si] ; Get Sprite-Offset from Table mov eax, [si+4] ; Get color from Table lea si, [si+8] ; Increase Tablen-Offset mov [ebx+ecx], eax ; Color to the screen cmp si, bp ; End of Table ? jb OBJECT mov si, [RETTSI] lea di, [di+8] ; Increase Table-Offset (Stepper) cmp si, Anzahl*8+OFFSET SX0; Table-End ? jb ALL;--------------switch the screen adress using triple buffering------------ cmp BYTE PTR[FLAG], 0 jz short ASUKBSUK: mov ecx, edx ; Display-Start-Adress mov bx, 4 ; Wait until Display shedule mov ax, 4F07h int 10h and cx, cx jnz BSUK;--------------------------------------ASUK: mov ecx, edx ; Display-Start-Adress add edx, DWORD PTR[PICLEN]; Get new Adress mov bx, 2 ; Shedule new Display-Start-Adress mov ax, 4F07h int 10h mov BYTE PTR[FLAG], 1 cmp edx, DWORD PTR[PICMAX] jna short NODO xor edx, edx;---------------------------------------------------------------------------NODO: in al, Stat_Port ; Get Keyboad-Status test al, 1 ; Input buffer empty? jz ACTION ; else repeat movement test al, 20h jnz ACTION ; PS2-Mouse will be ignored;----------------------------------------------------------------------------;-----------------------End of main-routine----------------------------------;---------------------------------------------------------------------------- in al, Tast_Port ; Get key cli xor al, al ; IRQ 1 freigeben out IRQs_Port, al sti mov ax, 3 ; Text-Mode int 10h xor cl, cl ; No ERROR mov ah, 1 ; Clear Keyboard buffer int 16h;------------------------------------- DB 0Fh, 0Eh ; 0Fh, 77h EMMS // 0Fh, 0Eh FEMMS;-------------------------------------HOME: mov al, cl ; Get the ERRORLEVEL mov ah, 4Ch ; Jump back to DOS int 21h;----------------------------------------------------------------------------; ERROR Messages;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOMODE: mov cl, 1 mov dx, OFFSET ERTEX1 ; NO VESA MODEERROUT: mov ah, 9 ; Text ausgeben int 21h jmp HOME;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOLIN: mov cl, 2 mov dx, OFFSET ERTEX2 ; No linear Offset jmp ERROUT;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOMMX: mov cl, 3 mov dx, OFFSET ERTEX3 ; No MMX-CPU jmp ERROUT;--------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOVESA: mov cl, 4 mov dx, OFFSET ERTEX4 ; No Vesa jmp ERROUT;--------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOVESA3: mov cl, 5 mov dx, OFFSET ERTEX5 ; No VESA 3 jmp ERROUT;--------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NODDC: mov cl, 6 mov dx, OFFSET ERTEX6 ; No DDC jmp ERROUT;--------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOKHZ: mov cl, 7 mov dx, OFFSET ERTEX7 ; Less than 96 khz jmp ERROUT;--------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOHZ: mov cl, 8 mov dx, OFFSET ERTEX8 ; Less than 160 hz jmp ERROUT;--------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;---------------------------------------------------------------------------NOCLOC: mov cl, 9 mov dx, OFFSET ERTEX9 ; No Pixelcloc jmp ERROUT;----------------------------------------------------------------------------; GDT for the Protected Mode;---------------------------------------------------------------------------- org START + ((($-START)/64)*64)+64;----------------------------------------------------------------------------GDTZEIGER DW ? ; Lenght of the GDT DW ? ; Adress low -Word:SEGMENTE DW ? ; Adress high-Word:SEGMENTE DW 0 ; reservedSEGMENTE DW 0 ; Bits: 0-15 Seg.lenght(Bit0-15) DW 0 ; Bits: 0-15 Basis-Adress Deskriptor-Table DB 0 ; Bits:16-23 Basis-Adress Deskriptor-Table DB 0 ; Bits: 0- 7 Access rights DB 0 ; Bits: 0- 3 Seg.lenght(Bit16-19)/Bit7:1=4KByte/0=1Byte DB 0 ; Bits:24-31 Basis-Adress Deskriptor-Table;-------------------------------------------- Selektor Segmente DW 0FFFFh; Segmentlenght Bits: 0-15 -------- ----------- DW 0 ; Adress low Bits: 0-15 ¦ 08h ¦ ¦Code (CS)¦ DB 0 ; Adress high Bits:16-23 +------+ +---------+ DB 9Ah ; Access rights DB 0 ; Seg.Länge Bits:16-19 im Bit0-3 /Bit7:1=4KByte/0=1Byte DB 0 ; Seg.Adress Bits:24-31;--------------------------------------------- Selektor Segmente DW 0FFFFh; Segmentlenght Bits: 0-15 -------- ------------ DW 0 ; Adress low Bits: 0-15 ¦ 10h ¦ ¦Stack (SS)¦ DB 0 ; Adress high Bits:16-23 +------+ +----------+ DB 92h ; Access rights DB 0 ; Seg.Lenght Bits:16-19 im Bit0-3 /Bit7:1=4KByte/0=1Byte DB 0 ; Seg.Adress Bits:24-31;--------------------------------------------- Selektor Segmente DW 0FFFFh; Segmentlenght Bits: 0-15 -------- --------------- DW 0 ; Seg.Adress Bits: 0-15 ¦ 18h ¦ ¦(DS,ES,FS,GS)¦ DB 0 ; Seg.Adress Bits:16-23 +------+ +-------------+ DB 92h ; Access rights DB 0FFh ; Seg.Lenght Bits:16-19 im Bit0-3//Bit7:1=4KByte/0=1Byte DB 0FFh ; Seg.Adress Bits:24-31;--------------------------------------------------- SEGMENTE_END label WORD Gdt_Groesse equ (OFFSET SEGMENTE_END - SEGMENTE -1);----------------------------------------------------------------------------;----------------------------Subroutines-------------------------------------;----------------------------------------------------------------------------; Set for the DS(,ES,FS,GS)-Register a new segmentlenght of 00FFFFFFh.; For that we switch into the Protected Mode und back to the (Un)Realmode.;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;----------------------------------------------------------------------------ESEG: xor eax, eax mov ax, cs mov ds, ax shl eax, 4 ; EAX is now physical mov ebx, eax ; Segmentstartadresse mov WORD PTR[SEGMENTE+0Ah], ax ; into the Deskriptors mov WORD PTR[SEGMENTE+12h], ax ; for CS ror eax, 10h ; and SS store into mov BYTE PTR[SEGMENTE+0Ch], al ; the GDT mov BYTE PTR[SEGMENTE+14h], al xor eax, eax ; EAX null mov ax, OFFSET SEGMENTE ; 16-Bit-Offset add ebx, eax ; GDT-Adress in mov WORD PTR[GDTZEIGER], Gdt_Groesse; GDT-Deskriptor mov DWORD PTR[GDTZEIGER+2], ebx pushf ; Save Flags lgdt FWORD PTR[GDTZEIGER] ; Load GDT mov dx, ss ; Save SS mov eax, cr0 ; Controlword 0 to EAX or al, 1 ; Protected Mode on mov cr0, eax ; clear Prefetch-Buffer DB 0EAh ; The following lines DW (OFFSET PMODE) ; create the opcode for: DW 8 ; "JMP FAR CS:PMODE";------------------------------------------------ org START + ((($-START)/Ausri)*Ausri)+Ausri;------------------------------------------------PMODE: mov ax, 10h ; Limit SS-Selektor to 64KB mov ss, ax mov ax, 18h mov ds, ax ; Enhance DS(,ES,FS,GS)-Segment; mov es, ax ; to 4 GB; mov fs, ax; mov gs, ax mov eax, cr0 ; Controlword 0 to EAX and eax, not 1 ; Protected Mode off mov cr0, eax ; Clear Prefetch-Buffer DB 0EAh ; The following lines DW (OFFSET RMODE) ; create the opcode for:AKTSEG DW (SEG RMODE) ; JMP FAR CS:RMODE;------------------------------------------------ org START + ((($-START)/Ausri)*Ausri)+Ausri;------------------------------------------------RMODE: mov ss, dx ; restore SS popf ; get Flags;----------------------------------------------------------------------------; Swith the 21. Adressbit on.;----------------------------------------------------------------------------BIT_FREI: call W_8042 ;-->>----------+ Wait for 8042 jnz BACK ;->--------+ ¦ mov al, 0D1h ; ¦ ¦ Write command out Stat_Port, al; ¦ ¦ call W_8042 ; -->>---Ï---¦ Ready to recieve ? jnz BACK ;->--------¦ ¦ mov al, 0DFh ; ¦ ¦ Yes, set line 20 on out Tast_Port, al; ¦ ¦;-------------------------------------------¦---¦---------------; Wait til the 8042 ¦ is ¦ ¦ ready.;-------------------------------------------¦---¦---------------W_8042: xor cx, cx ;<<--------Ï---+STATUS: in al, Stat_Port;<----+ ¦ Read Status and al, 2 ; ¦ ¦ Buffer full ? loopnz STATUS ;->---+ ¦ til no or timeoutBACK: ret ;<---------+;----------------------------------------------------------------------------; Spuare Root Circle (XM,YM,COL);---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;----------------------------------------------------------------------------KREIS: mov eax, ecx mul eax ; Radius * Radius xor edi, edi ; Looping start mov esi, eax xor eax, eaxRUNDE: mov ebp, esi mul eax ; X * X sub ebp, eax ; R * R - X * X mov DWORD PTR[Y], ebp fild [Y] ; Load Integer to ST(0) fsqrt ; Spuare root fistp [Y] ; Integer save and pop mov ebp, DWORD PTR[Y] call HALB ; Set 4 Pixel mov eax, edi ; Switch X with Y mov edi, ebp mov ebp, eax ; Next Axes call HALB ; Set 4 Pixel lea ebp, [ebp+1] ; inc ebp / increase Loop-Counter mov edi, ebp ; Restore X cmp ecx, ebp ; Radiant reached ? jnz RUNDE ret;-------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;--------------------------------------HALB: mov edx, DWORD PTR[XM] ; Right below mov ebx, DWORD PTR[YM] add edx, edi ; X-Pos add ebx, ebp ; Y-Pos call PIXEL mov edx, DWORD PTR[XM] ; Left below mov ebx, DWORD PTR[YM] sub edx, edi ; X-Pos add ebx, ebp ; Y-Pos call PIXEL mov edx, DWORD PTR[XM] ; Right above mov ebx, DWORD PTR[YM] add edx, edi ; X-Pos sub ebx, ebp ; Y-Pos call PIXEL mov edx, DWORD PTR[XM] ; Left above mov ebx, DWORD PTR[YM] sub edx, edi ; X-Pos sub ebx, ebp ; Y-PosPIXEL: shl edx, 2 ; X *l 4 Byte (true color) add edx, [ebx*4] ; X plus line-Offset mov ebx, DWORD PTR[COL] mov [edx], ebx ; Color to the screen mov [edx+4], ebx ; and the pixel beside too ret;----------------------------------------------------------------------------; Create a Sprite-TABLE (Offset, Color) of the content of the screen;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;----------------------------------------------------------------------------TABELLE: mov eax, DWORD PTR[XMAX] xor esi, esi shr eax, 2 ; X divide by 4 Byte (32Bit true color) mov di, OFFSET BALL ; Table-Offset mov esi, [esi] ; linear screen-Offset mul DWORD PTR[YMAX] mov ecx, eaxMAKETAB: mov eax, [esi] ; Get the color of the pixel and eax, eax ; empty/black ? jz short LEER mov [di], esi ; Store Sprite-Offset in Table mov [di+4], eax ; Store Color in Table lea di, [di+8] ; Increase Table-Offset (add di,8)LEER: lea esi, [esi+4] ; Increase screen-Offset (add esi,4) dec ecx jnz MAKETAB mov bp, di ; End of table ret;----------------------------------------------------------------------------; Create an Offset table of startadresses of any horizontal line of the screen;---------------------------------------------------------------------------- org START + ((($-START)/Ausri)*Ausri)+Ausri;--------------------------------------PIXOFF: mov si, OFFSET MINF ; Get the Offset of Mode info xor ebx, ebx mov bx, ds ; Get the actual adress of the data segment mov eax, [si+28h] ; Get the 32 Bit adress of the linear frambuffer shl ebx, 4 ; Convert Data-Segment to a 32Bit-Offset xor di, di ; and substract it from the adress of the linear frambuffer sub eax, ebx ; = Adress of the first line is now "ds:Reg32" xor edx, edx mov dx, [si+32h] ; Get the lenght of a line (Xmax*BytejePixel) mov [XMAX], dx mov cx, [si+14h] ; Get Ymax mov [YMAX], cx shl cx, 2 ; Max_Y * 4 Byte (32Bit true color)AGAIN: mov [di], eax ; Store linear Offset of the framebuffer in the table lea di, [di+4] ; Increase Offset of table (add di,4) add eax, edx ; Add Max_X to the address cmp di, cx ; End of Table (Max_Y*4) ? jb AGAIN ret CODE ends
  18. I use a static private-IP for our Knoppix-Router (PC with two NICs and one DSL-modem booting a LIFE-CD) to become a fixed gatewayadress in our LAN. For more datails look into my: Tutorial for a Knoppix-Router I recieved a dynamic IP from my ISP for the internet. To become a new dynamic IP from my ISP i just terminate the internet-connection and login again. For the reason that DHCP is very slowly on Windows i use also static IPs for every Windows-PCs in our LAN. In the network configuration of the TCP-adapter of our Windows-PCs i add two IPs of nameserver, so we don´t need to run our own nameserver. If we change our local IPs of our Windows-Pcs, so that every Windows have an own IP for a LAN-Party, then we have to restart/reset all our switching-hubs, so all older entries in the buffer are properly removed. Using two or more switching hubs in combination: a) normal Port - crossed cable - normal Port normal Port - normal cable - Uplink-Port c) Uplink-Port - normal cable - normal Port d) Uplink-Port - crossed cable - Uplink-Port For ominous network problem with Windows XP maybe the Winsock reparation standard procedure can help: Start as administrator: Start => execute... => "cmd" netsh int ip reset ipreset.txt netsh winsock reset netsh winsock reset catalog netsh firewall reset netsh firewall set icmpsetting 8 netsh firewall set service FILEANDPRINT ENABLE SUBNET Then restart windows. Dirk
  19. I use "pppoe-discovery" to check if my dsl-modem is bound on eth0 or eth1, because my pc comes with two NICs and the bounding switch in a random wise booting a Linux LIVE-CD like Knoppix. #!/bin/sh sudo ifconfig eth0 up if sudo /usr/sbin/pppoe-discovery -I eth0 | grep -q "AC" then sudo ifconfig eth1 192.168.0.2 netmask 255.255.255.0 broadcast 255.255.255.255 up else sudo ifconfig eth1 up sudo ifconfig eth0 192.168.0.2 netmask 255.255.255.0 broadcast 255.255.255.255 up fi sudo pppd call dsl-provider Dirk
  20. Another way is to build an own executable that comes within the batchfile. One method for to do this is to put some opcodes behind echo-commands and to redirect them directly into an executable-file. (But not all opcodes and values can be echo out.) A second method is to put some hexadecimal values of opcodes (+ some debug-commands) behind echo-commands and to redirect them into a new textfile and to commit this textfile starting debug.exe. Debug get the opcodes and execute them. This example is checking how much space is free on a 2GB-drive. @echo off if not (%1)==() goto DOIT echo. echo Error !!! Please commit a driveletter. echo Example "C[:]" ! echo. exit :DOIT if (%1)==(A:) set Drive=1 if (%1)==(B:) set Drive=2 if (%1)==(C:) set Drive=3 if (%1)==(D:) set Drive=4 if (%1)==(E:) set Drive=5 if (%1)==(F:) set Drive=6 if (%1)==(G:) set Drive=7 if (%1)==(H:) set Drive=8 if (%1)==(I:) set Drive=9 if (%1)==(J:) set Drive=a if (%1)==(K:) set Drive=b if (%1)==(L:) set Drive=c if (%1)==(M:) set Drive=d if (%1)==(N:) set Drive=e if (%1)==(O:) set Drive=f if (%1)==(P:) set Drive=10 if (%1)==(Q:) set Drive=11 if (%1)==(R:) set Drive=12 if (%1)==(S:) set Drive=13 if (%1)==(T:) set Drive=14 if (%1)==(U:) set Drive=15 if (%1)==(V:) set Drive=16 if (%1)==(W:) set Drive=17 if (%1)==(X:) set Drive=18 if (%1)==(Y:) set Drive=19 if (%1)==(Z:) set Drive=1a if (%1)==(a:) set Drive=1 if (%1)==(b:) set Drive=2 if (%1)==(c:) set Drive=3 if (%1)==(d:) set Drive=4 if (%1)==(e:) set Drive=5 if (%1)==(f:) set Drive=6 if (%1)==(g:) set Drive=7 if (%1)==(h:) set Drive=8 if (%1)==(i:) set Drive=9 if (%1)==(j:) set Drive=a if (%1)==(k:) set Drive=b if (%1)==(l:) set Drive=c if (%1)==(m:) set Drive=d if (%1)==(n:) set Drive=e if (%1)==(o:) set Drive=f if (%1)==(p:) set Drive=10 if (%1)==(q:) set Drive=11 if (%1)==(r:) set Drive=12 if (%1)==(s:) set Drive=13 if (%1)==(t:) set Drive=14 if (%1)==(u:) set Drive=15 if (%1)==(v:) set Drive=16 if (%1)==(w:) set Drive=17 if (%1)==(x:) set Drive=18 if (%1)==(y:) set Drive=19 if (%1)==(z:) set Drive=1a if (%1)==(A) set Drive=1 if (%1)==(B) set Drive=2 if (%1)==(C) set Drive=3 if (%1)==(D) set Drive=4 if (%1)==(E) set Drive=5 if (%1)==(F) set Drive=6 if (%1)==(G) set Drive=7 if (%1)==(H) set Drive=8 if (%1)==(I) set Drive=9 if (%1)==(J) set Drive=a if (%1)==(K) set Drive=b if (%1)==(L) set Drive=c if (%1)==(M) set Drive=d if (%1)==(N) set Drive=e if (%1)==(O) set Drive=f if (%1)==(P) set Drive=10 if (%1)==(Q) set Drive=11 if (%1)==(R) set Drive=12 if (%1)==(S) set Drive=13 if (%1)==(T) set Drive=14 if (%1)==(U) set Drive=15 if (%1)==(V) set Drive=16 if (%1)==(W) set Drive=17 if (%1)==(X) set Drive=18 if (%1)==(Y) set Drive=19 if (%1)==(Z) set Drive=1a if (%1)==(a) set Drive=1 if (%1)==(b) set Drive=2 if (%1)==(c) set Drive=3 if (%1)==(d) set Drive=4 if (%1)==(e) set Drive=5 if (%1)==(f) set Drive=6 if (%1)==(g) set Drive=7 if (%1)==(h) set Drive=8 if (%1)==(i) set Drive=9 if (%1)==(j) set Drive=a if (%1)==(k) set Drive=b if (%1)==(l) set Drive=c if (%1)==(m) set Drive=d if (%1)==(n) set Drive=e if (%1)==(o) set Drive=f if (%1)==(p) set Drive=10 if (%1)==(q) set Drive=11 if (%1)==(r) set Drive=12 if (%1)==(s) set Drive=13 if (%1)==(t) set Drive=14 if (%1)==(u) set Drive=15 if (%1)==(v) set Drive=16 if (%1)==(w) set Drive=17 if (%1)==(x) set Drive=18 if (%1)==(y) set Drive=19 if (%1)==(z) set Drive=1a echo ecs:100>tmp.deb echo 8C C8 8E D8 8E C0 B2 %Drive% B4 36 CD 21 3D FF FF 74>>tmp.deb echo ecs:110>>tmp.deb echo 59 66 F7 E3 66 F7 E1 BF 00 02 B1 0A 66 BB 00 CA>>tmp.deb echo ecs:120>>tmp.deb echo 9A 3B 66 31 D2 66 F7 F3 04 30 66 89 D6 88 05 47>>tmp.deb echo ecs:130>>tmp.deb echo 66 89 D8 66 BB 0A 00 00 00 66 31 D2 66 F7 F3 66>>tmp.deb echo ecs:140>>tmp.deb echo 89 C3 66 89 F0 FE C9 75 D9 B9 0B 00 BE FF 01 BF>>tmp.deb echo ecs:150>>tmp.deb echo 00 02 49 46 83 F9 01 74 05 80 3C 30 74 F4 83 F9>>tmp.deb echo ecs:160>>tmp.deb echo 0A 74 07 89 CA FC F3 A4 89 D1 31 DB 3D FF FF 75>>tmp.deb echo ecs:170>>tmp.deb echo 02 31 C9>>tmp.deb echo g=cs:100 173>>tmp.deb echo n space.tmp>>tmp.deb echo w cs:200>>tmp.deb echo q>>tmp.deb debug <tmp.deb >nul del tmp.deb echo -bytes on drive %1>>space.tmp type space.tmp del space.tmp Debug manual Dirk
  21. Ups, sorry a littes mistake crapt in and i wrong sides out both terms (and i have no permission to edit my fault).Here is the correct association: dividend = dx:ax divisor = any existing register Hint: The divisor should not include the value of zero, because this will result a divide by zero error. One example for an integer division: mov dx, 0 ; high wordmov ax, 100; low wordmov bx, 5div bxThe result(20) will be stored into the ax-register. Dirk
  22. Hello HannahI and thank you for the lessons how to learn about assembly coding.But i found some little bugs inside shown below. These both commands(mnemonics) above doesn´t exist. Existing commands are: "mul cx" and "div dx"! An integer multiplication works in this example in combination with the ax-register and the register that we use with the mul-command. So we multiplicate in this example the ax-register with the cx-register. ;-- An integer division works in this example in combination with the dx-register(highword) and the ax-register(low word) and will be divide by the register that we use with the div-command. Hint: The dividend should not include the value of zero, because this will result a divide by zero error. divisor = dx:ax dividend = any existing register Dirk
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.