CS 3410 Programming Assignment 3 FAQ

Instructor: Kavita Bala

PA3: Hack ‘n’ Seek

Due: Tuesday, November 25th, 2008, 11:59 pm

 


November 24th, 12:00PM:  There have been several questions posed to the course staff recently:

Q. What does the "0XFFFFFF70 ROUNDS_LEFT" memory macro do?
A.  It reports the number of round left until the game ends.

Q. How do we access values in one of our own registers rather than those of the opponents?
A.  You can embed assemly into C directly using asm blocks and use assembly commands to access registers.  You see how assembly is embedded in several course bots.  You can also check out this guide to assembly embedding.  It describes how the compiler compiles assembly blocks into assembly code.  Unfortunately, its examples all use x86 assembly, but the principles are the same when MIPS is substituted.

Q. When our opponents code is loaded into the memory, will they also be loading up all their functions or will we only see the start function?
A.  Each bot's binary will be loaded into memory; their functions, helper functions, and all. The layout is whatever the compiler generated ... which you can see by running mipsel-linux-objdump.

Q. To clarify the "20 instructions rule", what will happens when I try read one of those 20 instructions that the opponent was given for free at the start of the game?  Are those instructions hidden from us always or can we see them after the initial 20 cycles?
A.  The rule pertains to time rather than data. You can't read anything for the first 20 cycles. Then you can read anything. In particular, you can read the instructions that your opponent executed in their first 20 cycles from their code segment after the first 20 cycles have elapsed.

Q. What are OPP_HI and OPP_LO?
A.  MIPS has some additional registers (HI and LO) aside from R0--R31 that are used to store the results of multiplications. OPP_HI and OPP_LO is where in your memory you opponent's HI and LO register values are mapped.

Q. Is there a single syscall to zero out your taunt array?
A.  No. The only syscalls are check, rand, and printi and prints. With the exception of check which writes one copy of your secret, none of the other syscalls modify memory in any way (and nor are they susceptible to buffer overflows since the simulator is careful to maintain the boundary between your mips code and our x86 code).

Q. What secret course bots?
A.  There will be around 10 secret course bots that will have simple defenses you will be expected to beat, and simple attacks that you will be expected to defend against. These bots are not on the ladder. They will be harder than the bots we provided along with the problemset. Each of these bots will be worth roughly 2 points out of the 20 points reserved for testing. In addition, peeper and stalker will be worth roughly an additional bonus point each. The secret bots will be added to the ladder after the deadline so you may refine your bots for the tournament.

Q. When are checks atomic?
A. 
  1. The value of $2 is 1
  2. And the assemly is either:
    		lw $4, ...
    		syscall
    		li $4, 0
    	
  3. or
    		addu $4, ...
    		syscall
    		li $4, 0
    	
The ... can be anything.

Page maintained by Kavita Bala