Re: A83: Calling All Great Programers Part III !!


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

Re: A83: Calling All Great Programers Part III !!




You can't add 2 to hl like that.  'ADD hl,nnnn' doesn't exist.  Instead:

ld bc,2
add hl,bc

(you can add bc, de, or hl to hl)


For lists and constant offsets, use the nice IX register:

ld ix,Table
;Insert code to add an offset to ix here
ld a,(ix+3) ;get element 3
ld b,(ix+0) ;get element 0





>From: Mike3465@aol.com
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: Re: A83: Calling All Great Programers Part III !!
>Date: Mon, 5 Feb 2001 15:01:20 EST
>
>
>woops didn't see the rest of the talk
>4: Ok in asm, there are 2 types: chars and shorts
>chars are the .db(1 byte in memory(8 bits, etc))
>shorts are the .dw(2 bytes in memory(16 bits, etc))
>reals are covered in the op1-op6 if i'm not mistaken
>I have no idea why you would need a complex value in a program
>
>5:to do lists:
>define a list that is....5 bytes big(5 chars, 0-255)
>do this:
>
>list:
>     .db 0,0,0,0,0
>
>now to call lets say...the third you do this:
>ld hl, list     ;load the location in memory of the list, yes if i wanted 
>the
>value
>                 ;i would go ld hl,(list) but I"m not doint that, I'm 
>getting
>the address
>                 ;of the list
>add hl,2        ;move to the third spot in memory, yes i realise i only 
>added
>2
>                 ;because the inital spot includes some memory, thats why
>lists in
>                 ;c and c++(well that i know of) all start at 0
>ld a,(hl)           ;load the value from location hl to var a
>
>that would get you the 3rd number from an array of 5
>
>I don't know about anything of the other questions
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com