MedVision ad

Help with Trials question: interpreting a disassembler? (1 Viewer)

SadCeliac

done hsc yay
Joined
Sep 23, 2021
Messages
2,516
Location
Sydney <3
Gender
Male
HSC
2023
Hi all!

This below question was in one of the trial papers from my teacher. If anyone could provide an explanation / walkthrough guide on how to approach this I would greatly appreciate it!
Screen Shot 2023-07-22 at 7.26.32 pm.pngScreen Shot 2023-07-22 at 7.26.39 pm.pngScreen Shot 2023-07-22 at 7.26.45 pm.png
Part 1:
Screen Shot 2023-07-22 at 7.26.53 pm.png
Part 2:
Screen Shot 2023-07-22 at 7.27.00 pm.png

Thank you!!!
 

SadCeliac

done hsc yay
Joined
Sep 23, 2021
Messages
2,516
Location
Sydney <3
Gender
Male
HSC
2023
For anyone wondering, this is the marking criteria (not very helpful imo). Again, I need help with understanding and approaching the question.
Screen Shot 2023-07-22 at 7.32.35 pm.png
 

dav53521

Well-Known Member
Joined
Mar 23, 2022
Messages
320
Gender
Male
HSC
2022
First part is telling you to interpret the assembly code so you use the assembly instructions above and basically do a desk check and use that desk check to determine what the code is doing or you could do it another way but the general point is use the assembly instructions to determine what the code is doing.

The second part looks like it's testing you on the fetch-execute cycle because the instruction register is currently on the instruction set 0x5034000 it'll be modding R0 and R3 (R0/R3) which will be 1 which as you can see is stored in R4 which means that the mod has just occurred but as both the program counter isn't holding 0x105 and the instruction register isn't holding 0xA4340107 then the fetch-execute cycle hasn't been completed so that's why the pause is directly after the execution of 0x5034000. Also as R4 isn't 0 it'll then execute the jumpnz assembly command and will jump to the "next" label.
 

SadCeliac

done hsc yay
Joined
Sep 23, 2021
Messages
2,516
Location
Sydney <3
Gender
Male
HSC
2023
Okay that all makes sense - thank you!

But how would you actually go about interpreting the assembly code? Am I meant to purely go in line by line (isn't that too slow for an exam)?
 

SadCeliac

done hsc yay
Joined
Sep 23, 2021
Messages
2,516
Location
Sydney <3
Gender
Male
HSC
2023
isn't that too slow for an exam
Not that I'm struggling with time management for a 3hr SDD paper, but I when I tried this question I just got overwhelmed by trying to keep track of all the registers whilst trying to convert from hex whilst reading the assembly instructions.....
 

dav53521

Well-Known Member
Joined
Mar 23, 2022
Messages
320
Gender
Male
HSC
2022
But how would you actually go about interpreting the assembly code? Am I meant to purely go in line by line (isn't that too slow for an exam)?
I mean the assembly code will be made up by nesa and there's no meaningful variable names or other stuff that may help with interpreting the code so imo interpreting it line-by-line is kinda the only option I see.

Although assembly while looks more complex is kinda like pseudo code apart from it has instruction and uses registers instead of variables so I guess if you have some way to quickly interpret pseudo code then you could potentially use that method but you'll still need to understand what each instruction does.
 

SadCeliac

done hsc yay
Joined
Sep 23, 2021
Messages
2,516
Location
Sydney <3
Gender
Male
HSC
2023
I mean the assembly code will be made up by nesa and there's no meaningful variable names or other stuff that may help with interpreting the code so imo interpreting it line-by-line is kinda the only option I see.
Ew that's just annoying, but I guess it'll have to do.

Thanks for the help :)
 

dav53521

Well-Known Member
Joined
Mar 23, 2022
Messages
320
Gender
Male
HSC
2022
Not that I'm struggling with time management for a 3hr SDD paper, but I when I tried this question I just got overwhelmed by trying to keep track of all the registers whilst trying to convert from hex whilst reading the assembly instructions.....
I do understand that part and personally I never seen something like that before. I know that it is possible to be asked to interpret assembly code but I've never seen memory addresses and instruction code in it before as they just give you the assembly instruction and code. Also at least for the 2022 hsc they used decimal numbers
 

SadCeliac

done hsc yay
Joined
Sep 23, 2021
Messages
2,516
Location
Sydney <3
Gender
Male
HSC
2023
I do understand that part and personally I never seen something like that before. I know that it is possible to be asked to interpret assembly code but I've never seen memory addresses and instruction code in it before and if i'm not mistaken NESA uses decimal numbers (at least that's what happned in the 2022 hsc exam).
Tbh this is from an independent school paper so I wouldn't fully expect it in an HSC exam, but I'll have a look at that 2022 one to see what NESA did.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top