Thread View: comp.lang.asm.x86
4 messages
4 total messages
Started by Antony Smith
Wed, 28 Oct 1998 00:00
Frustrating
Author: Antony Smith
Date: Wed, 28 Oct 1998 00:00
Date: Wed, 28 Oct 1998 00:00
46 lines
2531 bytes
2531 bytes
I tried learning ASM about 6 months ago , downloaded tons of manuals , letters , asm code etc. I gave up in frustration , as the ONLY thing I've ever managed to compile so far was the 'hallo.asm' file. I even read 6 chapters of Randolph Hyde AOA , but that was in masm , and I do not have access to a masm program. What really made me give up is that OVER 90% of all 'HELP'source files posted here DO NOT COMPILE. I thank the chap that posts them , but get an ERROR , generally from tlink , sometimes from tasm , can't really complain , they are trying to help me , but the CODE JUST DOES NOT WORK. As an example , someone posted this recently:(my comments after colons) > Any know of any tools that will allow you to copy the Hex values of a binary > file and paste them to a text file, like an assembler file? copy con cmd.txt ; ok , I've done this before.It writes a text file d0 lnumber_of_bytes ; D0 I12 for example ????? q ;OK , leave debug ^Z ; F6 <enter> .....could have explained , from DOS days ; OK so that writes a text file debug filename.bin <cmd.txt >out.txt ;for example debug notepad.exe <cmd.txt>out.txt ;?? ;well , DOS freezes , but I get an out.txt , ;that contains 18 bytes , but it is exactly the ;same , does not matter what binary file I use. ;understand the frustration I feel ?? OK , so a request. Could someone send me the source for a program that converts lowercase to uppercase , input asdfg output ASDFG and one that multiplies and adds input NUMBER ; example 124 output ADD or MULTIPLY ? input MULTIPLY input 5 output 620 Something that compiles with tasm and tlink and commented so I learn something ??? :-) TIA and after if I manage to learn something.
Re: Frustrating
Author: Jack Ruijs
Date: Wed, 28 Oct 1998 00:00
Date: Wed, 28 Oct 1998 00:00
122 lines
4325 bytes
4325 bytes
Antony Smith <smithafPLEASE@mii.nutecnet.com.brTAKETHISOFF> wrote in article <7177gc$ms7$1@autumn.news.rcn.net>... > I tried learning ASM about 6 months ago , downloaded tons of > manuals , letters , asm code etc. I gave up in frustration , as the > ONLY thing I've ever managed to compile so far was the 'hallo.asm' > file. I even read 6 chapters of Randolph Hyde AOA , but that was in > masm , and I do not have access to a masm program. > What really made me give up is that OVER 90% of all > 'HELP'source files posted here DO NOT COMPILE. I thank the chap that > posts them , but get an ERROR , generally from tlink , sometimes from > tasm , can't really complain , they are trying to help me , but the > CODE JUST DOES NOT WORK. Don't be frustrated and don't give up, there is no reason. If you have the stamina to stick to learning assembly after a period of six months and only have compiled hallo.asm, you surely are willing to learn. I do not know what hello.asm file you refer to, but I included one below. First of all I want to give you some hints that might help you to program in assembly. - Stick to DOS for the time being!!!! - Study the microprocessor (don't start with the Pentium!) - Use HELLO.ASM as the experimenting baseprogram. Don't try another program until you FULLY UNDERSTAND the hello.asm program! - Forget about macro's at first. (You do not need them, other people might have other opinions) - Don't use PROC directives until you understand fully the paramter- usage and memory-models. (You do not even need the PROC directive) - Stick to the HELLO.ASM segment usage and only change if you want to and understand what you are doing. To get you going I included the text for a hello.asm program for TASM. Put the text in hello.asm then assemble and link it with: TASM hello TLINK hello Test the program. Do not continue until this works and you understand why! The hello.asm file is very important for beginners (in any language!). Use it as the basis for your own experiments. For example, you might adjust the program to: - Print hello twice - Use a loop to print hello n times - Wait for a keypress at the end of the program - Print hello until a key is pressed - Etc.., Etc.. your fantasy is your teacher here! These steps seem very childish (and perhaps they are) but such easy steps are essential for laying a good foundation for further development. I already included some code to help you with the steps above. But I also left out some other aspects, because some things have to be learned while doing. Kind greetings, Jack Ruijs ------------------------------------------------------------------------- ; Assembler File HELLO..ASM IDEAL MODEL SMALL ;********************************************** ; CONSTANTS ;********************************************** STACK_LEN = 512 DOS_INT = 21H DOS_GET_CHR = 7 DOS_PUT_STR = 9 ;********************************************** ; SEGMENTS ;********************************************** CODESEG ;Define order of segments ASSUME CS:@CODE, DS:@DATA DATASEG ALIGN HelloStr DB 'Hello','$' UDATASEG ALIGN STACK STACK_LEN CODESEG ASSUME CS:@CODE, DS:@DATA ;******************************************** ; Main () ;******************************************** Main: MOV AX,@DATA MOV DS,AX ; MOV CX,10 ;Enable for loop @@PUT: MOV AH,DOS_PUT_STR MOV DX,OFFSET HelloStr INT DOS_INT ; LOOP @@PUT ;Enable for loop ; MOV AH,DOS_GET_CHR ;Enable for wait ; INT 21H ;Enable for wait MOV AX,4C00H INT DOS_INT END Main
Re: Frustrating
Author: device
Date: Wed, 28 Oct 1998 00:00
Date: Wed, 28 Oct 1998 00:00
5 lines
1032 bytes
1032 bytes
the best way to really learn assembly is to get a good book. I recommend "Mastering Turbo Assembler Second Edition" by Tom Swan. I guess you could learn off the internet, but it might be harder. Dave
Re: Frustrating
Author: Frederic
Date: Thu, 29 Oct 1998 00:00
Date: Thu, 29 Oct 1998 00:00
10 lines
1224 bytes
1224 bytes
Antony Smith schrieb: > What really made me give up is that OVER 90% of all > 'HELP'source files posted here DO NOT COMPILE. Good point. I experienced that too .When I downloaded C sources, they NEVER compiled correctly, though I don't have an exotic compiler. When starting, my "hello" programs often crashed, too. I would never have believed I would once be able to write whole routines or even TSRs in assembly. Now I do. Don't give up!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads