+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: [zASM]Wire keybiad help

  1. #1
    Wire Sofaking ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    594

    Default [zASM]Wire keyboard help

    Hi guys I have gotten bored with making E2 OS's and decided to make one in zASM, now I am trying to get this code to work but I get a Write/Read error, ive sat looking at the code for an hour now and cant figure it out.
    Here is how I have it wired up:
    Memory1 -> Console Screen
    Memory2 -> Keyboard

    And here is the code.
    Code:
    DATA;
    define key_off,67586;     //Second byte of Keyboard Mem
    define con_off,65536;     //First byte of Console Mem
    alloc charpos,0;          //Counter used to determine postion of keys in Writer.
    
    CODE;
    Write:             //General Write Function
     mov ebx,#key_off;  //Move Key to ebx save to write back to buffer
     mov eax,con_off;   //Set eax to start of console memory
     add eax,#charpos;  //Add to eax the value of the counter (charpos)
     mov #eax,#key_off; //Move character into console
     inc eax;           //Move to next cell over
     mov #eax,999;      //Move charparam into cell
     mov #key_off,ebx;  //Write char back to keyboard buffer
     add #charpos,2;    //Move to next cell, ready to write
    jmp Write;         //Go back to key detection
    And yes it is not my code but I would like to see some working code before I write my own.

    Cookies and +reps are open.
    Last edited by ryland; 12-09-2009 at 11:24 PM.
    "I like pie"-Jat Goodwin

    <Azrael-> ryland: LOL is such a noobish thing to say.
    <ryland> LOL
    <Fox682> LOLLOL
    <Fox682> LOL
    <ryland> LOL

  2. #2
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,005

    Default Re: [zASM]Wire keybiad help

    It's filling your screens memory with 0's since it doesn't actually check if there is something in the buffer.

    I'm rusty on cpu, but I believe this should work.
    Code:
    DATA;
    define key_buffer,67585;
    define key_off,67586;     //Second byte of Keyboard Mem
    define con_off,65536;     //First byte of Console Mem
    alloc charpos,0;          //Counter used to determine postion of keys in Writer.
    
    CODE;
    
    CheckLoop:
      mov ebx,key_buffer;
      cmp #ebx,0;
      cg Write;
    jmp CheckLoop;
    
    Write:             //General Write Function
     mov ebx,#key_off;  //Move Key to ebx save to write back to buffer
     mov eax,con_off;   //Set eax to start of console memory
     add eax,#charpos;  //Add to eax the value of the counter (charpos)
     mov #eax,#key_off; //Move character into console
     inc eax;           //Move to next cell over
     mov #eax,999;      //Move charparam into cell
     mov #key_off,ebx;  //Write char back to keyboard buffer
     add #charpos,2;    //Move to next cell, ready to write
    ret;         //Go back to key detection
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  3. #3
    Wire Sofaking ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    594

    Default Re: [zASM]Wire keybiad help

    Quote Originally Posted by Bull View Post
    It's filling your screens memory with 0's since it doesn't actually check if there is something in the buffer.

    I'm rusty on cpu, but I believe this should work.
    Code:
    DATA;
    define key_buffer,67585;
    define key_off,67586;     //Second byte of Keyboard Mem
    define con_off,65536;     //First byte of Console Mem
    alloc charpos,0;          //Counter used to determine postion of keys in Writer.
    
    CODE;
    
    CheckLoop:
      mov ebx,key_buffer;
      cmp #ebx,0;
      cg Write;
    jmp CheckLoop;
    
    Write:             //General Write Function
     mov ebx,#key_off;  //Move Key to ebx save to write back to buffer
     mov eax,con_off;   //Set eax to start of console memory
     add eax,#charpos;  //Add to eax the value of the counter (charpos)
     mov #eax,#key_off; //Move character into console
     inc eax;           //Move to next cell over
     mov #eax,999;      //Move charparam into cell
     mov #key_off,ebx;  //Write char back to keyboard buffer
     add #charpos,2;    //Move to next cell, ready to write
    ret;         //Go back to key detection
    Thanks, but I still get the same error, 7.676 or something close to that.
    Also what does cg mean, ive never seen that before.
    "I like pie"-Jat Goodwin

    <Azrael-> ryland: LOL is such a noobish thing to say.
    <ryland> LOL
    <Fox682> LOLLOL
    <Fox682> LOL
    <ryland> LOL

  4. #4
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: [zASM]Wire keybiad help

    cg - Call if greater than
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

  5. #5
    Wire Sofaking ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    594

    Default Re: [zASM]Wire keybiad help

    Quote Originally Posted by Matte View Post
    cg - Call if greater than
    Ahh cool, that will come in handy soon.

    EDIT:
    Well, I did not have the address bus configured at all, big oops.
    But I got it partly working...
    The screen keeps repeating what you type until this...
    Attached Thumbnails Attached Thumbnails [zASM]Wire keybiad help-gm_smallstruct0066.jpg  
    Last edited by ryland; 12-10-2009 at 12:30 AM.
    "I like pie"-Jat Goodwin

    <Azrael-> ryland: LOL is such a noobish thing to say.
    <ryland> LOL
    <Fox682> LOLLOL
    <Fox682> LOL
    <ryland> LOL

  6. #6
    Wire Amateur ChimP's Avatar
    Join Date
    Apr 2009
    Posts
    95

    Default Re: [zASM]Wire keybiad help

    I've seen BP talk about this. Keyboards aren't working right now. You need to make a keybuffer on your own somehow.

    - Some people got brains.

  7. #7
    Wire Sofaking ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    594

    Default Re: [zASM]Wire keybiad help

    Quote Originally Posted by ChimP View Post
    I've seen BP talk about this. Keyboards aren't working right now. You need to make a keybuffer on your own somehow.
    What do you mean by that?
    Also, this is how I have the address bus configured.
    Memory1 offset = 0
    Memory1 size = 2047
    Memory2 offset = 2048
    Memory2 size = 255

    EDIT:
    And here is a picture of it before it goes dead.
    Attached Thumbnails Attached Thumbnails [zASM]Wire keybiad help-gm_smallstruct0068.jpg   [zASM]Wire keybiad help-gm_smallstruct0071.jpg  
    Last edited by ryland; 12-10-2009 at 01:10 AM.
    "I like pie"-Jat Goodwin

    <Azrael-> ryland: LOL is such a noobish thing to say.
    <ryland> LOL
    <Fox682> LOLLOL
    <Fox682> LOL
    <ryland> LOL

  8. #8
    Wire Amateur ChimP's Avatar
    Join Date
    Apr 2009
    Posts
    95

    Default Re: [zASM]Wire keybiad help

    Quote Originally Posted by ryland View Post
    What do you mean by that?
    The keybuffer is broken. It doesn't clear the last character, for some reason.
    You should make your own one in E2.

    - Some people got brains.

  9. #9
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,005

    Default Re: [zASM]Wire keybiad help

    Quote Originally Posted by ryland View Post
    What do you mean by that?
    Also, this is how I have the address bus configured.
    Memory1 offset = 0
    Memory1 size = 2047
    Memory2 offset = 2048
    Memory2 size = 255

    EDIT:
    And here is a picture of it before it goes dead.
    Memory1 size should be 2048
    Memory2 size should be 256
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  10. #10
    Wire Sofaking Fizyk's Avatar
    Join Date
    Jun 2008
    Location
    Łomianki, Poland
    Posts
    740
    Blog Entries
    1

    Default Re: [zASM]Wire keybiad help

    You would want keyboard_buffer to be 67584 and keyboard_off to be 67585. Then it should work better, now you are checking wrong cells. And sizes don't really matter here, but making them 2048 and 256 would be better. Just make sure Mem2 offset is 2048.

    My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
    My tutorials: applyTorque - Quaternions - PID controllers
    Some other things I made: FT Chip - RK4 Solar System

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. uZASM - a ZASM compiler written in ZASM
    By Black Phoenix in forum Full-scale projects
    Replies: 29
    Last Post: 10-24-2009, 07:48 PM
  2. Replies: 0
    Last Post: 09-27-2009, 06:00 AM
  3. ZASM Code Editor - Wire CPU
    By SuperLlama in forum Installation and Malfunctions Support
    Replies: 0
    Last Post: 01-16-2009, 12:43 PM
  4. C-style Function Calling With Zasm
    By ULTRA in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 7
    Last Post: 10-18-2007, 08:08 AM
  5. Requesting ZASM Assembler for Windows
    By dnifan in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 7
    Last Post: 08-31-2007, 05:45 PM

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
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots