Re: A86: ld HL call


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

Re: A86: ld HL call






>From: BlAsTo1414@aol.com
>Date: Mon, 14 Sep 1998 00:11:47 EDT
>To: assembly-86@lists.ticalc.org
>Subject: A86: ld HL call
>Reply-To: assembly-86@lists.ticalc.org
>
>
>ok,
>
>I saw in an example prog the folowing code:
>
>
>	call _clrLCD	; clear the screen
>	ld hl, $0000	; stores $00 in h, $00 in l
>	ld (_curRow),hl	; stores 0 in _curRow, 0 in _curCol
>	ld hl, Hello	; hl points to string Hello
>	call _puts		; print the string
>	ld a, '!'		; load ! character in A
>	call _putc		; print '!'
>	call _newline	; go to next line
>	ret				; return from program
>
>
>The seconline of that reads:
>	ld hl, $0000
>is that making sure that 'hl' has nothing in it so that the next 
command:
>	ld hl, Hello
>can make hl be whatever 'hello' is?
>
>also,  what does this mean:?
>	call _putc
>is that putCHARACTER?
>and putS is putSTRING?
>
>but how does 'putc' know to read the character in 'A'?
>
>just a few questions,
>BlAsTo1414
>

No the $0000 sets the cursor position to 0,0 (upper left corner).  
Notice how after $0000 is put into hl its then loaded to (_curRow) so 
that the cursor is moved to that spot.  And even if hl has something in 
it I beleive if you load something into hl it'll just overwrite what was 
already there with the new data.  If you look at the comments and read 
them out as a sentence it usually tells you very clearly what is 
happening (notice I said usually not always).  And you were right about 
the _puts and _putc things.  Also -putc knows to use the a register 
because that is what is programmed to do.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com