Article View: comp.lang.asm.x86
Article #124Re: Frustrating
From: 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
Technical Details
Message-ID:
<717ne0$6gi$1@autumn.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7177gc$ms7$1@autumn.news.rcn.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114917,9649ddaf83649d3e X-Google-Attributes: gid114917,public X-Google-Thread: feaef,9649ddaf83649d3e X-Google-Attributes: gidfeaef,public From: "Jack Ruijs" <j.ruijs@tip.nl> Subject: Re: Frustrating Date: 1998/10/28 Message-ID: <717ne0$6gi$1@autumn.news.rcn.net> X-Deja-AN: 406009459 Approved: <johnfine@erols.com> References: <7177gc$ms7$1@autumn.news.rcn.net> X-Mozilla-Status: 0801 X-Complaints-To: abuse@rcn.com X-Trace: XwzINPN1Kkq90GMl72BjY75mdLiqrXPQ9qBt7KdUcT4= Organization: World Online Newsgroups: comp.lang.asm.x86,borland.public.tasm