Can't load .asm to CPU emulator

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't load .asm to CPU emulator

Vijay99
When I load any .asm file in the CPU emulator the instructions do not appear in the ROM column. It was working very well sometime ago when I ran some sample .asm files to know it better.

Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

WBahn
Administrator
Are you loading the .asm file or the test script?

You you loading it as a .asm file or as a test script?

Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

Vijay99

Of course, I click on 'load ROM' then a dailog box appears with the title 'load ROM'; thereafter I select and load the file.
Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

WBahn
Administrator
You have the extensions hidden, so I can't tell what file you are actually attempting to load.

The directory provided comes with three files:

mult.asm
Mult.cmp
Mult.tst

Notice that the file you need to be loading, "mult.asm", starts with a lower-case 'm' while the other two start with an uppercase 'M'. Perhaps the provided files have been changed to address this inconsistency, my download is a couple years old.

Have you added your assembly code to the mult.asm file? That file, as provided, has no code in it. Try modifying it with just

D=0

and see if you get anything different.

If you have put assembly code into it, then you likely have put something in there that it is choking on. Are you getting any messages on the status line (the very bottom of the window, which sometimes is off the screen).

Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

Vijay99
Status line becomes visible when I maximize the window. Thanks! I don't understand what it means by 'expression expected'?
Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

WBahn
Administrator
Please post the contents of your mult.asm file so that we can stop dancing around.
Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

Vijay99
I tried a new way of doing it and "comparision ended successfully".
1) The delfault test script gave the error "Mult.hack didn't found". So, I changed the instruction 'load Mult.hack' in test script to 'load Mult.asm' and it worked.
2) I notice that the test script tested the multiplication of postive numbers only.
I am impressed by your responsiveness. Thanks again.  
Reply | Threaded
Open this post in threaded view
|

Re: Can't load .asm to CPU emulator

dasiff
In reply to this post by WBahn
I am having the same problem--I try to load it and nothing appears, no message at the bottom.  I also tried loading the program with just "@0" as the only command and nothing loads into ROM

Here is the code I am trying to load:
// Put your code here.
@R2  //initialize running tally to 0
M=0
@i  //initialize counter i
M=0
(LOOP)
//if i=R0 goto end
@i  //just in case
D=M  //D has current value of i
@R0
D=D-M
@R0
0;JEQ
//R2+= R1
@i  //increment counter: i++
M=M+1
//go back to beginning of loop
@(LOOP)
0;JMP
(END)
@(END)
0;JMP