Kinda neat code [repost] 
Author Message
 Kinda neat code [repost]

Repost using valid address to see why the first one bounced ...

Quote:
>From the never-use-this file ...

Exhibit A:
==========

    mov dx,0xB2ED
    mov cl,0xED
  startpos:
    cmp dl,cl
    jne $+3
    mov dx,0xB2EF
    in dx
    jmp StartPos

What it does:
=============

Reads data from the port in 0xB2ED (usually decoded as port 0x2ED), then writes
it out to the port 0xB2EF (usually decoded as port 0x2EF), continuously looping.

How it does it:
===============

First of all, the assembled code, starting at the mov:

BA EF B2      mov dx,0xB2EF
ED            in dx

If the jump fails (which is does on the first loop) dx gets $B2EF put in it, and
the data gets inputted. Since dl is now not equal to 0xED, the jump succeeds in
the next loop. The first byte of this code snipped is dropped leaving the code
to disassemble as:

EF          out dx
B2 ED         mov dl,0xED

The jump fails on the next loop and the data is inputted and so on.

--
Michael



Thu, 05 Aug 2004 10:20:21 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Displaying in multicolumn list format -kinda repost

2. Making Code Neat

3. Any neat PLI code for this?

4. Any neat PLI code for this?

5. Neater entry point code

6. Code Snippet (Freeware) : Repost

7. RePost of the code for imbedded blanks problem.

8. REPOST: posting the code - further to odd problem

9. REPOST: Re: posting the code - further to odd problem

10. KOT (kinda off topic):yet another language comparison

11. Kinda OT:Labview hobby use

12. A rival for The Oasis (kinda)

 

 
Powered by phpBB® Forum Software