2019Apress eBooksRequires access

Your First Program

Jo Van Hoey

Open publisher page 0 citations

Abstract

Generations of programmers have started their programming careers by learning how to display hello, world on a computer screen. It is a tradition that was started in the seventies by Brian W. Kernighan in the book he wrote with Dennis Ritchie, The C Programming Language . Kernighan developed the C programming language at Bell Labs. Since then, the C language has changed a lot but has remained the language that every self-respecting programmer should be familiar with. The majority of “modern” and “fancy” programming languages have their roots in C. C is sometimes called a portable assembly language, and as an aspiring assembly programmer, you should get familiar with C. To honor the tradition, we will start with an assembler program to put hello, world on your screen. Listing 1-1 shows the source code for an assembly language version of the hello, world program, which we will analyze in this chapter. ;hello.asm section .data msg db "hello, world",0 section .bss section .text global main main: mov rax, 1 ; 1 = write mov rdi, 1 ; 1 = to stdout mov rsi, msg ; string to display in rsi mov rdx, 12 ; length of the string, without 0 syscall ; display the string mov rax, 60 ; 60 = exit mov rdi, 0 ; 0 = success exit code syscall ; quit

About this research paper

What this paper is about

Generations of programmers have started their programming careers by learning how to display hello, world on a computer screen. It is a tradition that was started in the seventies by Brian W. Kernighan in the book he wrote with Dennis Ritchie, The C Programming Language . Kernighan developed the C programming language at Bell Labs. Since then, the C language has changed a lot but has remained the language that every self-respecting programmer should be familiar with. The majority of “modern” and “fancy” programming languages have their roots in C. C is sometimes called a portable assembly language, and as an aspiring assembly programmer, you should get familiar with C. To honor the tradition, we will start with an assembler program to put hello, world on your screen. Listing 1-1 shows the source code for an assembly language version of the hello, world program, which we will analyze in this chapter. ;hello.asm section .data msg db "hello, world",0 section .bss section .text global main main: mov rax, 1 ; 1 = write mov rdi, 1 ; 1 = to stdout mov rsi, msg ; string to display in rsi mov rdx, 12 ; length of the string, without 0 syscall ; display the string mov rax, 60 ; 60 = exit mov rdi, 0 ; 0 = success exit code syscall ; quit

Why it matters

A significance statement is not available in the OpenAlex record.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available abstract

Generations of programmers have started their programming careers by learning how to display hello, world on a computer screen. It is a tradition that was started in the seventies by Brian W. Kernighan in the book he wrote with Dennis Ritchie, The C Programming Language . Kernighan developed the C programming language at Bell Labs. Since then, the C language has changed a lot but has remained the language that every self-respecting programmer should be familiar with. The majority of “modern” and “fancy” programming languages have their roots in C. C is sometimes called a portable assembly language, and as an aspiring assembly programmer, you should get familiar with C. To honor the tradition, we will start with an assembler program to put hello, world on your screen. Listing 1-1 shows the source code for an assembly language version of the hello, world program, which we will analyze in this chapter. ;hello.asm section .data msg db "hello, world",0 section .bss section .text global main main: mov rax, 1 ; 1 = write mov rdi, 1 ; 1 = to stdout mov rsi, msg ; string to display in rsi mov rdx, 12 ; length of the string, without 0 syscall ; display the string mov rax, 60 ; 60 = exit mov rdi, 0 ; 0 = success exit code syscall ; quit

Key concepts: Programmer, Listing (finance), Programming language, Computer science, Assembly language, Code (set theory), Honor, Software

Related papers

Back to paper searchBrowse research topicsOriginal source
Your First Program — Research Paper | ScholarLens