A86: Re: creating strings


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

A86: Re: creating strings




>Can someone please explain to me how to create an external string
>variable  using the _CREATESTRNG call?


 ld hl,string_info                 ;load string token, name length, name
into hl
 rst 20h                               ;put it into OP1
 ld hl, code_end - code    ;ld the size of the data to allocate for the
string
 call $472F                        ;make the string
 ld a,b                                               ;set up destination
address
 ex de,hl                                           ;|
 call $4c3f                                        ;|
 call _SET_ABS_DEST_ADDR  ;V
 xor a                                                ;set up the number of
bytes to copy
 ld hl,code_end - code                   ;|
 call _SET_MM_NUM_BYTES    ;V
 xor a                                               ;set up the source
address
 ld hl,code                                       ;|
 call _SET_ABS_SRC_ADDR   ;V
 call _mm_ldir                               ;copy the # of bytes in
mm_num_bytes from abs_src_addr to abs_dest_addr


string_info:
.db $0C,$6                ;always $0C (thats the string token), string
length
.db "string",0             ;string name, 0 terminated

code:
 .db "This will be in the string. "
 .db "You can use characters too:"
 .db $10
 .db " is the sqrt sign"
code_end: