ZX Format #04
14 июня 1996 |
|
Premiere - Assembler, which we choose (a description of XAS).
Assembler that we choose. ________ A couple of lines from the publisher. Since then, both in our dear and beloved homeland appeared Spectrum, have already passed still quite a long time. And, quite Naturally, for many it turned out Toys in the instrument of production of something stimulating intellectual development both producers and users. Path of becoming an individual personality and programmer / coder is very thorny and highly amenable to environmental influences, namely consumer demand for this platform. And if you not the first day using the Spectrum as a home computer, you may notice that this is the demand varies from day. If a couple of years ago, all were Need a new Tetris and bats, but today is uniquely called prioretenoe direction is very difficult. As shown life, our vendors, in contrast, say, from our government, sensitive respond to consumer demand (may even be too sensitive). But, thank God, the era of "Color Lines" and "Dizzy-horseradish-znaetkakoy-by-number-and-all-understand-how grafted-yes-and-not-Dizzy-do "kind of ended, and adventyury and strategies, so viewed on all computer platforms, begin to acquire human face, and more and more people are not willing only play, but also to create. Here is when replaced Dizzy-like distorted and it is time system programs and programmers. "A systematic program is needed kakya Creator most?" - FPIC you me. I Traditionally, you do not answer. However, little thought, again according to tradition You guess what STE est assembler. "But how many can?" - Zaropschete you. "As much as you want!" - I will answer You quote. Most assemblers, good and different! There is a kind of axiom that says "how many users, so many opinions" but I beg to differ with this approval, at least in the area assemblers for the Speccy. After studying unbiased opinion on the the subject of what should be the ideal assembler, I can state with confidence that the ideal assemblers should be only about 5-10 pieces. And globally, they are divided into 42-ear and a 64-character ex. And therefore the verdict: Go for it, and maybe you write an assembler that meets at least 1 / 10 part of the population using prog this type, looking, and maybe you find your "dream idiot" named "ProstoIdealnyyAssebler. In this issue we publish two (2) assembler: XAS and ZXAssm. Description of the first of these is the principal of the article that the same with regards to the second competitor for the title you know what, the statement for its use lies in the application, the file "Read.Me.C", the going just outside the by "ZXASM3.0". For reasons of disk space we have not included in any of the submitted package sts3.xx, and if you're going to use them, then do not count them for work to finish on your hard disk the correct version of the monitor. Comments, suggestions, guidance, morality and simple thanks can send both the author and the editors ZF. ____________ Xas editor-assembler 128k (V 5.05) (C) Max Petrov __________________________________________ I offer you a description of the latest version programs in the magazine You will also see the previous one, the difference is defined and marked with "*". 1. Background. 1.1 What is, why it is necessary and why. Now, as is well known for our long-suffering, but dear friend, there are several similar programs with the undisputed leader Tasmom (there is some Zxasm, but I have not seen him). However Tasm since its inception pushed some users (me) of its 64-character, and today even with the outdated its overnostyu and a bouquet of glitches. Actually that's the whole reason for the appearance of my program, thanks Rst 7. Based on experience in Tasme on and where to write the first version of the program, as well as on their own dreams and wishes of the VL, IK, and AB, was such thing: - Assembling of 4.4 times faster Tasm 3.x. - Disc surgery is 2-3 times faster with a large number of files on the dis Kothe - up to 10-20 (!) times. - Search text - almost instantly (with Responsible 20-30 times (!)). - The buffer to 1820 labels (* 1500) (tasm - 740). - Editing the two texts simultaneously simultaneously with the ability to transfer blocks from one text to another. - The text of the program in 1.79 times less than the equivalent in tasm. - The number of buttons that need to be press to set the same text 1.333 ... 1.5 times less. - The amount of text that can be Otas semblirovan without a single reference to drive - a 2.23 times greater than in tasm (!). - The maximum amount of text in one 1.12 times more than in tasm. - The time taken to search for the line with holding a mistake that revealed for assembly - 50 .. 1000 less;). - Work with the half-ix and iy; - The possibility of assembling a dedicated On the site the n-th number of times (* - no); - Macros that at any moment can be edit; - The big Russian, and large and small letters; - Modes ins and ovr; - 42 characters per line; - Save the current position in the text for all operations; - Avtotabulyatsiya; - Load on the cursor, loading time and record does not depend on the number of files floppy disk (which can not be said about Tasme, to tory for the disc with a 40-fi lami just fall asleep); - Called Xas [ksas]; - Lots of friendly, unexpected, new things ... Disadvantages: - Do not merge; (but more than compensated by the WHO sibility of transfer of labeled blocks text from one window to another); - There is no substitute for find; - Labels up to 7 characters (other characters for assembly are ignored) (Tasm - up to 14); - Defb does not like strings; - Silly equ (in the expression should not be uncertain labels); 1.2 Download and Run. On the drive there are two files: and he xas (Must be written immediately after it) sts 3.21. If you came from xasa in basic, then back can perform run, if alive program in BASIC (the first row can be removed), usr 23465, if you do not touch the printer buffer addresses 23465-23471 or 49152 usr include Bank 1 (Out 32765,81). 1.3 A location in memory. Ramtop set at address 24575, but it can be rearranged in any address to 32768. Xas is page 1 in page 3 - the first text in the fourth - the second text in the 6-th macro, table tags and buffer to block transactions in the 7-Ow page is sts. At the entrance / exit xasa just a memory in addresses 23440-23471. You can use the page 6 (even killing a macro), as well as page 4, if you do not download it second text, and if assembliruemoy program, no options loadtext. By the way, we should say that loadcode and save code used by the on-screen memory stsa (ie bank 7). In general, you can make a muck of, and the third bank - to hang it will not. And naturally, at your disposal all the 48-I memory (page 0, 2 and 5), except Some system variables BASIC. If you 256/512k port # fd bits 6 and 7, then use the 2nd bank 128k (ie # 10 pot instead of 0, # 17 - 7th ...), that usually leads to preservation of the text in memory even after pressing the reset ... 2. Entering text. 2.1 Download. When handling the disc border color change indicates an error reading / writing. After four attempts, it asks: Error t / s. Retry, Ignore, Abort. where t/s- a track / sector with an error. If you answer Retry will be done 14 more attempts ... Interruption of operation with a - - Space. When you run the editor-assembler (hereinafter p-a), if the memory is no text, then disk for a file XMACROS.XaS (macro) and loaded in the presence (and absence of memory). Then, if the disk There are files with XAS, xAS and XaS, You will get them and spisochek the amount of free disk space sectors. You can select a file with cursor keys and entera, or refuse to download by clicking edit (removal of load) or ext mode (remove the text from the memory). Space - perezachtenie directory. If the files on the drive there, then the p-and immediately come to the editor. 2.2 Display. Going into the editor, you will see several bukovok and tsifirok bottom of the screen. INS - mean that enabled insertion (CS / 3), OVR - replacement; LAT - selected Latin alphabet (edit), RUS - Russian; 0 / 1 - the first number indicates the number of current ing line (from scratch), second - if honors the lines in the text (ie the maximum maximum value for the first number la). The text may not be less two rows; thing - shows the current number one hundred tekpravoe: 1 - The text of the bank 3, 2 - the number of bank 4 and 3 - the macro in the bank 6. Color figures indicates the following: White - You have not yet edited text after boot yellow - the text still does not edit valsya after recording, red - the text is edited camping, and when the next record it on the disc will increase the number until shows number of editions; number, which - the number of editions of the text, in front if it is zero right number of new text (or only to that encoded LIMITED), it will not show is called. At the bottom is a row of 29 characters in length. This comment, which is stored in the text. The third bottom line is often printed Model Search (* - no). 2.3 Editor. Quite a tricky thing: when you try to go beyond the line, he will pack it, check the elementary syntax, and if all the procedure will avtotabulyatsiyu (ie string type LabEL lD Hl # 4000; MDAAA .. turn to "Label LD HL, # 4000; MDAAA .. If syntax errors such as: two tags in a row at the start line, use the names of the registers and conditions as labels, more than 3 marks in a row (y z80 No team with four parameters) (for def-s restriction does not apply), editor something propischit nowhere to go and not allow it. Be careful with nested each other quotes in defm: if you two standing next to the quotes, then after they recommend to continue the search with the next lines: for example, need a text: "a" "b" it should score at defm "" a "" b "", and defm "" " defm "a" "" defm "b" " Operations in line: ext mode - exit from the editor; ss / q - rus / lat; location of Russian letters 'yaverty' in is_dos; ss / a - tab (very rarely used acterized button); cs / 2 - ovr / ins; edit -home/end (start / end of line); cursor - the cursor; graph - the prefix macro (see below); delete - guess, if you press in on beginning of an empty string, the string removed; break - removal of the cursor; ss / w - delete rows; ss / enter - the restoration of the line, return schaet line form, which she had to edit; ss / e - tag line for the block operations are not necessarily metal tit lines in a row, to make uncheck this box, then repeat but otmette other kind of tags (see cs / ent), or click enter; (see also ss / s); cs / ent - tag line for the memory The same mark is aiming line assembler, if it detected wife of error, uncheck - - See ss / e; Operations in the text: cs/3/4 - page up / down; ss / g - start / end of text; ss / y / u - find predyd. / trace. marked line, and if there are none, nothing does not occur; ss / s - cancellation marks; ss / f - search for the next model, if it does not, then changes the color curb; (see below find); graph ent - search _nachala teksta_ words Islands on which the cursor is positioned; very handy thing to find labels, not necessarily put cursor to the beginning of the word - it will be done automatically; to find the next such word, press ss / f; Block operations: ss / d-deletion labeled ss / e lines; ss / i - copy marked ss / e lines, and if the marked lines No, it is inset text from the clipboard; graph ss / i - Copy the marked lines into a buffer, for example, pereno self them to another text; (* - Some other location Clavey: edit - rus / lat; cs / 2 - tab; cs / 3 - ovr / ins; cs / 4 - home / end; ss / q / a - pgup / / Pgdw). To copy lines from one text to another, we must first put them in buffer. Labeled lines are placed in the buffer when you ss / i or graph ss / i. Followed by a move to another text (download it or just switch to another window), remove it yellow mark (Ss / e) and push ss / i. When assembling a large number of tags they can collide with the buffer. (* In assembly buffer is cleared) 2.4 Teams Xas. When you click in the editor, ext you get to the command line. Back in the editor, you can press ext. Teams are selected pressing the appropriate keys: aUto (respectively, - 'u') undo / / On the need for confirm selecting ente ROM (this team is, in fact, rudiment, and the next. versions of its will not, so enjoy now); Edit a return to the editor; Save text the text to write to disk; proposed reaches to change the name in the time we introduce Yes it is a command can be undone pressing ext, with the change name is preserved, if the disk such a file is, it is removed; if the disk has no space community tions is not issued, changing the color border to red. Load text file download the catalog; ec whether the disc has no files with the types of XAS, XaS, xAS or xaS, then kata the log does not appear and xas vozrva schaetsya the command line, with select the file running the following keys: space - perezachtenie directory, edit - cancel App ki, ext - delete text from the PA myati the files that start with the symbol ox '' - remote, but they can be but free to download, file type 'T' means the text, 'M' - macro (It is automatically loaded into Box 3, regardless of the current); sTs output in sts (* - No); pressing cs / t in the pc will be for scribed address start otassembliro bath program, and in memadr - recently printed in the tracing oscillator number (for sts 4.x); flow of N 2 and complete their work operation ret; cs / r - after the return of prog Ramm and to clean the screen will expected to press any key; remarK editing comments; Assemble assemble; fullCat complete directory of the drive; cs / c - All data are displayed in decimal dimensionless form; neW delete text from memory should be confirm the 'Y'; laBels displaying table tags sorted according to the first symbol ox; to interrupt the press space; if after assemblirova of you used the block operator walkie-talkie 'copy', and labels would be Lo a lot, then you will see not all tags; cs / b - print in decimal form; (* - Does not support the push to cs, and asks the question 'hex?', in be answered 'n', if need a stamp in the decimal system IU); , Save cOde - write the object code, with code length over # c000 record does not is because such lengths in 48k of memory does not happen; Mac edit - edit the file macros which is located in the 3 rd box; aNother - switch to editing another window: 1, 2, 2> 1 3> 1; comPute - calculator. You can recruit expression as in the text of the prog Rummy (tag names, binary and symbolic constants ..), the results This result will be printed in decimal my, and hexadecimal systems max, we can use a calculator vatsya to transfer numbers from one tem to another view label values, attitudes Adre ca sts on value of the label (see sTs) (* - No); 3. Disassemble. Assemble in two passes, but not Traditional. On the first pass is a table of labels. At the end of his message on the length and the end of the object code. Almost all errors are declared on the second passage. Assembling can be interrupted on the second pass, pushing cs. Second pass ends with a beep. Now the program can be run (see run) or write to disk (save code). Want to note that the assembly time depends mainly on the number of tags, but from, say, the length of the text - much smaller. From this very simple conclusion: do fewer labels, and the formula for approximate calculation of the time assembly: t = 0.000163 * n ^ 1.72, where t - time seconds, n - number of tags. 3.1 Errors. When an error occurs displays the string with the error below - its number, the name of the error and, if the text is loaded loadtextom or simply found in the second page name. In this line is marked in red (see cs / ent), to it can be easy to find and edit ((c) I). List of errors: No Label - there is no such label; Syntax In Number - syntax error including; Label Exists - issued on the first passing through de; label with the same name exist (see Introduction); Syntax - Syntax error in parameters The parameters of the operation (eg (Ix +)); Target Too Far - jr operation or not djnz can jump so far; Number Too Big-in operations not involving with (ix / iy + d) - just envisaged Preventing that parameter a number greater than valid for this operator tion (for example, bit 3 +15, a), in this case will be taken junior level numbers, the parameter same for (ix / iy + d) may mean chat error; Fatal Error - usually an error in the parameter operations, which excludes the possibility of its assemblirova of (ld sp, bc); LTB Over - no more room in the table labels; appears on the first pass and stop al semblirovanie; No File - file does not exist in teams loadco de and loadtext; Skipping - warning ignored Vania team loadtext, if she met in the text of second window (see below) or team loadcode, if file is missing (in the second pass); attachment warning ! Assm; Attention! On error Fatal Error object code is so flawed, that can not be used (this due to the inability to determine the length of operation is to occur, leading to incorrect preparation of the table tags. Other district and if such errors do stop assembling. 3.2 Source code Text can be typed small and large letters, with or without tabs instead of commas, you can type spaces (except def-s). Small letters are typed with cs. Macros are typed by pressing the graph and then any key. When I try to go beyond outside line, it will be recoded, gaps where necessary, replaced with a comma tags to improve readability (perhaps First you will be impacted, but then I hope you will appreciate my efforts) will be printed in small letters. If the line there are errors, you can not go beyond it, do not fix it. Russian letters can not be used in labels. Instead, (ix / iy +0), you can dial (ix / iy); halves ix / iy denoted hx / y and lx / y. In the ex af, af 'apostrophe can be left out. At a set of hexadecimal numbers instead of icons '#' you can press '..' In operations ld (adr), rp ld (adr), a out (n), a in a, (n) bracket set is not necessary (ie you can ld l01 +50 / 3, de). In out (c), r and in r, (c) '(c)' can be omitted (out l). (* - No) Push or pop a few in a row can be replaced by one, listing the register pair separated by commas: pop af: pop iy: pop bc = pop af, iy, bc. Numbers Instead of numbers you can dial _lyubyh_ expression, where - the letters in quotes - a number that consists of the codes of letters (the quotes (Except defm) may be one or two letters), with the first letter - the most significant byte, second - Jnr. If the letter a, then the first byte is zero - the brackets and preoritet operations are not supported - allowed the operation: +,-,*,/ and! - Xor (example: "B"! # 80, 1520! Label1! # F001). Supports binary numbers, they must begin with a '%' and be in the range 0 .. 65535. Another two logical operations: '& Ampl - take only the low byte '& Amph - take only the most significant byte, placing him in the minors, ie, # 5cf4 '& amph = # 5c; 'L - the result of a cyclic shift to the left 'R - the same right, ie # A703'r = # d381. If you need to move several times, then operation is simply a duplicate. Features (def, work, ent, org, loadcode, loadtext,! assm) defs - supports up to two parameters; If the second parameter is no, then it is assumed to be zero. The second option - - _dvuhbaytovoe_ Number, which will fill the memory defs. Examples: 1) should be 15 zeros - defs 15 2) have 31 push af - defs 31, # f5f5 3) should be 10,0,10 - defs 3,10 4) have 32 ldi (ed a0) - defs 64, # a0ed work - allows you to create the program, working not with those addresses, which they will assemble. Parameter indicates the address from which to work this program. Applies to _vsyu_ program and _all_ orgi and stores its influence to work without the option parameter. Recommend to put it in the beginning of the program _posle_ orga. Example: you otassemblirovat program to work with address 0: org # 9000 work 0 lab1 ..... org # a005 lab2 work lab3 ..... lab1 label will have the value # 0000 lab2 - # 1005, and lab3 - # a005. ent - allows you to specify the address from which this program will run the command run. Used without an argument. org - indicates the current address for the location of the program. Orga If not, then address is equal to # 8000. Attention! If the the beginning of your text orga not, orgi is on, and if they are more # 8000 the length of the object code will be calculated wrong! (Will not be counted org # 8000). So if you want to use save code, then in this case should be put in the beginning of the org # 8000. loadcode "name" - the name must be in quotes; loaded file type code; loadtext "name" - if the second page already have a file with that name, the disk access is not happening!, and if it does not, then it is loaded there, removing text that was there before. From the second page for obvious reasons, does not work. If someone does not know what loadtext - this option allows you to have a program in assembly, consisting of a set texts that are loaded and assembled in a queue while they enjoy one table tag, so from one files can be freely refer to labels from other files. ! Assm! On /! Off Esche has a genuine option! Assm, which can have a parameter! on or ! Off. It allows you to select pieces text, which must be otassemblirovat only once, or do not have to assemble. Parameter! On means that option! assm ignored, but after assembly it will be translated into! off. ! Off also causes the text to pass options ! Cont. Example: You write drayverok press, which enjoys a downloadable fonts. So why load it at every assembly? You can download it only once, and then he will sit in memory: ... font org # 7000 ! Assm! On loadcode "font51" ! Cont org # 7300 ... or you do not need to assemble some of the code, and to avoid flooding all lines in a comment, just ogranichte their options! assm! off and! cont. ! Assm n (* - No) The parameter n - number of repetitions. Allows otassemblirovat piece of text to the option ! Cont n times. Recalls defs Tasma, but an order of magnitude steeper than it: ! Assm 128 ld hl, 0 push hl ! Cont ! Assm # 50/2-% 0101 "I zachem eto?" ld hl, 0 call 1 ! Cont Instead of n may be a label if it is defined above. Put between tags! Assm n and! Cont not recommended. Use $. Nesting! Assm with any parameters not allowed! defm - instead defm "string" can be typed simply "string", in which case the number of characters per line will increase to 40. defb - if defb you only hexadecimal numbers, you can instead defb # n1, # n2, # n3, # n4 ... typing just # N1n2n3n4 ... Here, the first '#' character is required and each number must be entered using two digits (0 = 00, # a = 0a ...); number For clarity, you can share icon '#' (# N1 # n2n3 # n4 ... - as you like) and of course, instead of '#' can reap '. " 4 Macro. Macros are typed by pressing the graph (cs / / 9) and then one of the keys with the Shift or no. In this case, the screen will be printed string is assigned to this macro file letter. Macro file is constructed as follows way: it consists of strings, where the first character must be a sign ";", the second - symbol, when clicked on the screen will display a line that lies behind this second (ie, up to 40 characters). If at the end of the lines needed gaps then the last gap to be replaced by underscore (ss / 0), otherwise they will be cut editor. If you need to post O macros are automatically pushed enter, finish the macro point. The length of the macro file should not exceed # B20, then, actually, quite enough to have a macro at all possible characters (about 90). Length limit associated with the table of marks: under the block Copying a macro will be cut to the specified length. If your program a huge number of labels (> 1500), then macro file in the memory can be partially or completely destroyed, which, however, to hang will not, just if you using macros, you will have to restart. 5 formats of text. Section for those who want to write their perekoderovschiki and others or to understand the the work of district and ... The first 29 bytes of a file stored comment; then 2 bytes - the address of the current position in Text (addressed _nachala_ current line); on 2 bytes - the current cursor coordinates (x, then y); 1 byte sign ovr / ins; 1 byte - number of revisions file (0 .. 127); B # 01 - sign of the beginning of the text. Format of text strings explained by example: Screen: label LD HL, # 4d00-"a"; EXAMPLE Memory: 'LABEL', # ac, # d2, '# 4D00-"a"; Example', # 0d tags are stored in large letters; tabs are not available; Commas may be only for comments, quotes or as a separator in defah; gaps may only be in quotes or comment; the last byte in the line can be # 0d - Line normal color, # 09 - yellow or # 0c - red; an example: text must stand # 00. 6 Tips on programming Newcomers May, of course, is arrogance on my part to give any advice, but still I have written two major programs, so that something could be useful to you. 1) Try to plan a program before writing it. Similarly, decide what it will do and how. 2) Try to do less labels - and assembling will be quicker and will not be problems with the overflow table - use the icon '$', which means the current address, if there are multiple labels, you can turn to one another using the name of + / - offset. 3) to save memory, use the following things: if you need a cell, then Do not do this: label defb 0 .... ld a, (label) .... ld (label), a and replaced by: label ld a, 0 ld (label +1), a As the cells for storage of anything variables can be used BASIC. For example, printing via its driver You can override the channel and use the rst 16. 4) about the speed: remember that jp faster jr, ldi faster ldir, that the quickest way to stuff into memory Byte or get him out of it and push pop. 5) the '$': Remember that $ specifies the address beginning of the current operation, ie label djnz label equivalent djnz $ a is not, say, $ -2. 7 Perekoderovschik. Perekoderovschik written hacker Cris, and thing I can tell you quite steep: recode it from gens, isdos assembler or tasm 3.0 xas in and out of xasa in txt, where text format (gens / isdos / tasm / xas) defines itself, so I think in general not necessary. When perekoderovke in xas he wrote the number of errors - overflow line (as in tasme and isdose line 255 (?), while I was up to 42 characters, and long lines are cut in half. In this line will be marked in red and can be easily found in xase (at ss / y / u) and corrected. After perekoderovki may glyuchok: when assembly is an error, while the line looks fine. Here you just get on that line and push anything other than the cursor up and down. For example, you can simply press ss / u or y. 8 The End. Well, all over this destructive work tamping helra, you can now relax and admit that all the help and all Xas Max Petrov wrote from St. Petersburg to January 1996 phone 598 0159 (for which can be reported Gluck). And also to say that perekoderovschik written hacker Cris, it seems not without help his virtual brother Johna Stunnera. Thank them for that, because during the Scriptures they caught some glyuchkov in Xase. Johnnu Another thanks for the acceleration of Pts. small, but very good. important protsedurki, which resulted in increasing the speed of assembly by 15% compared with baseline, but most of all I thank him because it led me to the acceleration the thought of an even greater acceleration, and I've got another 32-percent reduction in assembly time, ... As a result, the expense of our benefit increased by half. And finally to convey greetings and wishes happy new year all users, players, hackers and sympathetic. Max Petrov (hpm) 01.96-05.96 SPb. _________________________________________ Questions? As the saying goes, try again. On braking after loading xasa: He zapachen trushem, which is a little brake ... (Only *) Max Petrov (hpm) 05.96 SPb. _________________________________________
Other articles:
Similar articles:
В этот день... 23 November