what is this in asm

.db sk0
.db sk0
.db sk0
.db sk0


Full code:

Code:
.nolist
   #include "ti84pce.inc"
   #define RED $F800
   #define NAVY $0010
   #macro bcall(x)
      call x
   #endmacro
#define MBASE_OFFSET $D00000
.list
   .org userMem-2
   .db tExtTok,tAsm84CeCmp

PasswordStart:
   bcall(_EnableAPD)
   ld a,1
   ld (apdTimer),a
   ld (apdSubTimer),a
   set apdRunning,(iy+apdFlags)
   bcall(_ClrScrnFull)
   bcall(_HomeUp)
   ld hl,PressText
   bcall(_PutS)
   bcall(_NewLine)
   bcall(_NewLine)
   ld de,RED
   ld.sis (textBGcolor-MBASE_OFFSET), de
   set 4,(iy+PutMapFlags)
   bcall(_PutS)
   res 4,(iy+PutMapFlags)
   bcall(_NewLine)
   bcall(_PutS)
   ld bc,$03
   ld (penCol),bc
   ld a,$50
   ld (penRow),a
   ld bc,NAVY
   ld.sis (drawFGColor-MBASE_OFFSET),bc
   bcall(_vPutS)
   ld bc,$400
   ld hl,Password
KeyPress:
   call GetKey
   cp (hl)
   inc hl
   jr z,Asterisk
   inc c
Asterisk:
   ld a,'*'
   bcall(_PutC)
   djnz KeyPress
   dec c
   inc c
   jr nz,WrongPassword
   bcall(_ClrScrnFull)
   res onInterrupt, (iy + onFlags)
   ret
WrongPassword:
   ld hl,WrongPasswordMsg
   bcall(_NewLine)
   bcall(_PutS)
   bcall(_NewLine)
   bcall(_PutS)
   call GetKey
   jp PasswordStart

GetKey:
   push hl
   bcall(_GetCSC)
   pop hl
   or a
   jr z,GetKey
   ret

PressText:
   .db "This calculator belongs to****** ***********.",0
   .db "(***) ***-****",0
   .db "Password: ",0
   .db "******.***********@*******.com",0
WrongPasswordMsg:
   .db "Wrong password!",0
   .db "Press a key to turn off   the calculator.",0

Password:
   .db sk0
   .db sk0
   .db sk0
   .db sk0
I mean I and others know what it means but we will need context to explain.
I know ur a (ti)basic person so here's how I'll explain it.
So lets say you know there is a password 4 digits long and you cant use input, only getkey.
So you have 2 lists, 1 for input and 1 for the password.
Now you could have the actuall numbers of the password in the password list but then for input you have to convert the input to its number, store it, and check at the end. If you just store the keypress numbers in the password list instead, you save time by not having to convert the input first then storing it, you can just store it and compare at the end.
the code came from here: buh and I have absolutely no clue what you are saying, sorry.
.db is an assembler directive, which means that it's not a "real" instruction that the processor can execute but is telling the assembler what to do. "db" is short for "define byte", and it causes the assembler to output a single byte into the output program based on its argument. Day 2 of 83pa28d has a bit more information.

In this case the argument is sk0, which is a define from the ti84pce.inc include file whose value is the scan key code for the 0 key. There are also corresponding defines sk1 through sk9, as well as for other keys on the keyboard (e.g. skPrgm for the prgm key).

These bytes store the password that what the user enters will be compared to, so the password in this case is "0000". You can change the password by changing which defines each .db directive uses.
I wrote a password tool in C++, so you could read its code. https://github.com/Lord-Funion/CE-Menu-Locker.
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement