def seek(self, offset, whence = <NUM_LIT:0>):
if whence == <NUM_LIT:0>:<EOL><INDENT>t = self.current_segment.start_address + offset<EOL><DEDENT>elif whence == <NUM_LIT:1>:<EOL><INDENT>t = self.current_position + offset<EOL><DEDENT>elif whence == <NUM_LIT:2>:<EOL><INDENT>t = self.current_segment.end_address - offset<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>if not self.current_segment.inrange(t):<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>self.current_position = t<EOL>return<EOL>
Changes the current address to an offset of offset. The whence parameter controls from which position should we count the offsets.
0: beginning of the current memory segment
1: from current position
2: from the end of the current memory segment
If you wish to move out from the segment, use the 'move' function