added 0x where relevant

This commit is contained in:
Remzi Arpaci-Dusseau 2022-10-15 08:46:16 -05:00
parent 4c290a92a5
commit 6996ef0f0c
1 changed files with 2 additions and 2 deletions

View File

@ -251,10 +251,10 @@ for i in range(0, options.num):
else:
vaddr = (used[i] << 5) | int(random.random() * 32)
if options.solve == True:
print('Virtual Address %04x:' % vaddr)
print('Virtual Address 0x%04x:' % vaddr)
r = os.translate(1, vaddr)
if r > -1:
print(' --> Translates to Physical Address 0x%03x --> Value: %02x' % (r, os.getValue(r)))
print(' --> Translates to Physical Address 0x%03x --> Value: 0x%02x' % (r, os.getValue(r)))
elif r == -1:
print(' --> Fault (page directory entry not valid)')
else: