Lots of trouble with Assembler

I don't follow everything in this language.. i'm presently of the opinion that i'm only taking it in class because I have no choice. I understand the importance of knowing how a computer works, but you'd figure for such an important class they'd give us a teacher who knows how to communicate the ideas well.. however this is not the case for example he gave us an assignment today which is as follows:


/*Begin Assignment*/
Write an external assembler procedure, _ucase, which, when passed the address of a null-terminated string, accomplishes the following:

1. Removes all non-alpha-numeric characters
2. Changes all lower case letters to upper case

The result should be written back to the original string (one byte at a time), and the string terminated with a null byte.

Test your procedure using a string consisting of at least the following characters: "/09:@AZ[`az{"

use: str byte "/09:@AZ[`az{", 0 to create a null terminated string.

/*End Assignment*/

Now there's a couple of key things he missed with us.. such as UCase for example.. didn't bother saying a word about it.. just expects us to use it I guess.. I have no earthly idea where to begin. I just want to find a way to pass the class.

He spent most of today before the assignment just talking about stacks.. though I fail to see much relation in the stacks and this assignment short of the pass by reference.

Anyone help?
Thanks in advance,
Waylander420
«1

Comments

  • : I don't follow everything in this language.. i'm presently of the opinion that i'm only taking it in class because I have no choice. I understand the importance of knowing how a computer works, but you'd figure for such an important class they'd give us a teacher who knows how to communicate the ideas well.. however this is not the case for example he gave us an assignment today which is as follows:
    :
    :
    : /*Begin Assignment*/
    : Write an external assembler procedure, _ucase, which, when passed the address of a null-terminated string, accomplishes the following:
    :
    : 1. Removes all non-alpha-numeric characters
    : 2. Changes all lower case letters to upper case
    :
    : The result should be written back to the original string (one byte at a time), and the string terminated with a null byte.
    :
    : Test your procedure using a string consisting of at least the following characters: "/09:@AZ[`az{"
    :
    : use: str byte "/09:@AZ[`az{", 0 to create a null terminated string.
    :
    : /*End Assignment*/
    :
    : Now there's a couple of key things he missed with us.. such as UCase for example.. didn't bother saying a word about it.. just expects us to use it I guess.. I have no earthly idea where to begin. I just want to find a way to pass the class.
    :
    : He spent most of today before the assignment just talking about stacks.. though I fail to see much relation in the stacks and this assignment short of the pass by reference.
    :
    : Anyone help?
    : Thanks in advance,
    : Waylander420
    :

    Just use jumps to determine if it is a symbol, lowercase, or uppercase letter. Write functions for those jump conditions to perform the actions requested by the assignment, and to convert the lower case to upper case, I would probably just subtract the ascii value by 32 or 20h to get the upper case value of the character. I would assume the stack would be for the value's you would like to keep(push) to be re-assembled later(pop). See if that will get you started;however, I don't think anyone's going to do your homework for you on this board. It's best to learn by trail and error than anything else in my opinion.
  • : : I don't follow everything in this language.. i'm presently of the opinion that i'm only taking it in class because I have no choice. I understand the importance of knowing how a computer works, but you'd figure for such an important class they'd give us a teacher who knows how to communicate the ideas well.. however this is not the case for example he gave us an assignment today which is as follows:
    : :
    : :
    : : /*Begin Assignment*/
    : : Write an external assembler procedure, _ucase, which, when passed the address of a null-terminated string, accomplishes the following:
    : :
    : : 1. Removes all non-alpha-numeric characters
    : : 2. Changes all lower case letters to upper case
    : :
    : : The result should be written back to the original string (one byte at a time), and the string terminated with a null byte.
    : :
    : : Test your procedure using a string consisting of at least the following characters: "/09:@AZ[`az{"
    : :
    : : use: str byte "/09:@AZ[`az{", 0 to create a null terminated string.
    : :
    : : /*End Assignment*/
    : :
    : : Now there's a couple of key things he missed with us.. such as UCase for example.. didn't bother saying a word about it.. just expects us to use it I guess.. I have no earthly idea where to begin. I just want to find a way to pass the class.
    : :
    : : He spent most of today before the assignment just talking about stacks.. though I fail to see much relation in the stacks and this assignment short of the pass by reference.
    : :
    : : Anyone help?
    : : Thanks in advance,
    : : Waylander420
    : :
    :
    : Just use jumps to determine if it is a symbol, lowercase, or uppercase letter. Write functions for those jump conditions to perform the actions requested by the assignment, and to convert the lower case to upper case, I would probably just subtract the ascii value by 32 or 20h to get the upper case value of the character. I would assume the stack would be for the value's you would like to keep(push) to be re-assembled later(pop). See if that will get you started;however, I don't think anyone's going to do your homework for you on this board. It's best to learn by trail and error than anything else in my opinion.
    :


    I didn't want someone to do my homework :P I just didn't really know how to start it. Thanks for the help though.
  • : : : I don't follow everything in this language.. i'm presently of the opinion that i'm only taking it in class because I have no choice. I understand the importance of knowing how a computer works, but you'd figure for such an important class they'd give us a teacher who knows how to communicate the ideas well.. however this is not the case for example he gave us an assignment today which is as follows:
    : : :
    : : :
    : : : /*Begin Assignment*/
    : : : Write an external assembler procedure, _ucase, which, when passed the address of a null-terminated string, accomplishes the following:
    : : :
    : : : 1. Removes all non-alpha-numeric characters
    : : : 2. Changes all lower case letters to upper case
    : : :
    : : : The result should be written back to the original string (one byte at a time), and the string terminated with a null byte.
    : : :
    : : : Test your procedure using a string consisting of at least the following characters: "/09:@AZ[`az{"
    : : :
    : : : use: str byte "/09:@AZ[`az{", 0 to create a null terminated string.
    : : :
    : : : /*End Assignment*/
    : : :
    : : : Now there's a couple of key things he missed with us.. such as UCase for example.. didn't bother saying a word about it.. just expects us to use it I guess.. I have no earthly idea where to begin. I just want to find a way to pass the class.
    : : :
    : : : He spent most of today before the assignment just talking about stacks.. though I fail to see much relation in the stacks and this assignment short of the pass by reference.
    : : :
    : : : Anyone help?
    : : : Thanks in advance,
    : : : Waylander420
    : : :
    : :
    : : Just use jumps to determine if it is a symbol, lowercase, or uppercase letter. Write functions for those jump conditions to perform the actions requested by the assignment, and to convert the lower case to upper case, I would probably just subtract the ascii value by 32 or 20h to get the upper case value of the character. I would assume the stack would be for the value's you would like to keep(push) to be re-assembled later(pop). See if that will get you started;however, I don't think anyone's going to do your homework for you on this board. It's best to learn by trail and error than anything else in my opinion.
    : :
    :
    :
    : I didn't want someone to do my homework :P I just didn't really know how to start it. Thanks for the help though.
    :
    [blue]That is quite easy. First of all you have to defuse some problems, like:

    1. How to keep the original string and modified string in one place - same buffer as assignment specifies. The answer is that you keep two pointers which point at the beginning of the string before processing. Since you are removing symbols - your reading pointer will be always ahead (or equal to) of the writing pointer, so the string will not lose its symbols.

    2. Now, you have to write the algorithm of your task with pseudo-code - something which can be easily looked upon at one glance, like so:

    [code]
    1. Set up both addresses to the beginning of a string:
    addr_read_char = string_begins
    addr_write_char = string_begins

    2. Load symbol from addr_read_char and move
    this addr_read_char to the next symbol

    3. If symbol from step 2 is a terminating null character
    (it is just zero value) then go to FINAL step.

    4. If symbol from step 2 is a lower case letter, then
    modify it to be uppercase and store it back (remember you have
    a 'addr_write_char'! - save and move it forward too, to prepare
    to store the next incoming symbol)

    5. If symbol from step 2 is non-alpha-numeric (i.e. not in range
    '0'..'9' and 'A'..'Z') then do not do anything and jump to
    step 2 to load the next symbol. Since the 'addr_write_char' is
    not moved - this will result in a skipped (removed) character -
    which is what you need here!

    6. At this point the symbol you loaded is definitely needed, so
    just write it at 'addr_write_char' and move the 'addr_write_char'
    forward. Then, again jump to step 2 to read another symbol.

    FINAL: here you will come if the null terminator was loaded, so
    the string ended - then again write the null at the 'addr_write_char',
    so your result string will be terminated.

    DONE!
    [/code]

    What is left now is only to clarify some points as how to load/save
    symbols in ASM and check their values. Here is some snippets:

    [code]
    ; --- The symbol loaded into AL register
    CMP AL, '0'
    JB CheckTheAlphaRange
    CMP AL, '9'
    JA CheckTheAlphaRange

    ; --- At this point the symbol in AL
    ; --- is a digit in range ['0'..'9']

    CheckTheAlphaRange:
    CMP AL, 'A'
    JB NotAlphaRange
    CMP AL, 'Z'
    JA NotAlphaRange

    ; --- At this point the symbol in AL
    ; --- is a symbol in range ['A'..'Z']

    [/code]

    Good luck!

    And if you want some further help, contact me at 'asmguru62@hotmail.com' - I am busy, but if I can find some 10 min hole in my schedule - I will help.[/blue]
  • [green]

    Check AL for A-Z then change tolower
    OR AL,00100000b ;= 32d = 20h, change AL to lower case

    Check AL for a-z then change toupper
    AND AL,11011111b ; = 223d = 0DFh, change AL to upper case

    The key is bit 5, if set it's lower case, else upper case or non alph.
    The bit wise code "AND OR" is fast, (& better than ADD or SUB ?)

    I hope that helps some how
    Bitdog
    [/green]

  • [b][red]This message was edited by Waylander420 at 2003-10-24 15:2:5[/red][/b][hr]
    : [green]
    :
    : Check AL for A-Z then change tolower
    : OR AL,00100000b ;= 32d = 20h, change AL to lower case
    :
    : Check AL for a-z then change toupper
    : AND AL,11011111b ; = 223d = 0DFh, change AL to upper case
    :
    : The key is bit 5, if set it's lower case, else upper case or non alph.
    : The bit wise code "AND OR" is fast, (& better than ADD or SUB ?)
    :
    : I hope that helps some how
    : Bitdog
    : [/green]
    :
    :

    Thanks for the help asmguru and bitdog: I have gotten most of that part working. (The string being changed to uppercase, now what i'm in the most need of is to figure out how to delete the symbols/non alphas and just move the string up into the place. Let me put the finishing touches on the code I have and i'll post it, that might make it easier to understand what i'm askin.

    Again thanks.


    /* Edit */

    As previously stated here is the source code.. what I need now is basically to find some information (or a line or two of code to insert) that will remove all non alpha numeric characters from the string. Here is the current code: This code accomplishes everything but removal of the non alpha chars.

    [code]
    ; title Simsc11.asm
    ; ***********************************************************************
    ; * *
    ; * Programmer Name : Chris Sims Date: 24-Oct-2003 *
    ; * *
    ; * Purpose/Description: Turns lower case letters at label srt into *
    ; * upper case letters at label fin *
    ; * *
    ; * Input/Output: None *
    ; * *
    ; * Special Requirements: None *
    ; * *
    ; * Register use: esi - points to source string *
    ; * edi - points to destination string *
    ; * ecx - loop counter *
    ; * al - holds byte being processed *
    ; ***********************************************************************

    .386
    .MODEL FLAT
    ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD
    PUBLIC _start

    ; ***********************************************************************
    ; * Data Segment *
    ; ***********************************************************************

    .DATA
    srt BYTE "/09:@AZ[`az{", 0 ; Null-terminated string to convert
    srtlen DWORD srtlen-srt ; Calculate length of srt string
    fin BYTE (srtlen-srt) dup ('*') ; Enough space to store string

    ; ***********************************************************************
    ; * Stack Segment *
    ; ***********************************************************************

    .STACK 4096

    ; ***********************************************************************
    ; * Code Segment *
    ; ***********************************************************************

    .CODE
    _start proc near32

    mov edi,offset fin ; prep srt(start) and fin(finish)
    mov esi,offset srt ; pointers

    lp_str: mov al,[esi] ; Get next character into al
    cmp al, 0 ; End of string?
    je endlp ; Yes - terminate string and end
    cmp al, 'a'
    jl skip
    cmp al, 'z'
    jg skip
    and al,11011111b ; No - convert char to upper case
    skip: mov [edi],al ; Store upper case letter
    inc esi ; Point to next character
    inc edi
    jmp lp_str ; Loop until all chars processed

    endlp: mov [edi],al ; Terminate string with ''
    EVEN
    exit: INVOKE ExitProcess, 0
    _start endp
    end
    [/code]


    Again for any who can help, thanks in advance.. it's a lifesaver.
    Waylander




  • : I need to remove all non alpha numeric characters from the string.

    Just move your SKIP: label to AFTER the save instruction

    [code]
    ;print any upper case alph
    CMP AL,'A'
    JB SKIP
    CMP AL,91 ;'Z'=90
    JB PRNT

    ;find, convert & print any lower case alph
    cmp al, 'a'
    jb SKIP
    cmp al, 'z'
    ja SKIP
    and al,11011111b ; convert char to upper case

    ; skip: ;old skip label saved all char's
    PRNT: mov byte [edi],al
    SKIP: ;new skip label doesn't save non alph characters
    [/code]
    Note, jg & jl are signed instructions? (check it?)
    So I use JA & JB, so do many professional programs that I've hacked, er learned from. If you debug your code you'll find JB where you wrote JC,
    and it appears lots (were ya wern't using it, it seems).
    So I gave in, 'n started abusing it toooooooooo.
    [green]
    Bitdog
    [/green]

  • : : I need to remove all non alpha numeric characters from the string.
    :
    : Just move your SKIP: label to AFTER the save instruction
    :
    : [code]
    : ;print any upper case alph
    : CMP AL,'A'
    : JB SKIP
    : CMP AL,91 ;'Z'=90
    : JB PRNT
    :
    : ;find, convert & print any lower case alph
    : cmp al, 'a'
    : jb SKIP
    : cmp al, 'z'
    : ja SKIP
    : and al,11011111b ; convert char to upper case
    :
    : ; skip: ;old skip label saved all char's
    : PRNT: mov byte [edi],al
    : SKIP: ;new skip label doesn't save non alph characters
    : [/code]
    : Note, jg & jl are signed instructions? (check it?)
    : So I use JA & JB, so do many professional programs that I've hacked, er learned from. If you debug your code you'll find JB where you wrote JC,
    : and it appears lots (were ya wern't using it, it seems).
    : So I gave in, 'n started abusing it toooooooooo.
    : [green]
    : Bitdog
    : [/green]
    :
    :

    Thanks for the assistance Bitdog however I've attached the code.. it seems not to be removing the symbols still.. everything else on it is working.. perhaps I made a mistake with what you meant.

    [code]
    ; title Simsc11.asm
    ; ***********************************************************************
    ; * *
    ; * Programmer Name : Chris Sims Date: 24-Oct-2003 *
    ; * *
    ; * Purpose/Description: Turns lower case letters at label srt into *
    ; * upper case letters at label fin *
    ; * *
    ; * Input/Output: None *
    ; * *
    ; * Special Requirements: None *
    ; * *
    ; * Register use: esi - points to source string *
    ; * edi - points to destination string *
    ; * ecx - loop counter *
    ; * al - holds byte being processed *
    ; ***********************************************************************

    .386
    .MODEL FLAT
    ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD
    PUBLIC _start

    ; ***********************************************************************
    ; * Data Segment *
    ; ***********************************************************************

    .DATA
    srt BYTE "/09:@AZ[`az{", 0 ; Null-terminated string to convert
    srtlen DWORD srtlen-srt ; Calculate length of srt string
    fin BYTE (srtlen-srt) dup ('*') ; Enough space to store string

    ; ***********************************************************************
    ; * Stack Segment *
    ; ***********************************************************************

    .STACK 4096

    ; ***********************************************************************
    ; * Code Segment *
    ; ***********************************************************************

    .CODE
    _start proc near32

    mov edi,offset fin ; prep srt(start) and fin(finish)
    mov esi,offset srt ; pointers

    lp_str: mov al,[esi] ; Get next character into al
    cmp al, 0 ; End of string?
    je skip ; Yes - terminate string and end
    cmp al, 'A'
    jb skip
    cmp al,91 ;'Z'=90
    jb PRNT
    cmp al, 'a'
    jb SKIP
    cmp al, 'z'
    ja SKIP
    and al,11011111b ; No - convert char to upper case
    mov [edi],al ; Store upper case letter
    skip: inc esi ; Point to next character
    inc edi
    jmp lp_str ; Loop until all chars processed

    PRNT: mov [edi],al ; Terminate string with ''
    EVEN
    exit: INVOKE ExitProcess, 0
    _start endp
    end

    [/code]

    If you see somewhere that I snafu'd it let me know. I appreciate it.
    [red]
    Waylander420
    [/red]

  • [b][red]This message was edited by xkgdiam at 2003-10-25 21:9:52[/red][/b][hr]
    [code]
    lp_str: mov al,[esi] ; Get next character into al
    cmp al, 0 ; End of string?
    ;je skip ; Yes (...) [b]but skip isn't send us back here ?[/b]
    je kill ; Yes - terminate string and [b]kill[/b]
    cmp al, 'A'
    jb skip
    cmp al,91 ;'Z'=90
    jb PRNT
    cmp al, 'a'
    jb SKIP
    cmp al, 'z'
    ja SKIP
    and al,11011111b ; No - convert char to upper case
    mov [edi],al ; Store upper case letter
    [b]inc edi ; valid al -> save,increase[/b]
    skip: inc esi ; Point to next character
    ;inc edi ;[b]why this, we have skiped[/b]
    jmp lp_str ; Loop until all chars processed
    PRNT: mov [edi],al ; Terminate string with ''
    ;[b]cmp al,91 (...) is a zero(?)[/b]
    inc edi ;[b]no but [A...Z], valid then[/b]
    jmp lp_str
    [b]kill:[/b]
    mov [edi],0 ;[b]from : cmp al,0[b]
    [/code]

    ..now , a question :
    ..what is the EVEN command at the end of code ?
  • Here's another way to do it.
    Reading/following the program flow appears to be a problem area.
    [code]
    TOUPPR: MOV AL,[ESI] ;get byte
    INC ESI
    OR AL,AL ;check for 0
    JZ DONE ;this ends the proc when it jumps
    CMP AL,'A' ;check for upper case
    JB TOUPPR ;skip
    CMP AL,91 ;'Z'=90
    JB SAVE ;if AL= A-Z, save it
    CMP AL,'a' ;check for lower case
    JB TOUPPR ;skip
    CMP AL,'z'
    JA TOUPPR ;skip
    AND AL,11011111b ;convert to a-z to upper case (=clear bit 5)
    SAVE: MOV BYTE [EDI],AL ;save byte
    INC EDI
    JMP SHORT TOUPPR
    DONE: MOV BYTE [EDI],AL ;add AL=0 nul to end of string
    [/code]

    EVEN aligns the next line to an even offset by inserting a NOP instruction,
    but I don't believe it's necessary where it's used?
    Some times a zero instead of NOP is inserted? & this can screw up code.
    When I've seen EVEN used in the past it's before WORD data DW statements.

  • : Here's another way to do it.
    : Reading/following the program flow appears to be a problem area.
    : [code]
    : TOUPPR: MOV AL,[ESI] ;get byte
    : INC ESI
    : OR AL,AL ;check for 0
    : JZ DONE ;this ends the proc when it jumps
    : CMP AL,'A' ;check for upper case
    : JB TOUPPR ;skip
    : CMP AL,91 ;'Z'=90
    : JB SAVE ;if AL= A-Z, save it
    : CMP AL,'a' ;check for lower case
    : JB TOUPPR ;skip
    : CMP AL,'z'
    : JA TOUPPR ;skip
    : AND AL,11011111b ;convert to a-z to upper case (=clear bit 5)
    : SAVE: MOV BYTE [EDI],AL ;save byte
    : INC EDI
    : JMP SHORT TOUPPR
    : DONE: MOV BYTE [EDI],AL ;add AL=0 nul to end of string
    : [/code]
    :
    : EVEN aligns the next line to an even offset by inserting a NOP instruction,
    : but I don't believe it's necessary where it's used?
    : Some times a zero instead of NOP is inserted? & this can screw up code.
    : When I've seen EVEN used in the past it's before WORD data DW statements.
    :
    :

    The Even and other such start and end pieces are part of a template given by the instructor. I didn't have the Even part in some of my programs and he got mad and said to put it there or he'd fail them, so I added it. :)

  • (We're 10 posts deep & that's max.)
    [code]
    EVEN
    exit: INVOKE ExitProcess, 0
    _start endp
    end
    [/code]
    : The Even and other such start and end pieces are part of a template given by the instructor. I didn't have the Even part in some of my programs and he got mad and said to put it there or he'd fail them, so I added it. :)
    [green]
    I take it your using MASM ?
    I'm not familuar with the INVOKE instruction.
    Have you looked it up to see if it needs to be aligned on an EVEN address?
    [CS:0001h] ;uneven address example
    [CS:0002h] ;even address example
    I suspose if the teacher wants it, do it. But I would correct him if I could hahahahahaha (But I wouldn't last long in his class.)
    [/green]

  • : (We're 10 posts deep & that's max.)
    : [code]
    : EVEN
    : exit: INVOKE ExitProcess, 0
    : _start endp
    : end
    : [/code]
    : : The Even and other such start and end pieces are part of a template given by the instructor. I didn't have the Even part in some of my programs and he got mad and said to put it there or he'd fail them, so I added it. :)
    : [green]
    : I take it your using MASM ?
    : I'm not familuar with the INVOKE instruction.
    : Have you looked it up to see if it needs to be aligned on an EVEN address?
    : [CS:0001h] ;uneven address example
    : [CS:0002h] ;even address example
    : I suspose if the teacher wants it, do it. But I would correct him if I could hahahahahaha (But I wouldn't last long in his class.)
    : [/green]
    :
    :


    Yes MASM, and I tried using the code you gave me a post or so ago and it accomplishes getting all the symbols out but removes the numbers.. where in that would I add something back to search for the 09 and put them in it too?
  • : Yes MASM, and I tried using the code you gave me a post or so ago and it accomplishes getting all the symbols out but removes the numbers.. where in that would I add something back to search for the 09 and put them in it too?
    :
    [green]
    The way I do/did the character finding was:
    char values are from 0-255
    if you start at the bottom & eliminate everthing you don't want below the first thing you want,
    then from one above what you do want down is a keeper,
    then from the next want on down is a discarder,
    then from one above what you do want down is a keeper, etc untill 255

    So since '0'=48 is less than 'A'=65, put your number checks in before the A-Z checks.

    Programs are nothing more that a bunch of little parts of a program all stuck together (like PROCs)
    Learn to make simple .asm .COM files to check each program parts,
    then make your program using them.
    A quickie trial and error .asm .COM check gets results/answers a lot faster than waiting on message board help.
    [/green]

  • : : Yes MASM, and I tried using the code you gave me a post or so ago and it accomplishes getting all the symbols out but removes the numbers.. where in that would I add something back to search for the 09 and put them in it too?
    : :
    : [green]
    : The way I do/did the character finding was:
    : char values are from 0-255
    : if you start at the bottom & eliminate everthing you don't want below the first thing you want,
    : then from one above what you do want down is a keeper,
    : then from the next want on down is a discarder,
    : then from one above what you do want down is a keeper, etc untill 255
    :
    : So since '0'=48 is less than 'A'=65, put your number checks in before the A-Z checks.
    :
    : Programs are nothing more that a bunch of little parts of a program all stuck together (like PROCs)
    : Learn to make simple .asm .COM files to check each program parts,
    : then make your program using them.
    : A quickie trial and error .asm .COM check gets results/answers a lot faster than waiting on message board help.
    : [/green]
    :
    :

    Bitdog: Thanks for your help through the assignment.. now I gotta do one even more rough.. reversing strings to make sure that they are palindromes(i.e.; BoB) etc.

    I figured out the number thing but for some reason never could get rid of the / at the beginning of the string. I'm pretty sure he'll grade it a zero because of that.. but hey.. I still tried. The guy is an ass.

    And I let him look at some of my code this morning in an attempt to help me and he asked me where I got the JB and the JA and JZ commands. Said that we hadn't covered them and I shouldn't be using them.

    Anyway, thanks for the help. I'm sure i'll be back in here in the future :)

    [red]Waylander420[/red]

  • :now I gotta do one even more rough.. reversing strings to make sure
    :that they are palindromes(i.e.; BoB) etc.

    You can use the stack to store a string, then as it pops off the stack,
    it pops in the reverse order that it was pushed.

    MOV SI,string address
    XOR CX,CX ; zero out CX
    TOP:
    LODSB ;get AL from [DS:SI] source
    OR AL,AL ;is a quick CMP AL,0 for JZ
    JZ DONE
    INC CX
    PUSH AX ;push both AH & AL, it doesn't matter that were just using AL
    JMP SHORT TOP
    MOV DI,new reversed string address buffer, where you write your string.
    REV:
    POP AX ; get the last pushed off the stack
    STOSB ;store AL at [ES:DI] destination
    LOOP REV ;untill CX=0
    XOR AL,AL ;zero out AL = quick code
    STOSB ; add nul=0 ending to the string

    :I figured out the number thing but for some reason never could get rid
    :of the / at the beginning of the string. I'm pretty sure he'll grade
    :it a zero because of that.. but hey.. I still tried. The guy is an ass.
    #1. I use Norton Commander to edit and it shows the value of the character under the cursor, Then in my
    http://bitdog.home.att.net/files/nasmenv.zip
    there is an file c:
    asmhelpascii.txt that shows all the characters 0-255 and their value and how to make them using the key board.
    I don't think you have an editor that shows the value, so your kinda stuck untill you get one.
    #2. Your teacher might get on the internet now and then and read your posts about him. He won't be able to be unbiased after that.

    : And I let him look at some of my code this morning in an attempt to
    :help me and he asked me where I got the JB and the JA and JZ commands.
    :Said that we hadn't covered them and I shouldn't be using them.

    Intel optcodes are no secret and in my c:
    asmhelpintel.txt or nasm.txt
    they are quite clearly listed.
    He could never expect you to remain ignorant and learn only what he teaches.
    I would think that you should be rewarded for a learning incentive on your own.
    Get an Intel optcode text file and look it over.
    Another thought is: if he's haveing you do signed jumps where they arn't considered good codeing, it's his own fault that your getting information outside his class.
    Tell him you did a www.google.com search for intel optcodes and would be glad to share the down load with the class.....hahahahahahaha

    ;I'm sure i'll be back in here in the future :)
    There's lots of good folks here that don't mind helping a bit or byte.
    But you might get asked to help others in return in the future.
    That's what happened to me........

    Bitdog

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories