Step 4: Modify the hello world application
Table of Contents
Objective: Modify the text of the hello world application to display your in the ASCII representation.
To review, assembling and compiling an .asm code file is a
two-part process:
nasm -f win32 file.asmnasmis the assembler program-fspecifies the format, which is win32file.asmis the file to parse and then create the.objfile
gcc file.obj -o file.exegccis the compilerfile.objis the assembled file used to create the executable-o file.exespecifies the output file in the form of an executable
Display your name in ASCII
Your task is to modify the hello world application to display a custom message. The output from the executable should display your name and the integer representation of your name based on the ASCII characters. You’ll learn how to convert ASCII to integers using assembly code in a future lab. :) For now, use the ASCII codes as a your reference.
Hint
For example: Aziz - 065 122 108 122
A = 065
z = 122
i = 108
z = 122
Create a new
.asmfile calledlab1-YourName.asmChange the output to display your name and the ASCII representation.
Examples of output:
Sarah - 083 097 114 097 104
Sanjar - 083 097 110 106 097 114
Stephen - 083 116 101 112 104 101 110
Upload the
.asmand.objfiles to the LMS.
Note
Modify the code header to include the:
Name of the file
A short description of what the file does
Your name and date