Returning character input with assembly?

0

What I've (accidentally) made is an assembly program that echoes any input, no matter how long. As soon as I hit enter, the line I typed appears a second time, and there appears to be no return value.

initialize:
    set 0x00ffff00,r15      ! Initialize the stack reg
    set 0x00ffff00,r3       
    set 0x00ffff04,r4       

getCharacter:                  loop:
    load    [r3],r5         !     r5 := serial status word
    btst    0x00000001,r5   !     if status[charAvail] == 0 then
    be  getCharacter        !     go to getCharacter
    load    [r4],r2         !   Get the character
    store   r2,[r15+4]      !  put the character in the result position
    ret                     ! return the character

What I'm trying to do is similar, but I need it to read an input character, then return it without any echoes or prompts. I don't know if this is the right way to go about asking this question (my code isn't runnable without blitz to my knowledge), but I haven't found any other good resources for assembly.

assembly
char
return
asked on Stack Overflow Oct 3, 2018 by Lazarus

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0