Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ------------------------------------------------------------
- ; Basic code for printing data in ASSM under MSVS or SASM
- ;
- ; R. M June 2016
- ; ------------------------------------------------------------
- ; Library for I/O and other purposes
- ; ----------------------------------
- include c:\asmio\asm32.inc
- includelib c:\asmio\asm32.lib
- includelib c:\asmio\user32.lib
- includelib c:\asmio\kernel32.lib
- ; ------------------------------------------------------------
- .const
- NULL = 0
- ; -----------------------------------
- .data ; Data section
- message byte "Rich", NULL
- minput byte "Enter a number: ", NULL
- number dword ?
- ; -------------------------------------------------------------
- .code
- main proc
- ; Simple string output
- ; --------------------
- mov edx, OFFSET message ; String must be in edx
- call WriteString ; Shows it on screen
- call crlf ; This is the endl in C++
- call crlf ; It will skip 2 lines
- ; Simple Input/output
- ; ----------------------------
- mov edx, OFFSET minput ; String must be in edx
- call writeString ; Show it on screen
- call readInt ; Info is read into EAX
- mov number, eax ; Store number in var
- call writeInt ; Display again on screen
- ; New code here..
- call crlf
- call crlf
- call readInt ; Leave this here for now.
- ret 0 ; Must return 0 in ASM
- main endp ; Ends the main procedure
- end main ; Ends the whole program
- ; --------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement