I used masm 6.11d to compile works fine. Not sure what the input port is suppose to return........ Result: a looping 232323232323 John title hello world in asm ;.386 .model small .stack 100h .data .code main proc ;mov ax,@data ;mov ds,ax push bp stosb l1: call time_delay ; Here is where I call the delay routine below. call time_delay ; I called it three times to see if I could notice a delay call time_delay ; a little better. But I see no difference between one time and three times. mov dx,14ch ;lo in al,dx mov cl,al mov dx,14dh ;hi in al,dx ;place 2 and 3 b'cos there are no value from the input port. No idea what is it. mov al,2 call near ptr putc ;print mov al,cl mov al,3 call near ptr putc mov ax,120h ;' ' mov dx,0 ;int 14h jmp short l1 ; Here is the routine I'm interested in having evaluated main endp putc proc and al,0fh or al,30h mov ah,1 mov dx,0 int 14h mov ah,0eh int 10h ret putc endp time_delay proc mov dx,0ffffh loop1: dec dx cmp dx, 0 jnz loop1 ret time_delay endp end main --- James Newtons Massmind wrote: > A PC will do that delay loop so fast that 3 times > will not show any > difference from once. > > You are pushing bp at the start and not removing it > before or as part of the > return. > > --- > James. > > > > > -----Original Message----- > > From: piclist-bounces@mit.edu > > [mailto:piclist-bounces@mit.edu] On Behalf Of Paul > James E. > > Sent: 2006 Mar 06, Mon 23:06 > > To: piclist@mit.edu > > Subject: [OT]: x86 Assembly Language Routine > Question > > > > All, > > > > If there are any x86 programmers out there that > are familiar > > with assembly language, I would appreciate you > having a look > > at my delay routine and see if you see any > obvious reason > > why it wouldn't work. > > > > If I use debug, it seems to work fine. But if I > try to let > > it run stand > > alone, it prints one 16 bit value on the screen, > and then hangs. > > > > I don't understand why it isn't working. If > anyone can help, I'd > > appreciate it very much. > > > > Please advise off line to jim@jpes.com > > > > > > > Thanks and Regards, > > > > > Jim > > > > ; RTC.asm print hardware timer values > > > > org 100h > > push bp > > stosb > > l1: > > call near time_delay ; Here is where I call > the > > delay routine > > below. > > call near time_delay ; I called it three > times to > > see if I could > > notice a delay > > call near time_delay ; a little better. But > I see > > no difference > > between one time and three times. > > mov dx,14ch ;lo > > in al,dx > > mov cl,al > > mov dx,14dh ;hi > > in al,dx > > call near putc ;print > > mov al,cl > > call near putc > > mov ax,120h ;' ' > > mov dx,0 > > int 14h > > jmp near l1 > > > > putc: > > and al,0fh > > or al,30h > > mov ah,1 > > mov dx,0 > > int 14h > > mov ah,0eh > > int 10h > > ret > > > > ======================= ; Here is the routine I'm > interested > > in having evaluated > > > > time_delay: > > mov dx,0xffff > > loop1: > > dec dx > > cmp dx, 0 > > jnz loop1 > > ret > > > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > View/change > > your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist