shall i cry myself to sleep?

From: idontgetit (redrain567_at_hotmail.com)
Date: 01/25/05


Date: 25 Jan 2005 14:07:00 -0800

i was hoping that soone might be able to give me some advice on
somthing!

using assebler i need to create a program that writes a menu to the
screen, forget about using the menuto preform other tasks, as i will
never be able to do that im amillion years, i just need the menu up!

This is what i got so far!

.intel_syntax noprefix
.global _main

.extern _exit
.extern _getchar
.extern _putchar

.data
menua: .byte 'o','p','t','i','o','n',' ','a',' ','-',
'e','n','t','e','r',' ','a',' ','s','t','r','i','n','g','
','i','n','t','o',' ','b','u','f','f','e','r',0
menub: .byte 'o','p','t','i','o','n',' ','b','
','-','d','i','s','p','a','y',' ','s','t','r','i','n','g','
','t','o',' ','t','h','e',' ','s','c','r','e','e','n',0
menuc: .byte 'o','p','t','i','o','n',' ','c','
','-','e','n','c','o','d','e','/','d','e','c','o','d','e',','a','s','t','r','i','n','g',0
menud: .byte 'o','p','t','i','o','n',' ','d',' ','-','e','x','i','t',0
        

.text
_main:
        lea ebx, menua
        call writestring
        lea ebx, menub
        call writestring
        lea ebx, menuc
        call writestring
        lea ebx, menud
        

#########################################################
writestring:
        mov al, [ebx]

wh1:
        cmp al, 0
        je end1

do1:
        push ebx
        push eax
        call _putchar
        add esp, 4
        pop ebx
        inc ebx
        mov al, [ebx]
        jmp wh1

end1:
        ret
#########################################################

        #call writechar # al is used to pass char parameter
        #call newline # no parameters required
        #lea al,menub # display 'S'
        #call writechar # al is used to pass char parameter
        #call newline
        #mov eax, 0
        #push eax
        #call _exit
      

 
#writechar: # display char in al to screen
        #push eax
        #call _putchar # perform OS call
        #add esp, 4
        #ret # return to instruction following call

#newline:
        #mov al, 10
        #push eax
       #call _putchar
        #add esp, 4
        #ret

    

        #mov eax, 0
        call _exit



Relevant Pages

  • Re: New installation has no GUI [was: Unidentified subject!]
    ... > somthing a little better is to do the following: ... And why is that bad advice? ... We're obviously dealing with a linux noobie ...
    (Debian-User)
  • Re: cybex training
    ... all i wanted was some advice so as not to waste any of my ... time training for somthing that is no longer needed and i ... >> the godly levels that you are obviusly at. ...
    (microsoft.public.cert.exam.mcse)