+ Reply to Thread
Results 1 to 6 of 6

Thread: CPU and High Speed Devices Help

  1. #1
    Inactive Dimencia is on a distinguished road Dimencia's Avatar
    Join Date
    Mar 2007
    Location
    North Carolina
    Posts
    27

    Default

    Okay, I picked up CPU again after a long hiatus, and now everything's these brand new high speed things, and I am confused. I'm working on simply understanding it, and so far, no go. I wrote a program here to write a value from port0 to the RAM, and constantly loop (slowly) between every value of RAM, read it, and output it ... and of course reset itself if it goes past the RAM. Here's what I've got, and it seems that RAM is outputting 0's every time, that is, storing nothing.

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>jmp start;
    alloc rwrite,0; // The RAM Write address
    alloc temp,0; // Counter
    alloc read,0; // Read address

    start:
    cpuid 1;
    mov es,eax; // Stores 65536 or whatever that number
    // into ES, so when I do ES:0, it will start in Ram slot 0

    check:
    add #temp,1;
    cmp #temp,200;
    jge counter; // Every time temp reaches 200, we increment read

    mov port1,es:#read; // As far as I know
    // This is the most effective way to read from an address
    // But it could be wrong. I should use DS somewhere...
    mov port2,ds:#read; // I tried this, also doesn't work correctly
    mov port3,#rwrite; // Just for debugging, shows where the RAM's writing

    cmp port0,es:#rwrite; // If it's the same number as the previous
    je check; // Don't continue
    // As a note, this way of 'reading' works, as does this comparison
    // But reading values other than this one returns 0

    add #rwrite,1; // Increment RAM address
    mov es:#rwrite,port0; // Write value to it
    jmp check;

    counter: // Increments read, resets temp, and resets read if it's
    //higher than the RAM address
    mov #temp,0;
    add #read,1;
    cmp #read,#rwrite;
    jl check;

    mov #read,0;
    jmp check;</div>

    Right, well, commented for your pleasure.

    So as you can see, I probably am reading and writing completely wrong, so if somone could walk me through that process, that would be awesome. Also, if I wanted to hook up a console screen and a RAM into one, how would I do that? As far as I know, I would set them both in an address BUS, with the size of Console at 2048, but then would I set the RAM's offset to 2048? And then would I just write to es:0 for the screen, and es:2048+ for the RAM?

  2. #2
    Inactive Dimencia is on a distinguished road Dimencia's Avatar
    Join Date
    Mar 2007
    Location
    North Carolina
    Posts
    27

    Default

    Should I take the lack of responses to mean that nobody actually knows how to use high-speed devices with the CPU? Rather, nobody knows how to write and read to specific addresses in the CPU? >.<

  3. #3
    Wire Amateur tuusita is on a distinguished road tuusita's Avatar
    Join Date
    Jul 2007
    Posts
    86

    Default

    Well, something that I noticed:
    start:
    cpuid 1;
    mov es,eax; // Stores 65536 or whatever that number
    // into ES, so when I do ES:0, it will start in Ram slot 0[/b]
    You say you store 65536 into ES (from EAX) but you don't set EAX to that value at any point in the code?

    I've only done just one program for the cpu so far coz I just started learning the cpu day before last and I don't dare to test it now coz it's probably not working (among other things after the gmod update) adding to my frustration..

  4. #4
    Inactive Dimencia is on a distinguished road Dimencia's Avatar
    Join Date
    Mar 2007
    Location
    North Carolina
    Posts
    27

    Default

    Ah, well, the CPUID command automatically stores the result into EAX, in this case, 65536 (Or if it ever gets more built-in RAM, it'll use that value instead)

  5. #5
    That furred thing
    Black Phoenix will become famous soon enough Black Phoenix will become famous soon enough Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    2,742

    Default

    Try replacing:
    Code:
    mov port1,es:#read;
    
    with
    Code:
    mov esi,#read; mov port1,es:#esi;
    
    It might be ZASM that interprets your value wrong (it should be mov ...,es:##read, but thats not correct kinda)
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5


  6. #6
    Inactive Dimencia is on a distinguished road Dimencia's Avatar
    Join Date
    Mar 2007
    Location
    North Carolina
    Posts
    27

    Default

    Alright, thanks. The rest looks good, then?

    Ah, well, I tested it, and I'm having problems, but I don't understand why. In another one I wrote, it stored them well enough to check the conditionals and didn't constantly increment the write values, but in this one ... it does increment constantly. But in the old one, the values never stayed when I went back to check them, and in this one, they just stay at 0, no matter how much I try to write and/or read from them. It's only odd because they both do the exact same thing, and I can't find any difference in the way they read and/or write values, down to which addresses I use (I started at 2048 for both, since I like to put a console screen in first...), and it's just ... bleh. I need to find you on the servers for some help, phoenix

    Edit again: You know, I'm just going to go for a friends invitation

+ Reply to Thread

Similar Threads

  1. Documentation of hi-speed devices
    By Black Phoenix in forum CPU & GPU Tutorials & Programs
    Replies: 91
    Last Post: 11-27-2009, 07:23 AM
  2. High-speed holoemitter
    By Fizyk in forum Wiremod Addons
    Replies: 43
    Last Post: 08-29-2009, 04:40 AM
  3. High speed dubegger
    By Whodunnit in forum Ideas & Suggestions
    Replies: 14
    Last Post: 02-16-2009, 11:17 PM
  4. High speed wirekeyboard.
    By Whodunnit in forum CPU & GPU Tutorials & Programs
    Replies: 4
    Last Post: 01-29-2009, 11:09 PM
  5. High speed ranger! :d
    By IamMcLovin in forum Ideas & Suggestions
    Replies: 28
    Last Post: 10-20-2008, 10:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts