0

I am trying to run my group project and I keep getting this repeated error. My friend was able to run the same code successfully and I dont understand why mine is not working. I am typing as -o program.o better.s

This is the code I am running

.data   
.balign 4                        
finputformat:    .asciz      "%f" 
sinputformat:    .asciz      "%s"
addformat1      :    .asciz      "%4.2f and "
addformat2      :    .asciz      "%4.2f"
subformat1      :    .asciz      "%4.2f from "
subformat2      :    .asciz      "%4.2f"
userprompt1     :    .asciz      "Enter the first operand: "
userprompt2     :    .asciz      "Enter the second operand: "
userprompt3     :    .asciz      "+ or - "
output          :    .asciz      "\nThe calculated result is %8.5f\n"
addmsg          :    .asciz      "Addition of "
andmsg          :    .asciz      " and "
submsg          :    .asciz      "Subtraction of "
undefinedmsg    :    .asciz      "Sorry - operation undefined!\n"
leavingmsg      :    .asciz      "Thanks for using finalPi - bye.\n"

.text                               // assemby
.global main                        // global declaration for entry point

main:
    BL  _prompt1            // prompt the user for number 1
    BL  _getninput          // get the input
    VMOV S10, R0            // move return value R0 to FPU register S0
    BL  _prompt2            // prompt the user for number 2
    BL  _getninput          // get the input
    VMOV S11, R0            // move return value R0 to FPU register S0
    BL  _prompt3            // prompt forthe operation
    BL  _getsinput          // get the input
    AND R1, R0, #0x0000FF   // get the low order byte into R1
    CMP R1, #0x2B           // did they request addition
    BEQ _addition           // calculate the result
    CMP R1, #0x2D           // did they request subtraction
    BEQ _subtraction        // calculate the result
    B   _undefined          // gott'a go

_prompt1:  
                 // the prompt function

    MOV R7, #4              // setup syscall,
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #26             // prompt length (24 characters)
    LDR R1, =userprompt1    // load address of the prompt:
    SWI 0                   // execute syscall (ouptuts the prompt)
    MOV PC, LR              // return

_prompt2:                   // the prompt function

    MOV R7, #4              // setup syscall,
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #27             // prompt length (25 characters)
    LDR R1, =userprompt2    // load address of the prompt:
    SWI 0                   // execute syscall (ouptuts the prompt)
    MOV PC, LR              // return

_prompt3:                   // the prompt function

    MOV R7, #4              // setup syscall,
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #8              // prompt length (8 characters)
    LDR R1, =userprompt3    // load address of the prompt:
    SWI 0                   // execute syscall (ouptuts the prompt)
    MOV PC, LR              // return



_getninput:                 // scan for input

    PUSH {LR}               // store LR since scanf call overwrites
    SUB SP, SP, #4          // need some space
    LDR R0, =finputformat   // set up the address of the format specifier
    MOV R1, SP              // move the SP to R1 for storage
    BL scanf                // call scanf
    LDR R0, [SP]            // load SP back to R0
    ADD SP, SP, #4          // reload the SP
    POP {PC}                // outta here

_getsinput:                 // scan for input

    PUSH {LR}               // store LR since scanf call overwrites
    SUB SP, SP, #4          // need some space
    LDR R0, =sinputformat   // set up the address of the format specifier
    MOV R1, SP              // move the SP to R1 for storage
    BL scanf                // call scanf
    LDR R0, [SP]            // load SP back to R0
    ADD SP, SP, #4          // reload the SP
    POP {PC}

_addition:                  // add and publish intermediate values

    PUSH {LR}               // push LR
    MOV R7, #4              // setup the syscall, 4
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #13             // message length (13 characters)
    LDR R1, =addmsg         // move the string of the leaving message
    SWI 0                   // execute the syscall for display
    LDR R0, =addformat1     // load the format specifier
    VCVT.F64.F32 D1, S10    // convert the result to double precision for printing
    VMOV R1, R2, D1         // move the calculated value into printf registers
    BL printf               // intermedaite printf
    LDR R0, =addformat2     // load the format specifier
    VCVT.F64.F32 D1, S11    // convert the result to double precision for printing
    VMOV R1, R2, D1         // move the calculated value into printf registers
    BL printf               // go ahead and printf again
    VADD.F32 S12, S10, S11  // finally add and store the result in s12
    B _output               // calculation complete


