; »»»»»»»»»»»»»»»»»»»»»»»»»» Virus Detection Program «««««««««««««««««««««««««««««« ; ; This is a little detection program that I wrote. All it does is ; scan through the programs on the calc and looks for one called 'VIRUS' ; If it is there it tells you, if not then it also tells you. ; I tried to explain as much stuff as possible, if you don't understand anything ; just email me and I'll try to help you out. Please understand that I am still ; learning also. ;-] ; ; ______________________________________________________________________________ ; ; »» You are free to use this but a little thanks to me would be appreciated. «« ; ______________________________________________________________________________ ; ; ; Please send all questions to Jimmy Conner at »»TIMagic@yahoo.com«« ; http://www.angelfire.com/tx/timagic/ TI-82/83 Page .NOLIST ; Required #define equ .equ ; Include these so the program will compile right #define EQU .equ ; '' '' '' '' '' '' '' '' #define END .end ; '' '' '' '' '' '' '' '' #define length 8265h ; My var for the length of the program name #define prog 8266h ; My var for if it found the program or not #include "ti83asm.inc" ; Include these so the program will compile right #include "tokens.inc" ; '' '' '' '' '' '' '' '' .LIST ; Required .org 9327h ; ALL TI-83 Programs start here in memory call _clrLCDFull ; Clear Screen call _runIndicOff ; Turns off Runindicator set textinverse, (iy+textflags) ; Toggle text inverse on call _homeup ; Goto 0,0 of screen ld hl,timagic ; Load String Jimmy's AntiVirus call _puts ; Output it to screen res textinverse, (iy+textflags) ; Reset text inverse (off) call _newline ; New Line call _newline ; New Line detect: ld hl, (progptr) ; Start here to look for programs` ld a, 0 ; You have to load it into 'a' before into an address ld (prog), a ; Do this so later we'll know if it found it startdetect: ld a,(hl) ; Get the type and %00011111 ; need to mask out bits 0-4 cp $06 ; Is it a protected program? jp z, program ; If so jump to the program cp $05 ; Is it a program, but not protected? jp z, program ; If so jump to the program cp $01 ; Is it a list? jp z,list ; If so jump to the list loop cp $0D ; Is it a complex list? jp z,list ; If so jump to the list loop ld a, (prog) ; Reload the 'found it' variable cp 1 ; Did it find it? jr z, pf ; Yes jr nz, pnf ; No ret ; Nothing left so quit program: dec hl ; move to ptr (skip var type) dec hl ; move past fisrt ptr dec hl ; move past second ptr to the name length push hl ; Store it for later ld a, (hl) ; Put the length in 'a' ld (length), a ; Store the length for later cp 5 ; Five letters in name? jp nz, nextprog ; If not then it isn't it so goto the next program ; OK we know that it has five letters so now will ; the letters be the same? dec hl ; First letter ld a, (hl) ; Load the first letter cp 56h ; V? jp nz, nextprog ; Nope isn't right letter dec hl ; Second letter ld a,(hl) ; Load the second letter cp 49h ; I? jp nz, nextprog ; Nope isn't right letter dec hl ; Third letter ld a,(hl) ; Load the third letter cp 52h ; R? jp nz, nextprog ; Nope isn't right letter dec hl ; Forth letter ld a,(hl) ; Load the forth letter cp 55h ; U? jp nz, nextprog ; Nope isn't right letter dec hl ; Fifth letter ld a,(hl) ; Load the fifth letter cp 53h ; S? jp nz, nextprog ; Nope isn't right letter ld a, 1 ld (prog), a ; It found it if it got this far so store 1 to 'prog' jp nextprog ; let it finish searching pf: ; This place is were it outputs that it found it. ld hl, progfound ; Load the text call _puts ; Output it call _newline ; Go to the next line ld hl, inprogram ; Load the text call _puts ; Output it call _newline ; Go to the next line set textinverse, (iy+textflags) ; Toggle text inverse on ld hl, VIRUS ; Load the text call _puts ; Output it res textinverse, (iy+textflags) ; Toggle text inverse on ret pnf: ; This place is were it outputs that it didn't find it. set textinverse, (iy+textflags) ; Toggle text inverse on ld hl, prognotfound ; Load the text call _puts ; Output it res textinverse, (iy+textflags) ; Toggle text inverse on call _newline ; Go to the next line so when it displays 'DONE' ret nextprog: pop hl ; Go back to the length list: dec hl ; lists enter here to be skipped dec hl ; Skip the last part of the pointer dec hl ; should be at the length ld b, (hl) ; load that so we can loop past it list2: dec hl ; dec hl to goto next letter in name djnz list2 ; loop until the end of the name dec hl ; should be at the next item jp startdetect ; go find next item timagic: .db "Jimmys AntiVirus", 0 ; 0 terminated string for display Progfound: .db " Virus detected", 0 ; 0 terminated string for finding the program inprogram: .db " In the Program", 0 ; 0 terminated string for finding the program virus: .db " VIRUS ", 0 ; 0 terminated string for finding the program prognotfound: .db " No Virus found ", 0 ; 0 terminated string for not finding the program .end END ; ; You have to remember that when you search for a list that the last bit in ; the name is the formula number, if there isn't one then it is 0. So if you ; calculate the length of the name in your head, add 1 and check for a zero ; at the end of the name. ; ; »»»»»»» TIMagic@yahoo.com «««««««