This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 13 Oct 2003 06:40:15 pm    Post subject:

I know how to store input as a string in APPBACKUPSCREEN, I learned from the Input routine on Cirrus. But say I wanted to make a password program, the password itself was built into the prog. Is there a way to say maybe:


Code:
...the user has already input his password...

ld hl, appbackupscreen
ld de, password
-->(compare hl to de)<--
jr z, success
ret

success:
etc...

password:
.db "passw",0


Or is there another way to make a password program with SMC maybe?
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 13 Oct 2003 07:26:19 pm    Post subject:

bcall(_cpHLDE) or the other way around bcall(_cpDEHL) think its the first though...

that should work, but you would have to check if the WHOLE pword is the same... that would just check if the locations are the same...
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 13 Oct 2003 07:37:26 pm    Post subject:

How would I check the whole password (Im new at asm, so stupid questions abound when i post) lol
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 14 Oct 2003 05:20:22 pm    Post subject:

how about:

ld de,string1
ld hl,string2
ld b,8
call(mystrroutine)
; if Z is set, strings match, else NZ set


mystrroutine:
ld a,(de)
cp (hl)
ret nz
inc de
inc hl
djnz mystrroutine
ret
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 20 Oct 2003 04:52:26 pm    Post subject:

Optimized somewhat


Code:
  ld de,string1
  ld hl,string2
  ld bc,8
  call mystrroutine
; if Z is set, strings match, else Z reset


mystrroutine:
  ld a,(de)
  cpi
  ret nz
  inc de
  jp pe,mystrroutine
  ret


Last edited by Guest on 20 Oct 2003 04:53:12 pm; edited 1 time in total
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 21 Oct 2003 07:44:57 pm    Post subject:

or just by using bcall(_cmpsyms) if the strings are the same length, checking that by using bcall(_strlength)
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement