Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- .model flat, c
- .stack 100h
- printf PROTO arg1:Ptr Byte, printlist:VARARG
- .data
- msg1fmt byte "%s%d", 0Ah, 0 ;string formatting
- msg1 byte "The answer is: ", 0
- num1 sdword ? ;create variables called num 1
- num2 sdword ? ;create variable num 2
- .code
- main proc
- mov num1, 5 ;mov takes 2 operands (take 5, move to first operand from ___)
- mov eax, num1 ;take the data from num1 into a register (we will mostly use eax)
- mov num2, eax ;move data from register into num2
- INVOKE printf, ADDR msglfmt, ADDR msgl, num2 ;will call our printf function with msg1fmt
- ret ;ret or return
- main endp ;tell the system our procedure is ending
- end ;tell the program it's ending
- ;first column names, second column data type
- ;3rd column = ?
- ; strings are null terminated with a 0
- ;assembly cannot directly move data from variable to variable.
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement