--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA200011Date: 05/26/97 From: BRAD WHEELER Time: 04:08pm \/To: ALL (Read 2 times) Subj: Uses Not to sound ignorant on programing because I have experiance in both basic , and c++, but what type of projects would assembler excell at over other programming languages? I know that assembler gives you complete control over what you want, but what are some of its other advantages? Any answers would be appeciated. Thanks. --- Big Ted 1.2 for Wildcat/5 [unregistered] * Origin: Nightwatch BBS -- Erie, PA USA (814) 866-9451 (1:2601/569) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300000Date: 06/02/97 From: MERVYN BALDWIN Time: 03:07am \/To: ALL (Read 2 times) Subj: Re: implode (cls) From: Mervyn Baldwin Subject: Re: implode (cls) > >From: jvahn@short.circuit.com (James Vahn) > >Jeff Brielmaier wrote: >> A better location is 0EDh. In fact, it is used within (a BIOS code). >out 4Fh,al is a solution to the jmp $+2 problem and I've tried it on dog >slow, slow, and fast machines; it's worked very well. I haven't tried it >on a 8088, 8086 or 80586+. I have a note suggesting use in IN al,61h (presumably in a loop). "Port 61h="Port B". Reading from it has no unusual effects (e.g. clearing INTs) [that's what note says] so it's safe to use it any time. A tidy,safe way of generating a delay of about 1 Microsec [maybe that's Picosec]. Exact delay depends on waitstate settings". I have never tried it - always found OUT 04F,AL to be satisfactory. -- vyn@abaldwin.demon.co.uk | The home of Net 346 Services --- * Origin: (1:346/100) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300001Date: 06/02/97 From: DAVID KIRSCHBAUM Time: 10:53am \/To: GREG CHAPMAN (Read 2 times) Subj: Disassemblers > When I moved to a PC I never really got into programming (not > beyond .BAT files anyway!). Now I want to have a go again. > I'm looking for a reasonable freeware disassembler to cut my > teeth on. It doesn't have to have all the bells and whistles > possible. At this stage I'm just looking to work out what > happens in some of those few hundred byte utilities that PC > MAGAZINE was so good at producing five years back. I'd strongly suggest good old ASMGEN (available from any of the SimTel archives disasm asmgen3.zip 73K 901123 Generate assembly code from COM and EXE's disasm asmgsq11.zip 12K 941127 Makes .SEQ file for ASMGEN disassembler Now this is not an interactive disassembler. You go through the little .COM program with DEBUG or SYMDEB or something and identify the different types of data (code, data, strings). Then you build a script (.SEQ file) that ASMGEN uses to disassemble the target file. Output is a very nicely formatted .ASM file. Regrettably, the documentation really sucks. But I continue to regularly use it for .COM files. As you say, I used to use it all the time to disassemble some little utility that was really really nice, but was maybe a little buggy or didn't _quite_ do what I wanted. I used to post such disassemblies (and my tweaks) to SIMTEL20 all the time. The ASMGEN process can get very tedious for larger programs (and for most .EXE files), so I usually only used it for the small (let's say, under 3K) .COM programs. But it would work for larger ones, even for C compiler output! There are other disassemblers out there (ID, IDA, MD86) (all in the same disasm subdirectory), but I've never had much luck with them. Nor have I had much luck with the (expensive!) SR Sourcer commercial disassembler. It's particularly braindead about C jump tables, multiple segments; wants to drop into data mode all the time; its version of script files is absolutely _horrendous_; etc., etc. > The Z80 disassemblers I recall using had two particular > features I am looking for. They would produce sets of EQU > statements with the initial digit of addresses substituted with > a letter (I for 1, J for 2 etc) in order to produce labels > which could easily be converted to something more meaningful > and the ability to define address ranges to be disassembled as > DB and DW sequences. ASMGEN produces lables like "L100" where the numeric value is the hex offset. In .COM programs this insures a unique value. And yes, you can designate data as bytes, words, dwords, even structures! It's smart enough to produce "xxx dup(0)" for repeated data too! The trick is in getting the .SEQ script file correct. I quite often take a first cut, check out the .ASM output, find where I missed data (or thought code was data), make some corrections to the .SEQ file, and run ASMGEN again. It's _very_ fast, so that's no problem. Oh .. it has the ability to produce different .ASM formats, one of which has the original hex as comments. But I hate that. Oh .. and every jmp, call, and data element also has cross-references, showing all the _other_ addresses that called it! Very very nice program .. and its source is available! Free! > Can anyone suggest anything which I could FREQ from a UK site? > Greg So check out the SimTel archives and mirrors; they're all over. ftp.simtel.net /pub/simtelnet/msdos or www.simtel.net Or do a search of "simtel". I'll post an example of ASMGEN's work separately. David Kirschbaum Toad Hall --- * Origin: Toad Hall (1:3634/2.4) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300002Date: 06/02/97 From: DAVID KIRSCHBAUM Time: 11:01am \/To: GREG CHAPMAN (Read 2 times) Subj: Disassemblers Target was a little .COM file called CHMOD, changed file attributes. (Hey, back in them days we didn't have ATTRIB, had to do it ourself.) Here's the .SEQ file I produced after studying CHMOD.COM in DEBUG: 100 /t ;No object code as comments in .ASM file 100 /h ;Hex numbers with 'H' suffix 100 c ;code starts here (.COM file) 103 w ;word data right after the initial JMP 10B s ;strings 238 w ;back to words 338 c ;back to code again That was painless, eh? Then I ran ASMGEN against CHMOD.COM ASMGEN CHMOD.COM CHMOD.ASM Here's the edited, documented product. _I_ wrote the comments and notes, removed the excessive references, changed the L100 labels to something humanly understandable, etc. etc. But ASMGEN did all the disassembly, spelled out the text, etc. etc. In this early work I didn't bother to make all the PROCEDURE and ENDP stuff that I started to do later on. Thus the "RET_NEAR" macro that ASMGEN produced is still throughout the code. TITLE CHMOD 1-27-86 [5-28-87] RET_NEAR MACRO db 0C3H ENDM ; .RADIX 16 LF EQU 0AH CR EQU 0DH ; Code SEGMENT ASSUME DS:Code, SS:Code ,CS:Code ,ES:Code ORG $+0100H L0100: jmp Start Attr_Table dw 0057H,0152H,0248H,0453H ; W R H S NoMatchMsg db 'No match found' ;xref L0119 L0422 di Buff119 db ' ' HelpMsg db 'Change file mode (attribute).',CR,LF db 'Usage is:',CR,LF db 'chmod [d:][pathname]filename[.ext] [rwhs]',CR,LF db ' where sets file attribute to',CR,LF db ' r = read only',CR,LF db ' w = read / write (normal mode)',CR,LF db ' h = hidden',CR,LF db ' s = system',CR,LF db '$' CrLf db CR,LF db 90H Buff238 dw 8 DUP(00) dw 78H DUP(00) ;L0248 Start: mov dx,offset Buff238 mov ah,1AH int 21H xor ch,ch ;clear msb mov cl,DS:80H ;cmd line length cmp cx,1 ;any cmd line? jle TellHow ;give help, die dec cl ;adjust length mov al,' ' ;gobble spaces cld mov di,82H ;point to cmd line repnz scasb jcxz Skp357 ;none dec di ;adjust cmd line ptr Skp357: xor al,al push di stosb ;make cmd line an AsciiZ string xor bx,bx jcxz Do_FindFirst Lup35F: push cx push di ;remember cmd line pointer mov al,[di] ;snarf char and al,0DFH ;uppercase? mov cx,8 shr cx,1 ;8*2 mov di,offset Attr_Table ;scan the attrib table for match ;Scan attribute table for a match from cmd line Lup36D: scasb ;match R W H S? jnz Skp374 ; no match mov bl,1 ;flag we'll be SETTING attribs add bh,[di] ;remember rel offset Skp374: inc di ; next attrib loop Lup36D pop di ;restore cmd line pointer pop cx inc di ;bump to next attrib char loop Lup35F ; and test it pop di ;restore cmd line start mov cx,di ;into cx sub cx,82H ;adjust for offset in FCB ;check for switch chars, drive separator Lup383: cmp BYTE PTR [di-1],'\' jz GotName cmp BYTE PTR [di-1],'/' jz GotName cmp BYTE PTR [di-1],':' jz GotName dec di ;keep backing up in cmd buffer loop Lup383 GotName: mov bp,di ;remember where cmd line pointer is ;we now have a file name Do_FindFirst: mov ah,4EH ;find first file call FindFile jb Say_NoMatch ;didn't find, go say no match and terminate cmp bl,0 ;setting attrib? jz Skp3A9 ; nope call Set_Attr ; yep, go set attrib for this file Skp3A9: call ShowFile Lup3AC: mov ah,4FH ;find next file call FindFile jb Terminate ; no more, end it cmp bl,0 ;setting attrib? jz Skp3BB ; nope, getting it call Set_Attr ;go set attrib for this file Skp3BB: call ShowFile jmp short Lup3AC ;Loop back TellHow: mov dx,offset HelpMsg mov ah,9 ;Display string int 21H Terminate: mov ah,4CH ;Terminate Process int 21H Say_NoMatch: mov dx,offset NoMatchMsg mov bx,2 ;file handle 2 (std error?) mov cx,0EH ;14 bytes mov ah,40H ;write to file or device int 21H jmp short Terminate ;Used to Find First or Find Next FindFile: mov dx,82H ;AsciiZ string in FCB mov cx,6 ;Attrib to search for int 21H RET_NEAR Set_Attr: mov si,offset Buff238 add si,1EH ;bump to next file name mov di,bp ;refresh cmd line pointer mov cx,0DH ;13 chars cld repz movsb ;move 13 bytes mov dx,82H ;filespec in FCB mov al,bl ;0=get, 1=set attribs in cx mov ah,43H ;get/set file attribs mov cl,bh ;attribs int 21H mov di,offset Buff238 mov [di+15H],cl ;remember attribs here RET_NEAR ;Display file name and attributes ShowFile: push bx mov di,offset Buff238 add di,1EH ;bump in a little push di ;remember address push di xor al,al ;get a 0 cld mov cx,0FH ;scan 15 bytes repnz scasb ;scan for a 0 pop cx ;buff address neg cx add cx,di ;nr of bytes to write pop dx ;buffer addr mov bx,1 ;file handle (screen) mov ah,40H ;write to file or device int 21H push dx ;remember address mov dx,offset Buff119 neg cx add cx,14H ;next file name? mov ah,40H ;write to file or device int 21H pop dx ;restore address mov di,offset Buff238 mov cl,[di+15H] push dx ;preserve address mov dl,'R' ;display "R" mov ah,2 ;display char int 21H mov dl,'W' ;write? test cl,1 ;test Write bit jz Skp445 ; yep, "W" mov dl,'-' ; nope, dash Skp445: mov ah,2 int 21H mov dl,'H' test cl,2 ;test Hidden bit jnz Skp452 mov dl,'-' ; nope, not hidden Skp452: mov ah,2 int 21H mov dl,'S' ;assume System test cl,4 ;test System bit jnz Skp45F ; yep, System mov dl,'-' ; nope, not System Skp45F: mov ah,2 int 21H pop dx call WriteDev pop bx RET_NEAR WriteDev: mov bx,1 ;handle mov cx,2 ;nr of bytes to write mov dx,offset CrLf ;CR/LF mov ah,40H ;write to file or device int 21H RET_NEAR Code ENDS ; END L0100 --- * Origin: Toad Hall (1:3634/2.4) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300003Date: 06/02/97 From: DAVID KIRSCHBAUM Time: 11:05am \/To: DANIEL MORENO (Read 2 times) Subj: New here > Hola All!! > Well... that's my first message in this area... uhm... > wel... the second > one. O:) > It's the first time i write in an international area and my english s > not really good... but... I'm from Spain and I like ASM very much. hm... > I don't know what else to say... I hope i'll be able to help... and... > NOORRLLL!!!! It's 5 to 9!!!! I HAVE TO LEAVE!! I'LL BE LATE!!! Sorry... > | Saludetes de ComaC, Welcome and salud! Glad to have you here, and even more glad your english is so good. My 6 weeks of Spanish, crammed into me in the Army, didn't stick very well :-( Enough to usually translate .ASM labels and comments though :-) There used to be some real good code from a professor down in Mexico City that I used to admire all the time; sometimes his stuff was a mixture of English and Spanish :-) Anyway, welcome! --- * Origin: Toad Hall (1:3634/2.4) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300004Date: 06/02/97 From: JOONATAN KAARTINEN Time: 06:13pm \/To: JERRY COFFIN (Read 2 times) Subj: Just a quick one :) -=> Black Lightning Strikes thru: Jerry Coffin <=- JC> be needed for your purposes. However, I have to admit that I'm a bit JC> surprised that TP doesn't have a built-in procedure for this. Most TP has a procedure that will do that, but some people (like me) want to their own procedures to replace some functions. I do it because I want to speed up the code. I don't know why John doesn't use the built-in procedure. - Black Lightning --- BBBS/2 v3.33 How-C * Origin: Checkpoint * Ivalo, Finland, +358-16-663812, V34/ISDN (2:229/222) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300005Date: 05/31/97 From: BENJAMIN L MCGEE Time: 10:12am \/To: DENIS BOYLES (Read 2 times) Subj: TIMER TUTORIAL BLM> Does anybody here have access to a good tutorial for the BLM> Programmable Interval Timer... DB> You can try the PIC.TXT file contained in the PC Game Programmers DB> Encyclopedia. (PCGPE10.ZIP) That's just what I'm looking for, now I hope my local BBS has that file. thanx DB> BTW: Did you get my code compile sprite posts? (just wondering) Yes I did, thank you. I haven't had a chance to implement any of those techniques myself yet, but I saved your code and am writing a code compiled sprite editor whenever I'm not working on the several hundred other things that I'm working on. *He does the work of 3 men. Moe, Larry & Curly blm --- FLAME v1.1 * Origin: Purgatoire BBS, 719-846-0140, Trinidad, CO, V.34 (1:15/7) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300006Date: 05/30/97 From: KURT WISMER Time: 04:09pm \/To: FLEMMING SONDERGAARD (Read 2 times) Subj: Creating my own OS -=> Mocking Flemming Sondergaard to Josh Fisher <=- FS> The fact of the matter is that the PC is a lousy, no-good FS> architecture. The alternatives are so much better. What makes you think FS> the PC will endure? same reason microsoft oses endure in the face of superior oses... widespread exposure and continuous aggressive marketing... ... incest... a game the whole family can play... --- TGWave v1.20.b09 * Origin: fks Online! * Ontario, Canada * (905)820-7273 * (1:259/423) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300007Date: 06/02/97 From: SYLVAIN LAUZON Time: 09:28pm \/To: TOM TORFS (Read 2 times) Subj: huffman would you send me the C code for uuencode sheme please. or the specification --- * Origin: Silicon Palace {514}432-2953 Lafontaine, Qubec (1:242/100) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EA300008Date: 06/03/97 From: TOM ST DENIS Time: 06:06am \/To: MARTIN PREUSS (Read 2 times) Subj: Re: INT 06 - Invalid Opcode 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 age 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... hope that helps... --- GEcho 1.00 * Origin: 872's Home Bbs (613)831-3390 (1:163/133)