From the course: Learning Assembly Language
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Calling the printf external function - Python Tutorial
From the course: Learning Assembly Language
Calling the printf external function
- [Instructor] It's useful to be able to display outputs, using a format string. This is achieved when programming in C by using the printf function. Let's borrow this function from C and use it in our assembly code. We'll use the basic starter program and put in a message and a format string. Msg db Valhalla. Fmt db The norse gods live in %s, 0Ah,0. And in the main code area, we'll invoke printf. Invoke printf, addr of fmt, addr of msg, 0. That's all we need to code. In the top right panel, we need to add the msvcrt.dll library. Msvcrt.dll. Okay, let's build that. And in our command shell, when we run it, we get a formatted output line.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Calling subprograms9m 20s
-
(Locked)
Working with floating point6m 23s
-
(Locked)
Managing arrays4m 43s
-
(Locked)
Adding plugs to the Enigmatic encryptor2m 54s
-
(Locked)
The Windows API5m 4s
-
(Locked)
More on the Windows API4m 20s
-
(Locked)
Calling the printf external function1m 33s
-
(Locked)
Executing system commands1m 54s
-
(Locked)
Jump tables3m 29s
-
(Locked)
Reading data files6m 33s
-
-
-
-
-