Subject: Re: Merlin Newsgroups: comp.sys.apple2.programmer From: dempson@actrix.gen.nz (David Empson) Date: Thu, 6 May 1999 02:02:11 +1200 Message-ID: <1drcubi.n8p3n81cemy2oN@dempson.actrix.gen.nz> References: <7gn8vo$h4d$1@nnrp1.dejanews.com> Organization: Empsoft X-Newsreader: MacSOUP 2.3 NNTP-Posting-Host: 202.49.157.176 X-Trace: 6 May 1999 02:00:24 NZST, 202.49.157.176 Lines: 54 Path: lobby!newstf02.news.aol.com!portc02.blue.aol.com!howland.erols.net!outgoing.news.rcn.net.MISMATCH!feed1.news.rcn.net!rcn!cyclone.news.idirect.com!island.idirect.com!usenet.net.nz!news.iprolink.co.nz!news.actrix.gen.nz!dempson wrote: > Thanks for the information about merlin! > > Now, I would also like to make an area of bytes to be used for data, > > Label XXX 12345678 ;define 8 BYTES of data There are several directives for this. HEX lets you enter paired hex digits, but I usually prefer DFB (define byte) because it is easier to read, and lets you select the base. The following two lines are equivalent. Label HEX 0102030405060708 Label DFB 1,2,3,4,5,6,7,8 You can also use DA (define address) to define 16-bit values (in the standard low-byte-first order). If you want to enter hexadecimal data with DFB or DA, use a $ prefix, otherwise the value is decimal. Another useful directive is DS (define space), which skips a designated number of bytes. I prefer to use this if the value in the location is unimportant, e.g. a result or scratch variable which will be initialized by the program before use. e.g. for a hypothetical ProDOS MLI parameter block: OpenPB DFB 3 ; Parameter count OpenPath DA Pathname ; Pointer to pathname to be opened OpenBuf DA Buffer ; Pointer to 512 byte page aligned buffer OpenRef DS 1 ; Reference number goes here Pathname STR '/RAM5/TEMP' ; Or whatever The actual code to use this looks something like: JSR MLI ; ProDOS call DFB $C8 ; OPEN DA OpenPB ; Parameter block pointer BCS OpenErr ; Branch if error * If no error, copy the reference number to the other parameter blocks LDA OpenRef STA ReadRef STA CloseRef * etc. -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand