dump_regs
section .data
int: dd 68,-9
floaty: dd -68.125
char: db "Greetings!",10,0
bighex: dq 10h
mediumbin: dw 10b
section .bss
somememory: resd 2
; you can actually have multiple of these sections interleaved if you want to
; but generally that would just be confusing!
section .data
nightnight: db "ZZZZZZZZ"
Bring your hand-written solution to lab day.
al_homework repository on that server is up-to-date. If this is not
the case you'll need to thoughtfully manage the following instructions
when they ask you do perform git commands.
Start by making sure your local (on csci.hsutx.edu) repository has the most recent files from the course homework repository.
dump_regs that will show (in hex) the values of the registers.
In the ld01 directory write an assembly program that uses the
%include directive to include ../lib/dumpregs.asm. Move the
number 10 to r8 and then call dump_regs and inspect the
output.
mov r8,int mov r9,floaty mov r10,[int] mov r11,[floaty] dump_regs
If you subtract r8 from r9 (by hand) what do you get? Why? Ponder the output until you understand it.
dump_regs to show the memory contents. Compare the output of
the program with your hand-written solution and reconcile any differences.
One simple way to do this is:
mov rax,[int] ; moves 8 bytes at int into rax mov rbx,[int+8] ; moves 8 bytes at int+8 into rbx mov rcx,[int+16] ; etc. ...
mov qword [somememory],0x33333333 After you see the effect of this command,
remove the word qword from it and re-compile. Why is qword
required for this mov command but not for any of the other mov
commands in this program?