Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   Tech Help (http://zelaron.com/forum/forumdisplay.php?f=329)
-   -   Assembly help (http://zelaron.com/forum/showthread.php?t=30574)

Medieval Bob 2004-06-27 11:38 AM

Assembly help
 
You know assembly? ICQ, AIM, or PM me. I need help with a fairly simple problem with my homework.

Demosthenes 2004-06-27 11:40 AM

Why don't you just post the problem?

Medieval Bob 2004-06-27 12:24 PM

Okay, need help again.

Code:

;include main 32-bit header
include irvine32.inc

.data
;program data
input byte 20 dup (?)

.code
        ;program code
main proc
        mov edx, offset input                ;sets edx to the beginning of input

getnums:
        call readhex
        cmp eax, 99h                        ;this checks for an exit flag
        je continue                        ;exits if flag is given
        mov [edx], al
        add edx, 1
        cmp edx, offset input + 28        ;checks for the 28th number (total in example)
        jc getnums                        ;loop if not finished
       
continue:
        mov ecx, edx                        ;makes a copy of edx to know when to stop
        mov edx, offset input                ;sets edx back to the beginning of input
       
printnum:
        mov eax, [edx]
        call writehex
               

        ;exit the program
        exit
main endp
end main

My call to writehex works, but I need to print out the values entered. As it is, if I enter A, it loops, then I enter 99 to get out of the loop, I have a problem.

The register, eax, is 0000000A. So, when I call writehex, it writes 0000000A. I just need it to print A. How do I do that?

Medieval Bob 2004-06-27 12:55 PM

*bump* Read above post.


All times are GMT -6. The time now is 10:37 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.