--------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00010Date: 04/19/97 From: BARTON PAUL LEVENSON Time: 10:59am \/To: DORAN MOPPERT (Read 3 times) Subj: Transcendental Functions BPL> good source is Cody and Waite's 1980 book (forget the title just at BPL> the moment). Also Kenneth Plauger's "The C BPL> Standard Library." I have BPL> approximation algorithms from these, but they're all in QBASIC -- I BPL> have no idea how I'd implement them in assembler. DM> Any chance you could post the qbasic? I'm rather DM> interested in the algorithms. Taylor's theorem was I don't think I'm allowed to here -- you'll have to ask the moderator. If he allows it, I'll post them. --- Maximus 2.02 * Origin: Politically Incorrect (412) 766-0743 (1:129/283) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00011Date: 04/18/97 From: CHAD WALLACE Time: 11:49pm \/To: SCOTT LITTLE (Read 3 times) Subj: assembler Hello, Scott. On Apr 17, 1997, You wrote to All about assembler SL> Does the assembler command JUMP have anything in common with a GOTO? Yes. It's the same thing... Cmdr Walrus internet e-mail: cmdr.walrus@snboot.netshop.net --- GoldED 2.50+ * Origin: Writing from Kamloops, BC, Canada (1:353/710.16) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00012Date: 04/19/97 From: JAMES VAHN Time: 08:21am \/To: PHIL QUINTON (Read 3 times) Subj: Serial Chip / Modem contr PQ> possible. The idea is that I would like to make a Dos driver PQ> for the modem. To do this I would need to know how one would PQ> normally access a serial port down to the IN's & OUT's and PQ> How I would be able to emulate a serial port. Processing the PQ> questions and outputting the answers, as if a 16550 Fifo. Is this a Winmodem in which the UART is emulated, rather than a hardware component? The serial port is not difficult, but you might have a problem finding anything about a winmodem. --- timEd 1.01 * Origin: James Vahn (jvahn@short.circuit.com) (1:346/15.1) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00013Date: 04/19/97 From: JOE KOSS Time: 10:30am \/To: DAVID KIRSCHBAUM (Read 3 times) Subj: Re: Accessing memory on heap > _Soft_CI_Hash PROC FAR > enter 4,0 > push DS ;v1.3 > push ES ;v1.4 > push si > push di > ; > ; { > ; /* Update bitcount */ > ; int count = DataSize; > ; > DataSize EQU word ptr [bp+6] > pData EQU dword ptr [bp+8] > pData_hi EQU word ptr [bp+10] > pData_lo EQU word ptr [bp+8] > > buffer EQU dword ptr [bp-2] > buffer_hi EQU word ptr [bp-2] > buffer_lo EQU word ptr [bp-4] > I am currious why people are still managing stack parameters the hard way? Is it because you don't have a quality assembler? (not poking at u..curious) --- GEcho 1.02+ * Origin: Midnight Madness <-> Hartford, CT (1:142/8076) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00014Date: 04/19/97 From: JOE KOSS Time: 10:33am \/To: IVAN SHULEV (Read 3 times) Subj: Re: FS and GS registers > TH>> Pop quiz time. > > TH>> What is the purpose of the FS and GS registers? > > BM> I think I know what they stand for: > BM> FS = Far Selector > BM> GS = Global Selector > > BM> And I think they may have something to do with protected mode, > BM> don't know what... I haven't really done much PM programming.. In PMODE there are special meanings. GS = Gate Selector (betcha didn't know that) --- GEcho 1.02+ * Origin: Midnight Madness <-> Hartford, CT (1:142/8076) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00015Date: 04/18/97 From: LARRY OLSON Time: 11:37pm \/To: TRY AGAIN.NEXT MSG [Y)ES, N)O, A)G (Read 3 times) Subj: Area UFO_CHAT: General UFOria Chatter From: Ed Mann Rec'd To: Allen Roberts Msg #191, Feb-13-97 17:51:46 Subject: QWK downloads ok --- Maximus/2 3.01 * Origin: UFOria (1:109/369) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00016Date: 04/18/97 From: SYLVAIN LAUZON Time: 08:59pm \/To: DAVID KIRSCHBAUM (Read 3 times) Subj: Accessing memory on heap Hi David! > Load offset into SI or BX or some likely pointing type > register, and the segment in ES or DS (after saving the > registers, of course). DS:SI will be pointing right at the > data (whether it be in DATA segment, on the heap, or > whatever). Would you tell me where is heap? Or rather what is called heap. --- * Origin: Silicon Palace {514}432-2953 Lafontaine, Qubec (1:242/100) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00017Date: 04/18/97 From: BALOG PAL Time: 11:20pm \/To: ANDREW FRANK (Read 3 times) Subj: Accessing memory on heap Hi, Andrew Frank! On 15 Apr 97 03:11:35 you wrote to All AF> First of all, I am very new to assembly programming, and don't have a AF> book to learn from. I'm using the Watcom compiler with inline assmbly AF> to start (it's sure a lot easier than the 20+ lines needed in a bare AF> bones assembly program which only returns to the OS). 20+ lines? code segment org 100h start: mov ax,4c00h int 21h code ends end start That's 6 lines. :) (And even could be 5 using int 20h instead, but that's disencouraged and would return a random value.) But really, inline asm is easier to start with. But be aware, you can miss several points of asm. Especially macros and similar cute stuff. AF> In all honesty, I probably won't ever go to writing programs entirely AF> in assembly simply because C is so much easier. I would however like AF> to write time sensitive portions of code in assembly. Yeah. That's a good idea. Inline is good for that in case of your code is short. But for more complicated tasks you better use native assy modules that you link with your other objs, produced in C, C++ Tpascal or whatever. Most asm compilers give you much help in that, just use the model directive specifying a language and it will handle param passing, segment naming, etc automatically. AF> I have managed to write simple portions of code which takes 2 AF> arguments, and returns one as the sum or the difference of the two, AF> and simple stuff like that. Good. :) AF> What I'd like to do is pass a pointer variable to ASM, modify the data AF> on the heap while in ASM, and return nothing having done my task. (I AF> know how to return nothing). for 16 bit models: void inc(stort __far * i) { __asm { les bx,i // load the address inc word ptr es:[bx] } } For a small 16 bit modell void inc(stort * i) { __asm { mov bx,i // load the address inc word ptr [bx] } } AF> Another thing which I'm curious about is variables in Assembly. I AF> don't know how to define variables, so I've been passing variables and AF> using them, or using the registers. In the inline assy you can use any variable you could use in C. Just take care how it's to be used. AF> Also with regards to the AF> registers, can you put floating point values in them, or just AF> integers? You can use anything, but take care about the regs you should restore before going back to C. The regs you can destroy should be described in your C refman. Generally DS, SP, BP, SI, DI should be preserved and ax, bx, cx, dx, es, fs, gs can be destroyed. But that may not be the case for Watcom. If the compiler support it, you can use the floating instructions too. Using external modules take care you compile all with similar FP option. If you compile to use the coprocessor directly (I think that's allowable nowadays) there'll be no problem. Using the regular emulator should work too. AltMath is probably not supported in asm. Take care that C portions may leave values on the coprocessor stack, so you can end up in Fp stack overflow. Paul ... 2 wrongs dont make a right - but 3 lefts do! --- OS/2 Warp * Origin: The FlintStones' Cave in BedRock (2:371/20) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00018Date: 04/18/97 From: BALOG PAL Time: 11:20pm \/To: TIM HUTZLER (Read 3 times) Subj: Above 1M (w:FS and GS registers) Hi, Tim Hutzler! On 15 Apr 97 08:27:00 you wrote to Balog Pal TH> So, how are segments above 1-meg addressed? Just like any other segment: load its selector to a segreg, and use. :) You probably want to ask how to access memory above 1M? Well, you have 2 options: go to protected mode (the preferred option) or extend the segment limits remaining in real mode (AKA unreal mode). In protected mode the proc uses its native addressing mode, not the 8086 compatible stuff. You use descriptor tables where your segments are specified. A descriptor is a data structure with fielsd like the segment base address (in linear space), segment length (may be several gigabytes), read/write/execute permission, level of access, default register size (16/32 bits), and some other specials. Eg you set up e descriptor that 's base is at 1M and limit is another 1M. Or set up other to start at 0 and be 4 gigs long. Then to use it, you load secector to the segment register. The selector is a pointer to the descriptor table. (The descriptor tables' base address is loaded into GDT, LDT, IDT registers beforehand.) Then the proc loads the descriptor data into (hidden) segment descriptor cache registers, and you can use it. Certainly upon the load a plenty of checks are made to determne you're allowed to use that selector or not. If you could load the selector upon accessing memory other checks come to see you're in-limits, and and do the allowed operation, ie do not write to a read-only seg or so. Certainly switching to protmode will render your regular dos and bios unusable, including all the software and hardware interrupts. So you must write or the handles youself, or use a PM host to provide that functionality. Such a host is Windows, for example (way good to practice with PM), but there're simpler ones, like dos4gw, borland's tkernel, and even good packages availagle in source like code32, pmode. Unreal mode uses the undocumented, but existing behavior of the sd cache registers. A little proggy switches to protmode for a short moment, loads all the segregs with descriptors set to maximum limits (default limit is 64k) and instantly switch back to real mode. After that you can address the whole memory space from real mode. As you probably know, you can do a mov ax, DS:[EBX] regularly, but you got an exception if the value in EBX exceed 64k. After the above trick the limit is widened, so you can use any value. The drawback is, that switching to/from PM can be made only in real real mode. But 99+ % of systems today use memory managers (emm386, qemm386, etc, or win, win95, os/2, etc. There your dos promt runs not in real but in virtual mode, and you can't use the instructions needed for the operation. (And even if you could do it, it would crash the memory manager. :) So you'll probably not release anything using unreal mode to public. But it can come handy for some things you want to do on your own machine. Paul ... Do NOT look into laser with remaining eyeball --- OS/2 Warp * Origin: The FlintStones' Cave in BedRock (2:371/20) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: E4Q00019Date: 04/19/97 From: BARRY BLOCK Time: 01:07pm \/To: GARY SMITH (Read 3 times) Subj: ENCODED MESSAGES Hello Gary, GS> In the Batpower echo, where quite a few encoded files are posted, GS> we've found that xxencoding is much more robust than uuencoding for GS> transmitting files over Fidonet. Right. In the Terminate_Int. echo they don't like xx because Terminat has a built in uue/uud in it's mail reader, but it does not handle xx. Waiting to hear from the moderater about this one. :) Kind regards, Barry --- Terminate 4.00/Pro * Origin: EBO-BBS A'dam +31-20-6002828 (2:280/901.42)