flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
rea 28 Feb 2005, 18:01
Why not you make some functions for check if a character is:
A-Z a-z 0-9 punctuiation (, . : ; ) symbol ( (, ), [, ], {, }) space and termination of string After you are done, you can use those for make a little parser ![]() About the full code, well there is fasm ![]() |
|||
![]() |
|
gumletis 02 Mar 2005, 08:52
fuck me! i didn't even see that the source was also realeased
![]() == EDIT == PS i know how to check where a symbols is, ex(not sure if it work, im not with my home computer so can't test it) Code: getsymbol: ; Find the first symbol al in si, and return cx as the number mov cx,0x-1 @@: inc cx cmp byte[si+bx],al jne @B RET its easy to do that.... _________________ LOOOL |
|||
![]() |
|
rea 04 Mar 2005, 02:28
I supose this one can be a "start".
Code: org 0x100 section .text start: mov bx, buffer call GetLine call PrintNL call Print call PrintNL call FindSpaceEnd mov ah, 0 int 0x21 GetLine: mov ah, 0x1 push di xor di, di .getNextChar: int 0x21 cmp al, 0xD jz .fin mov [bx+di], al inc di jmp .getNextChar .fin: xor ax, ax mov [bx+di], al pop di ret Print: push si push dx xor si, si mov ah, 0x2 .printNextChar: mov dl, [bx+si] cmp dl, 0 jz .end int 0x21 inc si jmp .printNextChar .end: pop dx pop si ret PrintNL: push bx mov bx, NL call Print pop bx ret NL db 13,10,0 FindSpaceEnd: xor si, si mov ah, 0x2 mov dx, si .nextSpace: mov dl, [bx+si] cmp dl, 0 jz .end cmp dl, " " jnz .print_ln .nextSpace1: inc si jmp .nextSpace .print_ln cmp dh, 0 jz .chars0 call PrintNL .chars0: mov dh, 1 .chars: int 0x21 inc si mov dl,[bx+si] cmp dl, " " jz .nextSpace1 cmp dl, 0 jz .end jmp .chars .end: ret section .bss buffer resb 64 Note that you must change some things for getit in fasm, altought not much, specially the sections. I will make a diferent one that can say if is a number and other things.... How you go? |
|||
![]() |
|
gumletis 05 Mar 2005, 09:28
okay, just hate winrar, ps thanks, ill look at it
_________________ LOOOL |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.