flat assembler
Message board for the users of flat assembler.
Index
> DOS > Problems comparing strings or characters |
Author |
|
b1528932 14 Feb 2011, 08:56
Quote: strings or characters No, not characters. Bytes. String of bytes. you do not initialize sp, any reason? Why you touch ss anyway, wont dos init ss:sp for you anyway? You have to assemble ur program at 0x100, you know? Its the address dos will load it. 0-0x100 contain PSP. about cmd line, read http://en.wikipedia.org/wiki/Program_Segment_Prefix |
|||
14 Feb 2011, 08:56 |
|
DOS386 14 Feb 2011, 08:58
Quote: I'm making a small program I found a small program would be more true ? Quote: it doesnt seem to work Because it is MA$M code, not FASM. Please study the FAQ on the thread top. Code: ; FASM code - testing REPE CMPSB instruction ; Untested, at your own RISK !!! format binary as "COM" org $0100 use16 cld mov dx, xyes mov si, var1 mov di, var2 mov cx, 1 repe cmpsb jz qqyes mov dx, xnot qqyes: mov ah, 9 int $21 mov ax, $4C00 ; Terminate COM or MZ EXE int $21 ;------ var1: db 'A' var2: db 'A' xnot: db "NOT EQUAL$" xyes: db "YES EQUAL$" Simple, isn't it ? > about cmd line, read http://en.wikipedia.org/wiki/Program_Segment_Prefix Look at address $80 (relative to PSP begin, and in DOS COM (not in DOS MZ EXE) to CS:ZERO) for ("length"+1) and $82 start of the string (max 125 char's). |
|||
14 Feb 2011, 08:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.