_subtraction:               // subtract and publish intermediate values

    PUSH {LR}               // push LR
    MOV R7, #4              // setup the syscall, 4
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #16             // message length (14 characters)
    LDR R1, =submsg         // move the string of the leaving message
    SWI 0                   // execute the syscall for display
    LDR R0, =subformat1     // load the format specifier
    VCVT.F64.F32 D1, S11    // convert the result to double precision for printing
    VMOV R1, R2, D1         // move the calculated value into printf registers
    BL printf               // intermedaite printf
    LDR R0, =subformat2     // load the format specifier
    VCVT.F64.F32 D1, S10    // convert the result to double precision for printing
    VMOV R1, R2, D1         // move the calculated value into printf registers
    BL printf               // go ahead and printf again
    VSUB.F32 S12, S10, S11  // finally add and store the result in s12
    B _output               // calculation complete

_output:                    // final result

    LDR R0, =output         // move formatted address ouput to R0
    VCVT.F64.F32 D1, S12    // convert the result to double precision for printing
    VMOV R1, R2, D1         // move the calculated value into printf registers
    BL printf               // go ahead and print it call
    B _gotago


_undefined:

    MOV R7, #4              // setup the syscall, 4
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #30             // message length (30 characters)
    LDR R1, =undefinedmsg   // move the string of the leaving message
    SWI 0                   // execute the syscall for display
    B _gotago               // let's leave'

_gotago:

    MOV R7, #4              // setup the syscall, 4
    MOV R0, #1              // output to monitor (stream 1)
    MOV R2, #33             // message length (33 characters)
    LDR R1, =leavingmsg     // move the string of the leaving message
    SWI 0                   // execute the syscall for display
    MOV R7, #1              // setup the terminatation syscall, 1
    SWI 0                   // execute syscall - the last action

error

better.s:53: Error: selected processor does not support `vmov S10,R0' in ARM mode
better.s:56: Error: selected processor does not support `vmov S11,R0' in ARM mode
better.s:120: Error: selected processor does not support `vcvt.f64.f32 D1,S10' in ARM mode
better.s:121: Error: selected processor does not support `vmov R1,R2,D1' in ARM mode
better.s:124: Error: selected processor does not support `vcvt.f64.f32 D1,S11' in ARM mode
better.s:125: Error: selected processor does not support `vmov R1,R2,D1' in ARM mode
better.s:127: Error: selected processor does not support `vadd.f32 S12,S10,S11' in ARM mode
better.s:139: Error: selected processor does not support `vcvt.f64.f32 D1,S11' in ARM mode
better.s:140: Error: selected processor does not support `vmov R1,R2,D1' in ARM mode
better.s:143: Error: selected processor does not support `vcvt.f64.f32 D1,S10' in ARM mode
better.s:144: Error: selected processor does not support `vmov R1,R2,D1' in ARM mode
better.s:146: Error: selected processor does not support `vsub.f32 S12,S10,S11' in ARM mode
better.s:151: Error: selected processor does not support `vcvt.f64.f32 D1,S12' in ARM mode
better.s:152: Error: selected processor does not support `vmov R1,R2,D1' in ARM mode
4
  • 3
    My guess is the code you are trying to run has been compiled for the wrong processor. It’s possible the rest of your team have more modern Pi boards than you do. Without knowing a bit more on the project and kit you all are using I’m a bit stuck to help more. If the code was compiled by the group I would find out what the command line was. Please edit your question to put the errors in code and some more details on the project and kit. It may help to know if this is a school project and when it’s due. – user115418 May 4 '20 at 1:06
  • please format your code .... do that by adding three of these symbols ``` on a blank line before the code listing and on a blank line after the code listing – jsotola May 4 '20 at 4:04
  • What command did you use to assemble the code (you have some of the options, but not it all). – ctrl-alt-delor May 4 '20 at 16:34
  • If this work on your friends machine then I am missing something. But I can't find anything about S or D registers. I programmed it back in the 32 bit days, and have searched online. – ctrl-alt-delor May 4 '20 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.