flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Dex4u 29 Aug 2007, 03:51
Take a look at my MiniDos demo/tut, it has full commented code to do what you want: http://board.flatassembler.net/topic.php?t=5275&start=0
quick example Code: ;====================================================;; CLS. compare command buffer with 'cls' ;;====================================================; mov si,CommandBuffer ; Move the address of CommandBuffer in SI mov cx,4 ; Move number of letters into CX mov di,cCLS ; Point to label repe cmpsb ; Test if =. jne not_cls ; If not =, jump to label not_cls call Cls ; call our function call Cursor ; call our function call Welcome ; call our function jmp ExitFound ; Jump to label ExitFoundnot_cls:;====================================================;; TIME. compare command buffer with 'time' ;;====================================================; mov si,CommandBuffer ; Move the address of CommandBuffer in SI mov cx,5 ; Move number of letters into CX mov di,cTIME ; Point to label repe cmpsb ; Test if =. jne not_time ; If not =, jump to label not_time call Time ; call time function jmp ExitFound ; Jump to label ExitFoundnot_time:;more stuff herecCLS db 'CLS',0cTIME db 'TIME',0 Note: you need to convert them to uppercase before testing, just in case they write them in upper case. |
|||
![]() |
|
dosin 29 Aug 2007, 05:17
TY - The problem was I was using bx to count the number of chars entered and was moving it into cx...and then comparing them...
I altered my code to mov cx,5 for -help and so on and it works great! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.