--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA500010Date: 06/04/97 From: BRIAN MCCLOUD Time: 07:35am \/To: BRAD WHEELER (Read 2 times) Subj: Uses BW>Not to sound ignorant on programing because I have experiance in both BW>basic , and c++, but what type of projects would assembler excell at BW>over other programming languages? I know that assembler gives you BW>complete control over what you want, but what are some of its other BW>advantages? Any answers would be appeciated. Thanks. Certain things, particularly graphics, can be immensely speeded up when written in assembly language... for example, if you look into high-level language graphics routines, you'll find that 1. they probably have some comparisons to determine what video adapter is present, and 2. they won't translate very well from the assembly/disassembly code to the high-level language. If you write your own graphics routines in assembly language, you can make your own functions, and if you're only using it on your own omputer, you can make it adapter-specific and not worry about checking to make sure it's run on the right adapter... ((Cloud)) MauveCloud@juno.com * OLX 2.2 * A school: Building with four walls and tomorrow inside. --- PCBoard (R) v15.3/M 10 * Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00000Date: 06/05/97 From: MARIUS BENDIKSEN Time: 08:21pm \/To: FLORIAN SCHAEFER (Read 2 times) Subj: Creating my own OS > Hi Marius, >> That is *also* possible. The 80386+ architecture does support the >> ability to allocate ports as memory. > Hey! That sounds interesting! Do you have any documentation or some hints > about doing that? Check out the intel technical documentation. (Available from the web, ftp and most good programming-BBS's) --- BBBS/NT v3.33 How-D * Origin: Circle of Protection - +47 55961259 (2:211/37) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00001Date: 06/04/97 From: BRIAN MCCLOUD Time: 08:51am \/To: JON GENTIL (Read 2 times) Subj: HELP! 1/2 JG>Ok, here's the code. I'm trying to write a TSR that pops a little message up JG>for a brief moment that says "RING" at the upper-left corner. But I can't JG>quite get it right. Mangle it so that it works. :) JG>I'm trying not to use the stack at all. I'm a beginner, and use TASM 5.0, bu JG>don't have any of the books for it. (Got it at a garage sale) JG>.model tiny JG>.code JG>org 100h JG>START: JG> MOV AX, CS ;SET DS=CS w/out using stack JG> MOV DS, AX JG> MOV AH, 35h ;Function 35 GetIntAddress JG> MOV AL, 1Ch ;of Int 1C (Timer) JG> MOV OldInt1CSegment, ES ;Save JG> MOV OldInt1COffset, BX ;Save This doesn't do much unless you insert an INT 21h before you save the old segments... also, since this is a com file, it automatically starts with CS=DS=ES... you only need to make sure in the TSR part that you save ds, and restore it at the end. JG> MOV AH, 25h ;Function 25 SetIntAddress JG> MOV AL, 1Ch ;of Int 1C (Timer) JG> LEA DX, THETSR ;Beginning of TSR JG> INT 21h ;GOforit JG> MOV AH, 31h ;Function 31 (TSR) JG> MOV AL, 0h ;ErrorLevel 0 JG> MOV AX, OFFSET THEENDOFPROG ;Paragraph conversion???? No clue JG> MUL WORD 16 ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I don't know how you manage the MUL WORD 16, but when you do a MOV AX, something, you lose what you put into AH and AL before. Try like this: MOV AX, 3100h MOV DX, OFFSET THEENDOFPROG SHR DX, 4 ; this is the number of paragraphs to keep resident. JG> INT 21h ;Terminate and Stay Resident JG>THETSR: ;The Acutal Stuff JG> MOV AH, 03h ;Function 3 (Check serial status) JG> XOR AL, AL ;Clear AL Hold on a minute here! If this is supposed to be a timer interrupt, you've got to SAVE all the register you change, and restore them at the end. (except CS, IP, and flags which are automatically pushed by an interrupt). You can either add data to hold them in the code segment (you'll need to use CS:) or push the registers... Also, couldn't you just make the above a single MOV AX, 0300h? JG> MOV DX, 01h ;COM2 JG> INT 14h ;GO! JG> TEST AL,01000000b ;See if RingIndicator is on JG> JE RINGING ;If So, it's ringing! You want to do the opposite here... this jump will go if bit 6 is turned OFF... try changing this to a JNZ. JG> CALL FAR [OldInt1CSegment]:[OldInt1COffset] ;?????? Call old INT1C JG>;SYNTAX? I really have no idea. The trick here is to store the offset first, and consider it a single pointer... CALL FAR PTR CS:[OldInt1CPtr] JG> IRET JG>RINGING: JG> MOV AH, 03h ;Get Cursor Position JG> MOV BH, 00h JG> INT 10h JG> MOV CursPos, DX ;And save it. Hold on a minute here! Can't do it that way! This assumes DS=CS which is ot necessarily the case. You have to either 1. Save the caller's DS, then copy CS into it, or 2. force the use of CS here. JG> MOV DL, 00h ;Inefficient way, probably, of saving JG> CALL SAVECHAR ;the first 4 chars so that I don't JG> MOV Char1, AX ;just overrite it all. JG> MOV DL, 01h JG> CALL SAVECHAR JG> MOV Char2, AX JG> MOV DL, 02h JG> CALL SAVECHAR JG> MOV Char3, AX JG> MOV DL, 03h JG> CALL SAVECHAR JG> MOV Char4, AX I know of a much faster way to save 4 characters (will give more regs. to save)... MOV AX, 0B800h ; direct video memory access MOV ES, AX XOR DI, DI MOV AX, CS ; make sure DS = CS, unnecessary if you've done so MOV DS, AX ; earlier in the interrupt MOV SI, OFFSET Char1 MOV CX, 4 REP MOVSW JG> MOV AX, 5207h ; And write the RING in... JG> CALL WRITECHAR JG> MOV AX, 4907h JG> CALL WRITECHAR JG> MOV AX, 4E07h JG> CALL WRITECHAR JG> MOV AX, 4707h JG> CALL WRITECHAR Four calls to int 10h??? All you need to do is a write string... something like this: MOV AX, CS MOV ES, AX MOV AX, 1300h MOV BX, 0007h MOV CX, 0004h XOR DX, DX MOV BP, OFFSET RingStr INT 10h That works on all EGA and later... you could also use a REP MOVSW as efore... however on a CGA, you'd probably want to do a little bit of snow checking... But I think if you used this many Int 10h calls, you'd have the interrupt backing into itself in reentrancy problems... int 10h is one of the SLOWEST known ways of accessing video memory... for mode switching it's ok, but for graphics or text, it's too slow. JG> NOP ;minor delay JG> MOV AX, Char1 ;replace old chars JG> CALL WRITECHAR JG> MOV AX, Char2 JG> CALL WRITECHAR JG> MOV AX, Char3 JG> CALL WRITECHAR JG> MOV AX, Char4 JG> CALL WRITECHAR JG> CALL FAR [OldInt1CSegment]: [OldInt1COffset] ;?????? Call old INT1C JG>;again, no idea. :( JG> IRET This can be done as a rep movsw, and a CALL FAR PTR CS:[OldInt1CPtr]. >>> Continued to next message * OLX 2.2 * OXYMORON - Ferringi Research Vessel --- PCBoard (R) v15.3/M 10 * Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00002Date: 06/04/97 From: BRIAN MCCLOUD Time: 08:51am \/To: JON GENTIL (Read 2 times) Subj: HELP! 2/2 >>> Continued from previous message JG>SAVECHAR: JG> MOV AH, 02h JG> MOV BX, 00h JG> MOV DH, 00h JG> INT 10h JG> MOV AH, 08h JG> MOV BH, 00h JG> INT 10h JG> RET JG>WRITECHAR: JG> MOV BH, 00h JG> MOV BL, 0F7h JG> INT 10h JG> RET These two are very slow, and use the stack... not only do you have near CALLs to slow it down, you have multiple calls to int 10h... My suggestion to peed this up is to use some REP MOVSWs, and eliminate most of the near CALLs... also when you call the old Int 1C, you'll have to do a PUSHF before, since he IRET at the end of the previous interrupt routine will try to pop flags off the stack after it pops CS & IP. Another trick you might try is this: when you want to go back to the old Int 1C, do this: PUSH CS:[OldInt1COffset] PUSH CS:[OldInt1CSegment] RETF Then you'd let it do the IRET part, and it would think it was called directly from the program, rather than from your interrupt. OldInt1CPtr: JG>OldInt1COffset DW ? JG>OldInt1CSegment DW ? JG>Char1 DW ? JG>Char2 DW ? JG>Char3 DW ? JG>Char4 DW ? JG>CursPos DW ? RingStr: DB "RING" JG>THEENDOFPROG DB ? JG>END START * OLX 2.2 * OXYMORON - Ferringi Research Vessel --- PCBoard (R) v15.3/M 10 * Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00003Date: 06/04/97 From: BRIAN MCCLOUD Time: 08:51am \/To: JON GENTIL (Read 2 times) Subj: Ringer 2.0 JG>Hello All! JG>This is the second posting of this program, and it works fine now, until t JG>starts to ring. It locks the computer up... That doesn't surprise me. Your three biggest problems are still there: 1. You're assuming DS will stay the same, which is NOT necessarily true, especially in a timer interrupt. 2. You're not saving any of the registers you use... a timer interrupt is often called from the middle of a program, which expects the registers to tay the same... only interrupts which are never caused by the hardware can skip saving the registers. 3. You're using int 10h calls for single characters, which is too slow for se in the timer interrupt... see my previous message re using REP MOVSW JG> MOV DX, OFFSET ENDOFPROG+1 JG> int 27h ; terminate stay resident My "PC Interrupts" book (by Ralf Brown & Jim Kyle) lists this as an obsolete call... it suggests using int 21h function 31h instead (DX is the number of 16-byte paragraphs to keep, so you can just do a SHR DX, 4 (if smart code generation is turned on, it'll automatically assemble as 4 SHR DX, 1 instructions in 8086 mode) * OLX 2.2 * Bureaucracy: That place always in need of a laxative. --- PCBoard (R) v15.3/M 10 * Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00004Date: 06/02/97 From: STUART GEORGE Time: 01:50pm \/To: GLENN VERDINS (Read 2 times) Subj: BootSector!!! [ Glenn Verdins muttered to All ] GV> Does anyone have any specs for the bootsector on a disk? i tried to GV> copy a program to A: like this: GV> Debug file.com GV> W 0 0 0 1 GV> q remember the bootsector runs with an IP at 0000:7C00h, not 0100h. GV> (that is not real specs, i need specs, it'd be nice if they were set GV> out like that. GV> thanks in advane.. specs, hmm i have em, i'll post em on private comms barrier mail save merlins phone bill :) -df : Juukinzoku Game Development http://acm.vt.edu/~dpark/juukinzoku --- Blue Wave/RA v2.30 * Origin: Comms Barrier BBS +61.3.9585.1112, +61.3.9583.6119 (3:632/533) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00005Date: 06/01/97 From: FILIP HEREMANS Time: 05:27pm \/To: ALL (Read 2 times) Subj: Emulating Drive Hello All! I want to "emulate" a drive : I need a device driver which installs a drive under DOS or Win95 and which can create a directory tree. When a directory is accessed, some strings should be send to a serial port. A lot of hardware-companies offer this kind of drivers e.g. for a Cd-changer, a tapestreamer,etc. All docs,source-codes,WWW-addresses,etc. are welcome ! Thanx, Filip --- FMail/386 1.0g * Origin: 80X86 BBS 32-15-24.62.32 28800bps (24h/24h) (2:292/516.14) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00006Date: 06/04/97 From: MARTIN PREUSS Time: 02:58pm \/To: TOM ST DENIS (Read 2 times) Subj: Re^2: INT 06 - Invalid Opcode Tom liess am 03.06.97 zum Thema "Re: INT 06 - Invalid Opcode" folgendes verlauten: MP>> What modes do the pentium offer that an 486 doesn't ? >Do you know what Paging Enabled means? Do you know what a Page Table and >Page Directory are? Well at any rate, paging (memory) is used to create >virtual memory (or defragment memory...), on the 386 and up the default page >size is 4KB, but on the 586 you can make it 4MB... I know paging very well as I am writing a dpmi host now. Would you please tell me more about changing the default size of pages ? I can't imagine how it works. read'ya mp e-Mail: m.preuss@whvserve.de FIDO: Martin Preuss@2:2426/5060.62 --- Krosspeunt 3.11 * Origin: Break in 20 (2:2426/5060.62) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00007Date: 06/05/97 From: TOM ST DENIS Time: 08:40pm \/To: MARTIN PREUSS (Read 2 times) Subj: Re: INT 06 - Invalid Opcode MP> What modes do the pentium offer that an 486 doesn't ? The 586 (late version) supports a 4MB page size, whereas the 386+ support 4KB page size only... --- GEcho 1.00 * Origin: 872's Home Bbs (613)831-3390 (1:163/133) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAA00008Date: 06/05/97 From: TOM ST DENIS Time: 11:36pm \/To: ALL (Read 2 times) Subj: TRAN I was wondering if anyone knows anything about Trans PMODE extenders? (Specifically version 2.51 and 3.07) I would use 2.51 for simple demos and games that use 32-bit mode and 3.07 for making extenders... Does anyone know any programming tricks for using these extenders (which rock!) (P.S i was using 2.1232 before i switched to 2.51. Is their any diff. etween them two (2.1232 and 2.51)?) Thanks, Thanks Tran for those cool extenders!!! --- GEcho 1.00 * Origin: 872's Home Bbs (613)831-3390 (1:163/133)