Re: A86: Asm newbie question Part 2


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

Re: A86: Asm newbie question Part 2




Ok, if you have a number that you just POPed into BC, and you want to
display it, then you want to move the value in BC into HL, and zero out A so
that AHL is equal to what BC was.  AHL is a 24-bit register pair (somewhat
makeshift - the CPU does not directly support it).  In plain assembly, you
want to do the following:

 ld l,c     ;copy the lower byte of BC into HL
 ld h,b    ;copy the upper byte of BC into HL
 xor a     ;zero out A.  I'm a little rusty at asm, and not sure if this one
is exactly correct...
 call $4a33   ;display AHL


Matt Gabbert wrote:

> Robby Gutmann wrote:
>
> > you can't do "ld hl,bc"  you have to do "ex de,hl"  (or maybe switch
> > the order, not sure).  this command exchanges the values in hl and de.
>
> I tried this:  (just the end of a section of code)
>
>         ld a,5
>         ld (_curRow),a
>         ld a,5
>         ld (_curCol),a
>         ld de,300
>         ex de,hl
>         call _getkey
>
> but nothing appears...
>
> I tried:
>
> load h into a, l into h, 0 into l and call $4a33
>
> (or at least what i could figure what this means) but then i got
> something like:
>
> 5033:
>
> where I wanted 300 to be displayed.
>
> ALSO, i'd appreciate it if you would write out the code as I would enter
> it instead of me trying to guess what some of it means, and tell me what
> calls like $4a33  are (I couldnt find it in ti86asm.inc)
>
> Matt



--
Stephen Hicks
mailto:shicks@mindspring.com
UIN:5453914
AIM:Kupopo1



References: