--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00029Date: 02/08/97 From: TED MENKS Time: 11:48pm \/To: NICK COONS (Read 4 times) Subj: SHL. Hi Nick, (80XXX, Thursday February 06 1997 13:52) Nick Coons to James Ranson about: SHL. >> NC> temp dd ? >> NC> mov [temp], dx:ax >> NC> shl [temp],9 >> NC> mov dx:ax, [temp] >> It might be possible in 386+ assembly. However, I am pretty >> sure you cannot do that on a 16 bit processor. NC> Assuming the above is valid, why it not be available on a 16-bit NC> processor? It doesn't use any 32-bit code or 32-bit registers. It ooks NC> 16-bit compatible to me. Sorry, Nick, but I think dx:ax looks like a 32-bit register-pair. It isn't like a simple register, but it definitely holds a 32-bit value as you pointed out yourself earlier in this thread... The line `mov dx:ax, [temp]' would therefor have to move a 32-bit value, which a 16-bit machine isn't capable of. Bye, Ted. E-mail: ted.menks@mbs.nl Fido : 2:284/412.51 --- THaT's It BBS --- * Origin: Point 51 of Mail Board Son, Eindhoven Holland (FidoNet 2:284/412.51) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00030Date: 02/10/97 From: CRAIG HART Time: 08:36am \/To: JOE KOSS (Read 4 times) Subj: SHL. Hi.. JK> > Note that this only works for unsigned numbers, since there is no JK> > rotate-arithmatic instruction... RAL would have been nice :-) JK> Exactly what would RAL do that ROL doesn't? Allow you to rotate signed numbers, without losing the sign-bit. JK> The concept of ROLL and Arithmetic Shift are contrary to each other JK> .. ROLL? I don't recall mentioning anything to do with ROLL?? Perhaps you mean ROL? If you are trying to say that ROL and arithmetic shift are contrary, well yes they are.. THAT was my entire point. Lack of arithmetic shifts my whole point. It would be nice to have RAL (and RAR) so that you can perform all the code optimizations that SHL and SHR provide for unsigned numbers on signed numbers too, without extra code to manage the sign-bit. Craig --- FMail/386 1.0g * Origin: Comms Barrier BBS +61.3.9585.1112, +61.3.9583.6119 (3:632/533) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00031Date: 02/11/97 From: IAN MOOTE Time: 12:08am \/To: NICK COONS (Read 4 times) Subj: .COM vs. .SYS -> What's the difference between a .COM file and a .SYS file (such as a -> driver loaded as DEVICE= ). Does it use ORG 0h as opposed to ORG -> 100h, for example? Assuming that you're refering to the standard usage of the Dos ".Com" and ".Sys" file extensions, both are memory image files, but you're correct, one ORiGinates at 0000h and the other at 0100h. Also, assuming your .Sys file is a Dos device driver, there is also a header involved. Take care. ** Beta testers go where angels fear to tread. --- PCBoard (R) v15.3/M 5 * Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00032Date: 02/11/97 From: IAN MOOTE Time: 12:08am \/To: NICK COONS (Read 4 times) Subj: 486 MOV. -> What's a NOP? ??? ** Better smeg than dead. --- PCBoard (R) v15.3/M 5 * Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00033Date: 02/11/97 From: IAN MOOTE Time: 12:08am \/To: KEVIN BARROW (Read 4 times) Subj: Drive Listing. -> JG> ; DISABLE.COM - Prevents DOS from recognizing a drive -> AHHHHHHHHH!!!!!!! NO!!!!!!!! Can you please uuencode me Your Copy or -> A86 or some public domain or whatever version that will compile this? -> Cuz like well All I have is the arrosoft assembler and I can't get my -> hand on the A86 assembler.. And I have tried convering A86 to MASM -> w/o success.. So well I need help =) ??? You've tried without success??? Kevin. An integeral part of programming is knowing how to use your tools. I know that Arrow comes with precious little documentation but it uses standard Masm syntax. Go down to the library and sign out a book on how to use Masm. Arrow is a very good assembler, but that does you no good if you don't know how to use it. The reason I'm so surprised that you've tried this is because of how easy it is to convert A86 code to standard Masm: ASSUME CS:CODE, DS:CODE, SS:CODE, ES:CODE CODE SEGMENT ORG 0100H START: jmp short main . . . all of john's code goes here . . . CODE ENDS END START Masm is an assembler for novices and requires a lot of administrative overhead that is un-necessary when using an advanced assembler such as A86. Let's go through each line one at a time: ASSUME CS:CODE, DS:CODE, SS:CODE, ES:CODE This just initializes our segment registers to known values, which in this case is are all pointing to the same segment, labled "CODE". "Assume" is a requirement for Masm programs because it can't figger out on its own that our program has only one segment... CODE SEGMENT Masm forces you to segment your code. The Masm philosophy is that all programs, regardless of size and complexity, >must< consist of many segments of varied contents and therefore forces you to explicitely declare each segment, even if you only have one. All segments must begin with a SEGMENT directive in Masm source files. Our particular segment is labled "CODE". Notice the correlation between the name of this segment and the name of the segment in the ASSUME statement. ORG 0100H You know what the "ORiGin" statement is for. This is not a >required< statement, but we need this because you'll probably want to convert the program later to a .Com file. (Masm is apparently incapable of producing memory image files. Something to do with its complex multi-segmentation philosophy.) START: jmp short main If you're going to be converting this program to a .Com file then you've got to lable the first instruction in your program otherwise Masm can't figger out where to start the program. Because Masm is an amateur's assembler it can't figger out that we will want to start our program running at the first instruction in the code segment. CODE ENDS This is the End Segment directive. It tells Masm not only that we've reached the end of a segment, but which segment we're ending. This is a required statement. END START The End statement tells Masm that the end of the input file has been reached. Presumeably Masm can't figger this out for itself either. Actually, the End statement serves a dual purpose because this is where we tell Masm the initial starting address of our program. While most people want to start their programs at the beginning, I suppose someone, somewhere, might want to start his program running somewhere in the middle... I dunno, it's a Russian thing I think... Also, make sure that all of the hex values are followed by the requisite "H", such as "024h". A86, for some reason which I don't understand, assumes that values beginning with a "0" are hexidecimal. Make the above changes to John's code and I'm sure Arrow will assemble it. Whether it runs or not is between you and John. I can tell you what you need to do, but I don't actually have the time to dig out Arrow or A86 or whatever and try it for myself. Now remember, the problem here isn't with Arrow, A86, or Masm. Assembly language is assembly language, anything else is simply compiler overhead. >You< should be able to take any code from any assembler and, with minor (if not logical) modifications such as those above, run it through your assembler -- but you first have to know how to use >your< assembler. Learn to use your tools. It doesn't matter what assembler you use, but you do have to learn how to use it effectively. Take care. Ian (just a novice) Moote. ** Being a pain in the ass is a perogative of the creative mind --- PCBoard (R) v15.3/M 5 * Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00034Date: 02/11/97 From: IAN MOOTE Time: 12:08am \/To: RENE HERMAN (Read 4 times) Subj: HELLOWIN -> As I recall someone asking for a Windows application in assembly -> language, and as I had some (lots) of trouble to get my first asm -> application up and running, I thought I'd share my efforts. Maybe -> someone's interested. I'm definitely interested! Thanks for the posting, Rene -- it was greatly appreciated! I can't wait to go over it and show it to my students -- we just did Hello World under Dos! [:DDD Take care! Ian (you can't do that in assembly) Moote. ** Beauty is in the eye of the beer holder. --- PCBoard (R) v15.3/M 5 * Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00035Date: 02/11/97 From: IAN MOOTE Time: 12:08am \/To: ED BEROSET (Read 4 times) Subj: I was wrong. ** Originally poste 06 February. Reposted due to local ** mail disruption. Ed, I owe you a really big apology. Six months ago I accused you of lying when you claimed not to have received any of my NetMail to you. This seemed to be a logical conclusion for me since I had sent you NetMail from not only three widely displaced sources -- The Gameboard (1:244/506), The Circuit! Board (1:346/15), and N1BEE (1:?/?) -- but since I had also sent some from >your own< home BBS, Psychotronic (1:3641/1)! While a technical problem at any >one< of these sites might have prevented NetMail from getting to you, it was inconceivable that such a problem would have prevented you from receiving NetMail from >all< of these sites. Well, I was wrong. I neglected to consider that a >common< fault could exist at all four sites -- me. It is my software that is not properly sending out my NetMail. While it seemed an obvious conclusion at first, I was wrong for calling you a liar, Ed, and I apologize. ** --- PCBoard (R) v15.3/M 5 * Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00036Date: 02/11/97 From: IAN MOOTE Time: 12:08am \/To: DAVID MOHORN (Read 4 times) Subj: NT 3.51 File Checking -> Does anyone know if there is an API I can use from a Windows 95 or -> WFW client that can check to see if a file is being used on an NT -> 3.51 server? I.E., opened for read, write, etc.? Are you programming in assembly under Win95 and WFW, David? I'd be interested to hear what you are using for source references. -> I have a file in a directory that is available to FTP users. They -> will FTP and download their files from this directory. The only -> problem is, occasionally I will be overwriting their file with a -> later one. There may be a time when they're logged in and FTPing -> their file at the exact time I'm about to overwrite their file with a -> new one. If this happens, I receive a "Sharing Violation" or the -> like and must respond at the console. This isn't optional, since -> this batch file will be running automated nightly. -> What I want to do is have a program check the file's attributes prior -> to invoking the DOS COPY command from a batch file and return an -> errorlevel if its not safe to continue. For example: Batch file? And the Dos Copy command? Hm. Okay... well, checking the file's status from a batch file is inequitable in my considered opinion. Between the time you check the file's status and the time you start to copy, someone may try to access the file. I would recommend that the safest course of action would be for you to write a program that does all the checking and copying for you. This would give you the most security and prevent any accidents. First, open and lock the source file. Then attempt to open the target file using Dos function 6Ch -- this allows you to easily disable Dos Int24h error handling so that Dos will return the sharing violation error code to the program instead of prompting the user for interaction. If, or when, the coast is clear your program copies the file, then writes 0 bytes to truncate it (if necessary), then close the file. Does this seem viable? I can be more specific if you like. Actually, it would probably be a pretty short program to write. Take care. Ian (transaction-based file-access) Moote ** Beauty is only skin deep, but ugly goes clear to the bone. --- PCBoard (R) v15.3/M 5 * Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2F00037Date: 02/11/97 From: BILL CHRISTENSEN Time: 02:28pm \/To: NICK COONS (Read 4 times) Subj: SHL. NC> > I have not read your orginal posting, but I see one error in the NC> > enclosed snippet. Line two and line four of your code uses a NC> > nonexisting segment register--dx, I think you mean ds:ax. NC> NC> I thought that you could use DX:AX together as a double-word. Isn't NC> that where the product is stored of some multiplications? Yep, you are right....I forgot all about the 4 byte DX:AX setup. Let me try again. If in your orginal posting you want to multiply the 4 bytes stored in DX:AX and you are programming for a 286 or 8088 processor, then I would say the solution is to SHL the AX register and then ROL the DX register. You cannot just SHL the DX:AX registers. If you are programming for a 386 or better processor, then use Extended registers.. ie EAX to do your shifting. The SHL shifts the most significant bit from the AX register into the Carry Flag register and a zero into AX's least significant bit. The ROL instruction shifts what is in the Carry Flag register into the LSB of the DX register and the carry flags gets what WAS DX's most significant bit. So a loop built around the two intruction set of: SHL AX,1 ROL DX,1 should do the trick. TTFN Bill Internet address wchriste@eagle.wbm.ca --- --- Shotgun v2.00 * Origin: GUNN Data Systems - Saskatoon,SK - (306)652-0288 (1:140/146) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E2G00000Date: 02/09/97 From: JOHN GARDENIERS Time: 08:07pm \/To: PAUL CHAMBERLAIN (Read 4 times) Subj: 80186 Hi Paul, -=> 01 Feb 97 21:09, Paul Chamberlain wrote to John Gardeniers <=- JG>> The only data I have on the 80186 is "advance information", which JG>> obviously doesn't even come close to answering your question. PC> your lucky to have any data on anything less than an 80386 data book. I would consider myself luckier if I had more up to date books. :-) I sort of lost interest in the hardware side of things a long time ago and haven't tried too hard to keep up to date. PC> i once rang intel sydney and they said they didn't have any data on PC> the 80286 but gave me a number to ring and they said that the 286 PC> was obsolete I have a house full of "obsolete" equipment. That doesn't mean it's no good any more though. I have a simple rule regarding anything I write: If it won't run on an XT it's poorly written and needs fixing. I hate the way computers have become faster and software is being so badly written that it runs slow on a 486. There's NO excuse for that kind of stuff. Considering the prices of commercial software I think they could well spend the little extra time eeded to do it right. ttyl, >>> Fuse >>> ... Cat fur expands to fill all available disk drives. --- GoldED 2.50+ * Origin: The Cubby House, assembled by hand (3:632/360.70)