• Welcome to Schneider / Amstrad CPC Forum.
Welcome to Schneider / Amstrad CPC Forum. Please login.

16. July 2025, 00:33:39

Login with username, password and session length

Shoutbox

TFM

2024-04-08, 20:42:44
Happy Sonnenfinsternis!  :)

TFM

2024-01-15, 17:06:57
Momentan billige Farbbänder auf Ebay für PCW

Devilmarkus

2023-07-09, 10:37:40
Zweiter 👋😂🤣

TFM

2023-06-13, 14:21:49
Sommerloch!

Recent

Members
  • Total Members: 223
  • Latest: dietmar
Stats
  • Total Posts: 12,316
  • Total Topics: 1,430
  • Online today: 519
  • Online ever: 1,724
  • (16. January 2020, 00:18:45)
Users Online
Users: 1
Guests: 440
Total: 441

440 Guests, 1 User
HAL6128

textdaten durchlaufen mit pointer

Started by BadCPC, 22. May 2025, 18:15:14

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

BadCPC

Hallo meine Spezialisten, hab da wohl wieder einen denkfehler.
Schreibe gerade eine Routine die eine Zeichenkette hl auf zeichen >=&80 durchlaufen soll, und den text ab a=x als pointer. irgendwo hackt es; mit ld b,a und djnz hab ich schon probiert grübel
bei a=0 kommt ja "hallo" raus, bei a=1 soll "ich" rauskommen usw.

währe für hilfe dankbar.


org &A000
ld a,2
call &BC0E
ld a,2 ; textabschnitt in messages
;ld hl,messages
call find_messages
ret

find_messages
;a = counts do txt

ld hl,messages
;push hl

cp 0
jr z,show_text
sub &1
ld b,a

ld c,0
ld a,0
next_string
push af
push bc
;-------------
next_char
ld a,(hl)
cp &A0
;push af
jr nc,greater_80
;pop af
inc hl
jr next_char

greater_80
pop af
pop bc
inc a
cp b

jr nc, next_string
inc hl

jp show_text
ret

show_text
ld a,(hl)
cp &A0
jr nc,fin_txt
push hl
call &bb5a
pop hl
inc hl

jr show_text
fin_txt
sub &80
jp &bb5a
ret

messages
db "Hall","o" +&80 ;0
db "ich"," " +&80 ;1
db "bin"," " +&80 ;2
db "ein"," " +&80 ;3

BadCPC

so hat sich erledigt , war mal wieder schneller im kopf als angebracht ;)