A little helper for assembly
[Deleted User]
Posts: 0
Hi,
·I find learning just about anything easier if you can take a peek to see what is actually going on inside what your working on (I’m a diesel mechanic by trade). So I set out to make a program that would let me enter 2 numbers, enter the assembly code and see what the processor spits out. With the help of Mike Green (He probably won’t admit it!) this is the beginning of what I hope to be a little trainer program. Not all assembly code works on it yet, and I’m working on displaying flags. Your welcome to play with it & I’ll post updates for it as I get them done.
Thank's· Brian
·I find learning just about anything easier if you can take a peek to see what is actually going on inside what your working on (I’m a diesel mechanic by trade). So I set out to make a program that would let me enter 2 numbers, enter the assembly code and see what the processor spits out. With the help of Mike Green (He probably won’t admit it!) this is the beginning of what I hope to be a little trainer program. Not all assembly code works on it yet, and I’m working on displaying flags. Your welcome to play with it & I’ll post updates for it as I get them done.
Thank's· Brian
Comments
If you want to really help with training, you could make a little single instruction execution package that uses the keyboard and display to set the initial value of a destination and source location, set the initial value of a Z and C flag, then sort of assembles an instruction given the opcode, condition field, result field, but with a fixed destination and source. Jumps would not allowed (or they would be to a fixed location that you'd supply) and you'd display the resulting destination location and flags. If you allowed jumps, it would also indicate whether the instruction "fell through" or jumped.
Mike
I’ll keep adding features as I learn them. For now (maybe it’s just me) I think it’s nice that I can see the difference between movs & movi. Keep in mind I learned assembly on the 8085 & I’m working through the same problems from lab manual (but modifying them for the propeller). I’m working towards a Calculator that is coded all in assembly. I’m posting this stuff to help the guys that are beginners but afraid to ask questions.
Thanks, Brian
I partly posted that "challenge" because it would be really useful and fun to play with, could be done almost completely in SPIN, and you (or someone else) could learn a lot by doing it.
Mike
I started typing the moment I saw it , I'm also working on a pass the bit program ,where all the cogs are running and passing 1 bit threw ina and outa.(ya ya I know... Look at example 17 in· beginning spin, Thanks ,Dave)
Thanks, Brian
Post Edited (truckwiz) : 12/7/2006 5:25:53 PM GMT
" long num3 , flag "
MSB .................................................LSB
a) 0000000000000000 | 0000000000000000
..........num3........................ flag
b) 0000000000000000 | 0000000000000000
..............flag ......................num3
c) num3 00000000000000000000000000000000
......flag 00000000000000000000000000000000
d)......0000 | 00000000000000000000000000000000
.........flag............................num3
also , when you add 4 to num3 are you moving 4 longs or 4 bits?
Thanks,Brian
Post Edited (truckwiz) : 12/7/2006 3:26:25 AM GMT
I'm not sure what you're asking in terms of num3 and flag. Basically, these are two 32 bit long values that must be in memory in that order. Each value occupies 4 bytes. The byte address of the first byte of num3 is passed in the PAR register. In the routine I posted, that address is copied to a temporary location (since PAR is read-only) and 4 is added to it. Essentially, this moves the address up 4 bytes to the next 32 bit long (which is flag). A wrlong instruction uses this modified address to change the contents of flag.
Mike
ADDRESS.....+7..........+6..........+5..........+4
flag.......00000000|00000000|00000000|00000000
ADDRESS.....+3.........+2...........+1............+0
num3....00000000|00000000|00000000|00000000
I changed the program a little bit and ask it the address of PAR , it feed back the first long that was reserved for that program ( it was $760 & that should be right on the money)!!!
Thanks,Brian
Post Edited (truckwiz) : 12/7/2006 4:00:22 AM GMT