Searching \ for '[OT]: x86 Assembly Language Routine Question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/language/index.htm?key=language
Search entire site for: 'x86 Assembly Language Routine Question'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: x86 Assembly Language Routine Question'
2006\03\07@140618 by Paul James E.

picon face

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 spam_OUTjimTakeThisOuTspamjpes.com


                                                Thanks and Regards,

                                                       Jim

2006\03\07@140630 by Paul James E.

picon face
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 .....jimKILLspamspam@spam@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

2006\03\07@155458 by James Newtons Massmind

face picon face
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 removed}

2006\03\07@215350 by kravnus wolf

picon face
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 <jamesnewtonspamKILLspammassmind.org>
wrote:

{Quote hidden}

> > {Original Message removed}

2006\03\20@163740 by Barry Gershenfeld

face picon face
At 01:05 PM 3/7/06 +0600, Paul James E. wrote:

>  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 .....jimKILLspamspam.....jpes.com

If you run a program like that in a "DOS box" within Windows, Windows
may put it to sleep.  Try pressing the shift key (the any key) to wake
it.

Barry

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...