A86: Almost There


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

A86: Almost There




I have been reading the tutorials regarding the Custom menu, but this
has got me stumped:
#include "ti86asm.inc"

.org _asm_exec_ram

        ld hl,Slot1   ;First entry
        ld de,$d1e3             ;_custmnames=space reserved for custom
entries
        ld ($d1c5),de           ;put pointer in first spot
        ld bc,7         ;length of string AShell is only 6 bytes, should
this be a 6?
        ldir                    ;copy the string to the reserved space


        ld hl,Slot2        ;Second Entry
        ld de,$d1e3
        ld ($d1c7),de        ;2 bytes per slot, 5+2=7
        ld bc,4                ;I have 4 here because Asm is 3 bytes+1=4

        ldir

 ret

Slot1:
        .db $00         ;$00 doesn't add any spaces or ('s
        .db "AShell",0

Slot2:
         .db $60         ;Put a "("
        .db "Asm",0


.end

Here's the problem. With the string lengths as 7 and 4 respectively, it
puts "Asmel" in slots 1 and 2. With the string lengths 6 and 3, it puts
"AShell" in slots 1 and 2. With 7 and 3, Both slots are "AShell". With 6
and 4, I get "Asmel" how do I get Ashell in one and Asm in the other??



Follow-Ups: