Results 1 to 5 of 5

Thread: MIC-1 Micro program

  1. #1
    Join Date
    Jun 2012
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default MIC-1 Micro program

    Does anyone know MIC-1 that can help me code this?

    Three temporary registers are required (A,B,C)

    i) Initialize A to zero
    Move Multiplicand to B
    Move multiplier to C

    ii) Repeat the following N times where register size = N bits
    a. 1-bit Logical Left shift A
    b. If ( leftmostbit of C is 1 )
    then { add B to A }
    c. 1-bit Logical Left shift C

    I don't know if it is allowed but I am willing to pay for the help through something like paypal.

  2. #2
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Paying for the help in any manner isn't allowed, sorry.

    But, I am intrigued by this. Is MIC-1 a form of assembly language, possibly based off of MIPS?

  3. #3
    Join Date
    Jun 2012
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    The MIC-1 is a processor architecture, it looks a lot like assembly but is a microprogram. I am trying to do multiplication using that algorithm but my teacher wont even explain it.
    Last edited by Mr. Roboto; 03-20-2013 at 10:10 PM.

  4. #4
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Oh, more like Quartus. I hate those. Yeah, sorry, I don't think I can help with this one as I'm not familiar with MIC-1.

  5. #5
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    I'd translate this into MIC but I'd have to learn MIC which might take an hr or two (fast learner.. I know..) to get a hang of the syntax.. So I'm posting it in x86 in hopes that you can do that yourself..

    Let me know if you guys see any mistakes..

    ASM Code:
    format PE console                                    
    entry main

    include 'macro/import32.inc'

    section '.idata' import data readable          
    library msvcrt,'msvcrt.dll'
    import msvcrt, printf, 'printf',\
    exit,'exit', getchar, 'getchar', scanf, 'scanf'

    section '.data' data readable writeable                
    GetMultiplicand db "Enter A Multiplicand: ", 13, 10, 0
    GetMultiplier db "Enter A Multiplier: ", 13, 10, 0
    InputFormat db "%d", 0                                          
    Multiplicand dd 0                                              
    Multiplier dd 0                                            


    section '.code' code readable executable
    main:
       push ebp
       mov ebp,esp

       push GetMultiplicand
       call [printf]
       add esp, 4

       push Multiplicand
       push InputFormat
       call [scanf]
       add esp, 8

       push GetMultiplier
       call [printf]
       add esp, 4

       push Multiplier
       push InputFormat
       call [scanf]
       add esp, 8

       mov eax, 0
       mov ebx, Multiplicand
       mov edx, Multiplier

       mov ecx, 20h

       TheLoop:
         shl eax, 1b
         mov edi, edx
         and edi, 8000000h
         cmp edi, 1b
         jne NotOne
         add eax, ebx
         NotOne:
         shl edx, 1b
       loop TheLoop

       mov esp, ebp
       pop ebx

       call [getchar]
       call [getchar]

       mov eax, 0
    ret
    Last edited by Brandon; 03-21-2013 at 12:03 AM.
    I am Ggzz..
    Hackintosher

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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