Re: A89: Re: compilers


[Prev][Next][Index][Thread]

Re: A89: Re: compilers




Just get rid of the # and it will work.  a # is indicating an immidiate value,
not an address. what you are trying to say to the cpu here is that you want to
put the number %10101010 into the number $4c00. ofcourse this is not possible.
(like trieing to put a pear into an apple.  you put pears or apples in boxes or
bags, not into eachother)

if you write like this instead:

move.b #%10101010,$4c00
or
move.b #%10101010,($4c00)

(it is equivalent)

you are telling it to put the number %10101010 into the memory at address $4c00.
this will work much nicer :)

//Olle

Zeromus Mog wrote:
> 
> If you've ever seen Motorola's manual, you'll notice that there's a bunch of
> charts and stuff explaining the syntax of an opcode in 1's and 0's, like
> where the register name in binary fits in, etc. All those little add.l's and
> mulu.w's and whatnot are put into a long string of 1's and 0's.
> 
> That brings me to a VERY important question... how come I cannot read or
> write from numerical address in as92? If I tell it:
> 
> : move.b #%10101010,#$4c00
> 
> or even
> 
> : clr.l d0
> : move.b #%10101010,d0
> : move.b d0,#$4c00
> 
> Including every single variaion of #'s and parenthesis I can think of (such
> as #($4c00)   ), no matter what I do, I CANNOT get the silly thing to do
> this without copying the address to an address register first, which is a
> major pain. Am I doing something wrong?
> 
> On a related note, I can't get this to work, either:
> 
> :text1: dc.b "Hello!",0
> :text2: dc.b "World!",0
> :text3: dc.b "It's Me, Zeromus!",0
> :
> : dc.l text1,text2,text3
> 
> When I go to check what's wrong, the cursor is placed between the 't' and
> the 'e' in 'text1'. Of course, without this, lookup tables don't work at
> all. Any idea at all what's wrong, anyone? Is it me, or the compiler?
> 
> -Zero
> 
> ----- Original Message -----
> From: Zoltan Kocsi <zoltan@bendor.com.au>
> To: <assembly-89@lists.ticalc.org>
> Sent: Thursday, November 04, 1999 2:56 PM
> Subject: A89: compilers
> 
> >
> > Lynn McCartney writes:
> >  > Could some one please tell me what a compiler does exactly?  I would
> greatly appreciatte the help I get.  Thanks for your trouble.
> >
> > A compiler is a program that translates a program expressed in some
> > computer language into an other, usually simpler computer language.
> >
> > In this regards a computer language is mostly anything that can
> > describe operations done by a computer. In addition, computer
> > languages are usually context free (for computers and mathematics in
> > general have very limited capabilities in the context-dependent
> > field).
> >
> > Your C compiler, for example, reads a source written in the C language
> > and generates either assembly language output or direct object code.
> >
> > An interesting exception is that the compiler from assembly language
> > (which is the human-readable machine language language closest to
> > machine code, i.e. numbers) is invariably called an assembler.
> >
> > Often compilers are used in succession to compile something that's
> > complex or fairly abstract to machine code. The C language belongs to
> > the high-level languages, but it is one of the lowest level in that
> > group. It is often the case that a higher level high-level language is
> > compiled to C, then it is compiled to assembly then it is assembled to
> > machine code.
> >
> > There are even trickier things, like yacc (standing for yet another
> > compiler compiler) which is a compiler that compiles the yacc language
> > to C. The yacc language is a language designed to describe the parsing
> > part of compilers. So when you define a language, you describe the
> > language in yacc and tell yacc how to generate various say FORTRAN
> > constructs from your language. Yacc then generates a C code, you
> > compile it and then you get a program which is a compiler that can
> > reads programs written in your language and translates them to FORTRAN
> > which you then can compile to assembly then machine code. There are
> > much hairier scenarios sometimes. Mind boggling, isn't it :-)
> >
> > On a different note, it is generally accepted as a polite and
> > intelligent behaviour on the Net not to use HTML or any format
> > other than ASCII in email, mailing lists and USENET postings
> > and to turn on word wrap at around 72-76 characters.
> >
> > Regards,
> >
> > Zoltan
> >
> >


Follow-Ups: References: