Another question about my programming class, well actually a few. To begin with the program has already been written and the code can be found below.
Question #1:
Now, in the instructions it explicitly states that the program can be done in protected mode or real-address mode. I'm fairly certain that Windows runs in protected mode and as such this means I have done the exercises in such a manner. If I wanted to, how would one change which mode the program executes in? Am I correct in saying windows operates in protected mode?
Question #2:
I have written a few comments in the assembly code below is the one stating how the first 16-bits of the register have been filled correct?
Question #3:
Lastly the instruction call for inclusion of the Listing file and Map file in the final submission, I cannot locate these files.
TITLE Subtracting Three Integers
; This program takes three integers in hexidecimal and then subtract the 2nd and 3rd from the first.
INCLUDE Irvine32.inc
.code
main PROC
mov ax,0109h ;stores integer 265 in ax(16-bit register)
mov bx,0041h ;stores integer 65 in bx(16-bit register)
mov cx,0064h ;stores integer 100 in cx(16-bit register)
sub ax,bx
sub ax,cx
call DumpRegs
comment !
The dump regs returns the value of EAX=763B0064 BAX=7FFD0041 CAX=00000064
because EAX EBX and ECX are 32-bit registers they fill the first 16-bits with
unallocated data from other programs
!
exit
main ENDP
END main